Welcome to the LimeSurvey Community Forum

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

Question "Yes" Or "NO". If No then the Comment is necessary

  • YCARRE
  • YCARRE's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #207846 by YCARRE
Dear

I begin to use Limesurvey and i've a first issue with it.
In fact, I created a question with 2 answers "Yes or No". If the user select "No" I'd like to ask him to put a comment.
I try with "Question validation equation" but i've an error "Undefined Variable"

Below my syntax :

AO01 == 'Yes' OR (AO02 == 'No' AND Q00001_comment != '')

Thnak you for your help

Yannick
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #207848 by Joffm
Hi,

Your syntax is not correct.
As your question code is "Q00001", the question is answered with the answer option code.
At the moment you compare an answer option code "AO01" with a text "Yes".
But you have to compate the question code with the desired answer option code:
IF question Q00001" is answered with "A001" then ...

So the syntax is Q00001!="AO02" OR (Q00001=="AO02" AND Q00001_comment != '')
You see the small improvement by Q00001!="AO02" to avoid an error message if the question is still empty.





By the way:
In my opinion a better solution would be to have a singel "Yes/No" question followed by a question of type "long text" that is only displayed if the fiest question was answered with "No"

Either


or

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose