- Posts: 2
- Thank you received: 0
- Forum
- English support forums
- Can I do this with LimeSurvey?
- How do I make question as mandatory based on certain answer of previous question
How do I make question as mandatory based on certain answer of previous question
6 months 1 week ago - 6 months 1 week ago #202417
by murthyma
How do I make question as mandatory based on certain answer of previous question was created by murthyma
Hello Team,
I have a survey with 3 questions.
Question 1: It has a slider to choose a value from 0 to 100.
Question 2: It has a dropdown with 3 values (Good, Ok, Bad).
Question 3: This question has to be displayed always, but it should be mandatory if a value in Question 1 is greater than 20, and if the value in Question 2 is Bad.
Could anyone suggest a solution, please?
I know using conditions we can display/show questions based on conditions of previous questions. But here i want to display the question always and set it mandatory based on value of previous questions. So, need to know where do we set this logic and what is the expression or step to set it based on my above questions.
Regards,
Murthy
I have a survey with 3 questions.
Question 1: It has a slider to choose a value from 0 to 100.
Question 2: It has a dropdown with 3 values (Good, Ok, Bad).
Question 3: This question has to be displayed always, but it should be mandatory if a value in Question 1 is greater than 20, and if the value in Question 2 is Bad.
Could anyone suggest a solution, please?
I know using conditions we can display/show questions based on conditions of previous questions. But here i want to display the question always and set it mandatory based on value of previous questions. So, need to know where do we set this logic and what is the expression or step to set it based on my above questions.
Regards,
Murthy
Last edit: 6 months 1 week ago by murthyma.
Please Log in to join the conversation.
Less
More
- Posts: 9782
- Thank you received: 3123
6 months 1 week ago #202418
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Replied by tpartner on topic How do I make question as mandatory based on certain answer of previous question
Depending on the question type, you can use a question validation equation.
For example, if Q3 is a list-radio, something like this:
For example, if Q3 is a list-radio, something like this:
(Q1 > 20 AND Q2 == "answerCodeBad" AND !is_empty(Q3))
OR
((Q1 <= 20 OR Q2 != "answerCodeBad") AND (!is_empty(Q3) OR is_empty(Q3)))
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Please Log in to join the conversation.
6 months 1 week ago #202420
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic How do I make question as mandatory based on certain answer of previous question
Or you could create 2 different questions, one mandatory, one none mandatory and show/hide them based on the previous questions via relevance equation.
But keep in mind that you would need to join the responses later. So I think Tpartner's solution is the more "elegant" one.
But keep in mind that you would need to join the responses later. So I think Tpartner's solution is the more "elegant" one.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.