- Posts: 2
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Disable Certain Answer Choices Based on Previous Answers
- JBPichelski
- Topic Author
- Offline
- New Member
Less
More
3 years 2 months ago #212147
by JBPichelski
Disable Certain Answer Choices Based on Previous Answers was created by JBPichelski
Hi. I'm wondering if it's possible to block people from giving certain answers depending on their answers to preivous questions.
Right now, the best way I can find to do something like this is to create 2 different questions and send the users to each one depending on their answer to the first question using conditions. I would rather keep all the results for question 2 in one place, so I was wondering if there was any way of disabling certain answers depending on a participant's previous answer.Example
Question 1: Are you allergic to nuts?Question 2: What is your favourite food?
- No
- Yes
If question 1 = NoIf question 1 = Yes
- Pizza
- Apples
- Chicken
- Nuts
- Pizza
- Apples
- Chicken
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12938
- Thank you received: 3979
3 years 2 months ago #212149
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Disable Certain Answer Choices Based on Previous Answers
To be honest, the solution with two separated questions is the easiest.
And the only item we have to care of is "nuts".
As a list(radio) question doesn't have "subquestion relevance" you have to do this many times explained procedure.
Between the two questions (Q1 and Q2) create a (hidden) question of type "multiple" (Q2m) with the four items
Then create a (hidden) question of type "equation" with
{Q2m_4=if(Q1!=1,"Y","")}
Now you set the array filter of Q2 to Q2m.
Remember:
The codes of the multiple question and your second question have to be identical.
The two questions can't be displayed on one page.
Joffm
And the only item we have to care of is "nuts".
As a list(radio) question doesn't have "subquestion relevance" you have to do this many times explained procedure.
Between the two questions (Q1 and Q2) create a (hidden) question of type "multiple" (Q2m) with the four items
- Pizza
- Apples
- Chicken
- Nuts
Then create a (hidden) question of type "equation" with
{Q2m_4=if(Q1!=1,"Y","")}
Now you set the array filter of Q2 to Q2m.
Remember:
The codes of the multiple question and your second question have to be identical.
The two questions can't be displayed on one page.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- JBPichelski
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
3 years 2 months ago #212221
by JBPichelski
Replied by JBPichelski on topic Disable Certain Answer Choices Based on Previous Answers
Thank you for answering. In the end I decided to go just add a warning on the next page if a participant's answers don't match up. Still, really happy to get an answer to this question so I know for the future.
The topic has been locked.