- Posts: 5
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
SOLVED - Triple-scale array question? Matrix with different scales
- DamianP
- Topic Author
- Offline
- New Member
Less
More
4 years 6 months ago - 4 years 6 months ago #189246
by DamianP
Triple-scale array question? Matrix with different scales was created by DamianP
Hello Lime-Geniuses!
Is there a good soul that can help me?
I was wondering if i can do the triple-scale array question with different scales?
I have been reading for a while and what i have found for now (which i think is the closest to solution) is merging 3 questions with some JS.
However people say it works only for the same type of questions. I really need it to be like in the attached file.
Unfortunetaly i don't know JS Is it hard to write a code that would change a dual-scale array for triple-scale? Or maybe there is some other solution?
Any help would be much appreciated Guys!
Damian.
Is there a good soul that can help me?
I was wondering if i can do the triple-scale array question with different scales?
I have been reading for a while and what i have found for now (which i think is the closest to solution) is merging 3 questions with some JS.
However people say it works only for the same type of questions. I really need it to be like in the attached file.
Unfortunetaly i don't know JS Is it hard to write a code that would change a dual-scale array for triple-scale? Or maybe there is some other solution?
Any help would be much appreciated Guys!
Damian.
Attachments:
Last edit: 4 years 6 months ago by DamianP.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12902
- Thank you received: 3967
4 years 6 months ago #189253
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Triple-scale array question? Matrix with different scales
Hi,
you can do this
Put this into the question text.
As you might have seen:
The codes of the x-scale are: "X001", "X002", ...
Best regards
Joffm
you can do this
Put this into the question text.
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); // Insert selects $('.answer-item.answer_cell_X001', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\ <option value="">select...</option>\ <option value="1">Tak</option>\ <option value="2">Nie</option>\ <option value="3">Nie wiem</option>\ </select>'); $('.answer-item.answer_cell_X002', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\ <option value="">select...</option>\ <option value="1">Tak</option>\ <option value="2">Nie</option>\ <option value="3">Nie wiem</option>\ </select>'); $('.answer-item.answer_cell_X003', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\ <option value="">select...</option>\ <option value="1">Bardzo male</option>\ <option value="2">Male</option>\ <option value="3">Srednie</option>\ <option value="4">Duze</option>\ <option value="5">Bardzo duze</option>\ </select>'); // Listeners $('.inserted-select', thisQuestion).on('change', function(i) { if($(this).val() != '') { $(this).closest('.answer-item').find('input:text').val($.trim($('option:selected', this).text())).trigger('change'); } else { $(this).closest('.answer-item').find('input:text').val('').trigger('change'); } }); // Returning to page $('.with-select input:text', thisQuestion).each(function(i) { var thisCell = $(this).closest('.answer-item'); var inputText = $.trim($(this).val()); var selectval = $('select.inserted-select option', thisCell).filter(function () { return $(this).html() == inputText; }).val(); $('select.inserted-select', thisCell).val(selectval); }); // Clean-up styles $('select.inserted-select', thisQuestion).css({ 'max-width': '100%' }); $('.with-select input:text', thisQuestion).css({ 'position': 'absolute', 'left': '-9999em' }); }); </script>
As you might have seen:
The codes of the x-scale are: "X001", "X002", ...
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The following user(s) said Thank You: DamianP
The topic has been locked.
- DamianP
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 1
4 years 6 months ago #189256
by DamianP
Replied by DamianP on topic Triple-scale array question? Matrix with different scales
Really really big thanks for your engagement!
However, we have 60 subquestions, so it will be hard for our respondents to click 180 times to unfold the responses.
I guess it is not possible to change it into radio buttons?
Sorry for beeing that picky. I really appreciate you responded in the first place. Not mentioning that You have provided me with a copy-paste code!
However, we have 60 subquestions, so it will be hard for our respondents to click 180 times to unfold the responses.
I guess it is not possible to change it into radio buttons?
Sorry for beeing that picky. I really appreciate you responded in the first place. Not mentioning that You have provided me with a copy-paste code!
The topic has been locked.
- DamianP
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 1
4 years 6 months ago - 4 years 6 months ago #189307
by DamianP
Replied by DamianP on topic SOLVED - Triple-scale array question? Matrix with different scales
I found a guy who figured it out for me.
So if anyone has the same problem - Enjoy the solution
One thing you have to remember - The triple array cannot be the first question or group in the survey.
LSS and LSG attached.
Thanks one more time @Joffm!!
So if anyone has the same problem - Enjoy the solution
One thing you have to remember - The triple array cannot be the first question or group in the survey.
LSS and LSG attached.
Thanks one more time @Joffm!!
Attachments:
Last edit: 4 years 6 months ago by DamianP.
The following user(s) said Thank You: holch
The topic has been locked.