Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

fix the answers in a Matrix

  • Carlotta123
  • Carlotta123's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago - 2 years 9 months ago #218164 by Carlotta123
fix the answers in a Matrix was created by Carlotta123
If the matrix is quite Long it would be nice if the answers would be fixed if the people scroll down. Is that possible? And also it would be nice if the question would be fixed, while scrolling.
The Idea comes from excel, were it´s possible to do this.
Thanks were much for your answers.
Last edit: 2 years 9 months ago by Carlotta123.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #218177 by tpartner
Replied by tpartner on topic fix the answers in a Matrix
You can fix the position of the header row with the display:sticky rule but you will need to define a maximum height for the answer container. In my opinion, this may result in some respondents not seeing all of the sub-questions.

- www.w3schools.com/css/css_positioning.asp

Add some CSS something like this to the question source:

Code:
<style type="text/css" data-author="Tony Partner">
 
  @media only screen and (min-width: 768px) {  
    #question{QID} .answer-container {
      position: relative;
      max-height: 500px;
      overflow: scroll;
    }
 
    #question{QID} table.subquestion-list {
      text-align: left;
      position: relative;
      border-collapse: collapse; 
    }
 
    #question{QID} table.subquestion-list thead th,
    #question{QID} table.subquestion-list thead td  {
      position: sticky;
      top: 1px;
      z-index: 1000;
      background: #DDDDDD;
      border: 0 none;
      box-shadow: -1px 0 #000000, 0 1px #000000, 1px 0 #000000, 0 -1px #000000;
    }
 
    #question{QID} table.subquestion-list .ls-heading-repeat {
      display: none;
    }
  }
</style>

 

Sample survey attached:  

File Attachment:

File Name: limesurvey...1446.lss
File Size:53 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, boshra.m

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #218216 by DenisChenu
Replied by DenisChenu on topic fix the answers in a Matrix
Included in SkelVanilla
extensions.sondages.pro/themes-and-templ...le-with-fixed-header

With global option and Class name

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: tpartner, Carlotta123

Please Log in to join the conversation.

  • Carlotta123
  • Carlotta123's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #218315 by Carlotta123
Replied by Carlotta123 on topic fix the answers in a Matrix
Thanks very much.That helped a lot.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #218317 by DenisChenu
Replied by DenisChenu on topic fix the answers in a Matrix
@Carlotta123 : always pit your LimeSurvey version and build number when you ask a question.

I'ml afraid you can not apply the patches so easily on a 2.5X version.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

More
2 years 1 month ago #226223 by boshra.m
Replied by boshra.m on topic fix the answers in a Matrix
Hello,

This works nicely in the version of Limesurvey I am using (LimeSurvey Cloud Version 5.2.13, fruity theme), thank you! I do wonder though if there is a way to have just the header move down as we scroll down the "main page"?

I hope I am making sense. 

Thank you!

Please Log in to join the conversation.

More
2 years 3 weeks ago - 2 years 3 weeks ago #226581 by boshra.m
Replied by boshra.m on topic fix the answers in a Matrix
Hi, 

I have merged this code with the code mentioned here:  forums.limesurvey.org/forum/can-i-do-thi...able-cells-in-arrays but I'm not sure why when I do include the following in custom.css:

td.inserted-header {
    font-weight: bold;
    text-align: center;
    vertical-align: middle !important;
    font-style: Italic;
}

Nothing happens. Ie. The text I included in the header does not italicize or become bold. I'm wondering if there is something I missing?
Last edit: 2 years 3 weeks ago by boshra.m.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 weeks ago #226582 by Joffm
Replied by Joffm on topic fix the answers in a Matrix
Why do you add something to this 8 months old thread about a different topic.
You'd better stick to your other thread "Fixing added headers"
[url] forums.limesurvey.org/forum/can-i-do-thi...-fixing-added-header [/url]

But just adding this to the source of the question
Code:
<style type="text/css">td.inserted-header {
    font-weight: bold;
    text-align: left;
    vertical-align: middle !important;
    font-style: italic;
    color:maroon;
}
</style>
shows this
 

You said you added the css to the custom.css.
Did you make sure that there is nothing left in the source of the question?

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: boshra.m

Please Log in to join the conversation.

More
2 years 3 weeks ago #226583 by boshra.m
Replied by boshra.m on topic fix the answers in a Matrix
Hi,

Sorry about that. This worked perfectly. Thank you!

Please Log in to join the conversation.

More
1 year 11 months ago #227642 by boshra.m
Replied by boshra.m on topic fix the answers in a Matrix
Hello,

If I wanted to UNBOLD the answer options (ie. Extremely unlikely, Unlikely, etc.), for ALL array questions, how would I go about doing this? I have currently attempted using:

<style type="text/css">td.answeroption {
font-weight: normal;
}
</style>

in my custom.css and theme.css however this did not change anything. I was thinking of including the array class but I am unsure on how to incorporate this (I would have to include all of the different array classes also).

Thank you!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #227648 by Joffm
Replied by Joffm on topic fix the answers in a Matrix
Where did you find this class "td.answeroption" ?
Is it from a very, very old version of LimeSurvey?

If you investigate with the webdevelopment tool of your browser (F12) you will see
 

So add to your "custom.css"
Code:
.fruity .ls-answers .ls-heading th {
    font-weight: 400;  // or whatever you like
}

A month ago you said that you use "fruity". So you have to prepend the class with ".fruity"

And again you added your question to a post that is really not related to it.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: boshra.m

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #227649 by Joffm
Replied by Joffm on topic fix the answers in a Matrix
And please heed this
In "theme.css"
 

Use the "custom.css"

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: boshra.m

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose