Welcome to the LimeSurvey Community Forum

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

To display randomly not selected choice with certain conditions

  • Chouchicorita
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 7 months ago - 3 years 7 months ago #221609 by Chouchicorita
Hello,

Thanks to your help, i've got understood how to create randomly non selected choices using join, rand and substr equations.
But i still can't exclude certain options based on previously selected response.

For example, in my questionnaire, the first question asks which dish is taken (Q1). There are 4 options to choose (Meet, Seafood, Vegetarian, Vegan). According to the selected option, i want to show randomly one of the other choices (not selected ones). If Meet is chosen, Seafood or Vegetarian or Vegan appears. 

Now i'd like to exclude 'Vegan' as no choice when 'Vegetarian' is picked. I've tried to insert Q1!= to exclude but it doesn't seem to work. Could you check my file attached below ?

I would really appreciate your help.
Thank you 

 

File Attachment:

File Name: limesurvey...4275.lss
File Size:20 KB
Last edit: 3 years 7 months ago by Chouchicorita.
The topic has been locked.
  • Chouchicorita
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 7 months ago #221678 by Chouchicorita
Sorry i didn't upload the right file.
Please check the one below 

 

File Attachment:

File Name: limesurvey...7249.lss
File Size:21 KB
The topic has been locked.
  • Chouchicorita
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 7 months ago #221681 by Chouchicorita
I fixed the problem inserting "and is_empty(Q1_subquestion code that i wanted to exclude)"
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 7 months ago #221682 by Joffm
So, if "vegetarian" is chosen, there shall only appear "meat" or "seafood", but not "vegan"

Well, change the first equation to 
{join(if(is_empty(Q1_1),"A",""), if(is_empty(Q1_2),"B",""), if(is_empty(Q1_3) and is_empty(Q1_4),"C",""), if(is_empty(Q1_3) and is_empty(Q1_4),"D",""))}

You see, D=vegan is only entered if C=vegetarian was not selected and D=vegan was not selected.

 

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

Lime-years ahead

Online-surveys for every purse and purpose