Welcome to the LimeSurvey Community Forum

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

Answer Relevance Workaround

More
9 years 4 months ago #135029 by BBCMResearch
I know answer relevance is still in the works, but in the meantime, I was wondering if there was a way to do the following:

I need to set up an array with 10 subquestions and 4 answers.
However, I need the last 3 subquestions to only be able to selection answers 1 & 4 because answers 2&3 aren't applicable.

Help?
The topic has been locked.
More
9 years 4 months ago #135046 by first
Replied by first on topic Answer Relevance Workaround
I lost you at

...to only be able to selection answers 1 & 4 because answers 2&3 aren't applicable.


Survey Designer and Programmer
The topic has been locked.
More
9 years 4 months ago #135061 by tpartner
BBCMResearch, what LS version?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 4 months ago #135080 by BBCMResearch
Tony, apologies. I use 2.50+, Build 160412
The topic has been locked.
More
9 years 4 months ago #135081 by BBCMResearch
OMdev, picture a 10x4 array, with middle two columns grayed out for the last 3 rows. Subquestions 1-7 need to be able to choose from all 4 possible answers, but Subquestions 8-10, while staying in the same array, only need to be able to choose from answers 1 & 4.
The topic has been locked.
More
9 years 4 months ago #135105 by tpartner
You can add something like this to the source of the array question text:

Code:
<script type="text/javascript" charset="utf-8">    
  $(document).ready(function(){
 
    // Remove contents of ninth row, second and third cells
    $('#question{QID} tr.answers-list:eq(8) td.answer-item:eq(1) *').remove();
    $('#question{QID} tr.answers-list:eq(8) td.answer-item:eq(2) *').remove();
 
    // Remove contents of tenth row, second and third cells
    $('#question{QID} tr.answers-list:eq(9) td.answer-item:eq(1) *').remove();
    $('#question{QID}1 tr.answers-list:eq(9) td.answer-item:eq(2) *').remove();
  });
</script>

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: BBCMResearch
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose