Welcome to the LimeSurvey Community Forum

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

Answer Relevance Workaround

  • BBCMResearch
  • BBCMResearch's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 11 months ago #135029 by BBCMResearch
Answer Relevance Workaround was created 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
7 years 11 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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #135061 by tpartner
Replied by tpartner on topic Answer Relevance Workaround
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.
  • BBCMResearch
  • BBCMResearch's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 11 months ago #135080 by BBCMResearch
Replied by BBCMResearch on topic Answer Relevance Workaround
Tony, apologies. I use 2.50+, Build 160412
The topic has been locked.
  • BBCMResearch
  • BBCMResearch's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 11 months ago #135081 by BBCMResearch
Replied by BBCMResearch on topic Answer Relevance Workaround
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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #135105 by tpartner
Replied by tpartner on topic Answer Relevance Workaround
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.

Lime-years ahead

Online-surveys for every purse and purpose