- Posts: 222
- Thank you received: 10
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Array headings with subheadings
- krosser
- Topic Author
- Offline
- Elite Member
Less
More
4 years 11 months ago #182139
by krosser
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Array headings with subheadings was created by krosser
Hi guys!
I would like to make such an array with subheadings (see the pic below). Unfortunately, I have not found a similar thread on the forum. If anyone knows a JS script, please share. Thanks!
I would like to make such an array with subheadings (see the pic below). Unfortunately, I have not found a similar thread on the forum. If anyone knows a JS script, please share. Thanks!
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
4 years 11 months ago #182156
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Array headings with subheadings
The full-size array should only take a little basic jQuery manipulation but how do you want it to behave on smaller devices (phones)?
Can you attach a small sample survey containing only that array?
Can you attach a small sample survey containing only that array?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- krosser
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 222
- Thank you received: 10
4 years 11 months ago #182168
by krosser
Well, good point about smaller devices. It seems that this change would mess up rendering. I don't know whether it is possible to manage rendering of subheadings for both subquestion and answer axes. Because for subquestions it would be possible to place the heading on top of each subquestion-answer choice box.
But hopefully the survey is going to be used only on bigger screens.
The sample survey attached.
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Replied by krosser on topic Array headings with subheadings
tpartner wrote: The full-size array should only take a little basic jQuery manipulation but how do you want it to behave on smaller devices (phones)?
Can you attach a small sample survey containing only that array?
Well, good point about smaller devices. It seems that this change would mess up rendering. I don't know whether it is possible to manage rendering of subheadings for both subquestion and answer axes. Because for subquestions it would be possible to place the heading on top of each subquestion-answer choice box.
But hopefully the survey is going to be used only on bigger screens.
The sample survey attached.
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
4 years 11 months ago #182190
by holch
Unfortunately, this is rather wishful thinking. I just ran a survey among company employees and we specifically told them that they should answer on ther computer or notebook and not on a tablet or a smartphone, because one of the questions was an array with 7 columns (number input) and a variable amount of lines (subquestions in Limesurvey).
But even when stated in the email and in the introduction text of the survey, there are always people who will not read it and then wonder, why it takes them so long to fill in the questionnaire.
Surveys are generally not their primary concern and many people do it when they don't have much to do, so while they are commuting, waiting somewhere, etc. That is when they use their mobile phone.
It is difficult for us researcher, because sometimes a "nice" matrix question seems to be the obvious and easy solution, but with the mobile trend it is getting more an dmore difficult to use those type of questions. In my case I knew the respondents, they might even get in contact if something went wrong and I have sent them about 10.000.000 reminders and the company directors and area managers were interested that they fill the survey and that the response rate is high. But if you are running a survey with the general public, they might just leave your survey unanswered, if it is too complicated.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Array headings with subheadings
But hopefully the survey is going to be used only on bigger screens.
Unfortunately, this is rather wishful thinking. I just ran a survey among company employees and we specifically told them that they should answer on ther computer or notebook and not on a tablet or a smartphone, because one of the questions was an array with 7 columns (number input) and a variable amount of lines (subquestions in Limesurvey).
But even when stated in the email and in the introduction text of the survey, there are always people who will not read it and then wonder, why it takes them so long to fill in the questionnaire.
Surveys are generally not their primary concern and many people do it when they don't have much to do, so while they are commuting, waiting somewhere, etc. That is when they use their mobile phone.
It is difficult for us researcher, because sometimes a "nice" matrix question seems to be the obvious and easy solution, but with the mobile trend it is getting more an dmore difficult to use those type of questions. In my case I knew the respondents, they might even get in contact if something went wrong and I have sent them about 10.000.000 reminders and the company directors and area managers were interested that they fill the survey and that the response rate is high. But if you are running a survey with the general public, they might just leave your survey unanswered, if it is too complicated.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
4 years 11 months ago #182196
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Array headings with subheadings
To add those headers, place something like this in the source of the question:
Sample survey attached:
If you want to disable the table transformations on smaller screens, see this post - www.limesurvey.org/forum/design-issues/1...ransformation#180555
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Insert the column categories $('#question{QID} table.subquestion-list thead tr:eq(0) td:eq(0)').remove(); $('#question{QID} table.subquestion-list thead').prepend('<tr class="ls-heading">\ <td rowspan="2" colspan="2"></td>\ <th class="answer-text inserted-header" colspan="3">Category 1</th>\ <th class="answer-text inserted-header" colspan="3">Category 2</th>\ </tr>'); // Insert the row categories $('#question{QID} table.subquestion-list colgroup').remove(); $('#question{QID} table.subquestion-list tr.answers-list:eq(0)').prepend('<th class="answertext inserted-header" rowspan="2">Category 1</th>'); $('#question{QID} table.subquestion-list tr.answers-list:eq(2)').prepend('<th class="answertext inserted-header" rowspan="2">Category 2</th>'); }); </script>
Sample survey attached:
If you want to disable the table transformations on smaller screens, see this post - www.limesurvey.org/forum/design-issues/1...ransformation#180555
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: krosser
The topic has been locked.
- krosser
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 222
- Thank you received: 10
4 years 11 months ago #182230
by krosser
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Replied by krosser on topic Array headings with subheadings
Many thanks, Tony.
Can you please help with adapting the code to the Array (Numbers)?
I have managed the columns part, but cannot figure out the rows.
Sample survey attached too.
Can you please help with adapting the code to the Array (Numbers)?
I have managed the columns part, but cannot figure out the rows.
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Insert the column categories $('#question{QID} table.subquestion-list thead tr:eq(0) td:eq(0)').remove(); $('#question{QID} table.subquestion-list thead').prepend('<tr class="ls-heading">\ <td rowspan="2" colspan="1"></td>\ <th class="answer-text inserted-header" colspan="3">Category 1</th>\ <th class="answer-text inserted-header" colspan="3">Category 2</th>\ </tr>'); // Insert the row categories }); </script>
Sample survey attached too.
I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
The topic has been locked.
- stephanieteresa93
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
4 years 2 weeks ago - 4 years 2 weeks ago #194702
by stephanieteresa93
Replied by stephanieteresa93 on topic Array headings with subheadings
Hi,
I have copy /pasted this code into my survey. Attached you will see a preview of how it turned out. Is there a way to make sure that Twin 1 and Twin 2 is centred with the answer options?
Thank you,
Stephanie
I have copy /pasted this code into my survey. Attached you will see a preview of how it turned out. Is there a way to make sure that Twin 1 and Twin 2 is centred with the answer options?
Thank you,
Stephanie
Attachments:
Last edit: 4 years 2 weeks ago by stephanieteresa93.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
4 years 2 weeks ago #194707
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Array headings with subheadings
Please do not crosspost. You have asked this question in a separate post already.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3691
4 years 2 weeks ago #194715
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Array headings with subheadings
Can you attach a small sample survey (.lss file) containing only that question and your code?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.