Welcome to the LimeSurvey Community Forum

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

Matriz 2 níveis, Escala Resp. 1 só admite resposta mesmo nível Escala da Resp.2

More
2 weeks 6 days ago #275250 by Luciana.Fabiano
Please help us help you and fill where relevant:
LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey Cloud:
Survey theme/template: Fruity TwentyThree
==================
Hello. Could you please help me solve this? I created a dual-scale matrix question with sub-questions SQ001 through SQ005; Response Scale 1 ranges from AO01 to AO06, and Response Scale 2 ranges from AO07 to AO12. The respondent should only be able to select options from the Scale 1 and Scale 2 dropdowns located in the same row as the corresponding sub-question—as this selection indicates they have chosen to answer that specific sub-question. Unfortunately, the Scale 1 and Scale 2 dropdowns in the rows corresponding to the other sub-questions remain active as well. I would like it so that when a Scale 1 dropdown is selected, only the corresponding Scale 2 dropdown in that same sub-question row remains active. Is this possible? Attached are two images: one showing the issue (marked with red arrows) and another showing the ideal scenario (marked with blue arrows). Is it possible to keep only the dropdowns on the same level active while disabling the others once the respondent makes a choice? Thanks in advance for your help.   

Please Log in to join the conversation.

More
2 weeks 4 days ago - 2 weeks 4 days ago #275259 by Joffm
Hi,
So you want to misuse this question type by packing three questions into it?
The clean solution would be to ask the question about the amount of compromisation, and afterwards the dual array only about the selected option.

Another solution with your approach would be a simple validation equation.
But a dual array has no option for a validation equation.

But you may use an array(text) with dropdown option.
Here you just check that
  • there are either 0 or 2 mentions in each row
  • that there are exact two mentions in the entire question
Unfortunately you did not answer the questions at the beginning about the version of LimeSurvey you are using and how and where it is hosted.
Therefore we can't say if you can use this javascript solution.

Nevertheless here it is:
array(text), y-axis coded "Y001", "Y002",... x-axis coded "X001", "X002", ...
Insert this script into the question text (source code mode)
Code:
<script type="text/javascript" charset="utf-8">   $(document).on('ready pjax:scriptcomplete',function(){     var thisQuestion = $('#question{QID}');     $('.answer-item.answer_cell_X001', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\               <option value="">...</option>\             <option value="1">Option 1</option>\             <option value="2">Option 2</option>\             <option value="3">Option 3</option>\             <option value="4">Option 4</option>\             <option value="5">Option 5</option>\     </select>');       $('.answer-item.answer_cell_X002', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\             <option value="">...</option>\             <option value="1">Option a</option>\             <option value="2">Option b</option>\             <option value="3">Option c</option>\             <option value="4">Option d</option>\             <option value="5">Option e</option>\     </select>');     // Listeners     $('.inserted-select', thisQuestion).on('change', function(i) {       if($(this).val() != '') {         $(this).closest('.answer-item').find('input:text').val($('option:selected', this).val()).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());       $('select.inserted-select', thisCell).val(inputText);     });     // Clean-up styles     $('select.inserted-select', thisQuestion).css({       'max-width': '100%'     });     $('.with-select input:text', thisQuestion).css({       'position': 'absolute',       'left': '-9999em'     });   }); </script>


And the question validation equation (linefeed for clarification)
Code:
count(self)==2 and count(self.sq_X001)<2 and count(self.sq_X002)<2 and (count(self.sq_Y001)==0 OR count(self.sq_Y001)==2) and (count(self.sq_Y002)==0 OR count(self.sq_Y002)==2) and (count(self.sq_Y003)==0 OR count(self.sq_Y003)==2) and (count(self.sq_Y004)==0 OR count(self.sq_Y004)==2) and (count(self.sq_Y005)==0 OR count(self.sq_Y005)==2)


Now you can use a general tip like "Please, select only <b>one</b> option and for that choice indicate the time metric <b>and</b> the efficiency metric"
or you give more specific tips using IF: {if(condition1,tip1,'')}({if(condition2,tip2,'')}



 
Best you send the lss export of these relevant questions. So we see your coding.
. 
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 weeks 4 days ago by Joffm.

Please Log in to join the conversation.

Moderators: tpartner, holch

Lime-years ahead

Online-surveys for every purse and purpose