Welcome to the LimeSurvey Community Forum

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

Exclusive Option in Ranking

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 5 months ago #208272 by blocka
Exclusive Option in Ranking was created by blocka
I have a ranking question that has 6 options. Two of which are: Not sure and No preference.

If either of these are included the ranking, then no other options should be allowed to be ranked.

I've attached my question file. I found another post that talked about exclusive options in a ranking question, so I copied the suggested validation logic. But when you look at the question, pretty obvious it doesn't work -- just not so obvious to be me how to make it work.

File Attachment:

File Name: limesurvey...9052.lsq
File Size:4 KB


Can someone assist?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208305 by tpartner
Replied by tpartner on topic Exclusive Option in Ranking
LimeSurvey version?

Please attach survey exports (.lss files) containing only the relevant question(s). Question/group exports force us to do more work trying to help you.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 5 months ago #208311 by blocka
Replied by blocka on topic Exclusive Option in Ranking
Version 3.25.0+201117

File Attachment:

File Name: limesurvey...9052.lsq
File Size:4 KB
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago - 3 years 5 months ago #208312 by tpartner
Replied by tpartner on topic Exclusive Option in Ranking
Still no .lss file.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 5 months ago by tpartner.
The topic has been locked.
  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 5 months ago #208313 by blocka
Replied by blocka on topic Exclusive Option in Ranking
Note to self: Never do any work before having coffee.

LSS finally attached!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago - 3 years 5 months ago #208314 by tpartner
Replied by tpartner on topic Exclusive Option in Ranking
Given that the question code is Q51, the exclusive answer codes are 5 and 6 and there are maximum 3 answers, this should be the question validation equation.

Code:
(Q51_1 == '5' AND is_empty(Q51_2) AND is_empty(Q51_3)) 
OR
(Q51_1 == '6' AND is_empty(Q51_2) AND is_empty(Q51_3))
OR
(Q51_1 != '5' AND Q51_2 != '5' AND Q51_3 != '5' AND Q51_1 != '6' AND Q51_2 != '6' AND Q51_3 != '6')

Sample survey attached:

File Attachment:

File Name: limesurvey...9433.lss
File Size:16 KB


Having said that, it may be an idea to insert a previous question asking whether they want to rank and use relevance to hide/show the ranking question. (I find it odd to rank an option "Unsure" or "No preference")

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 5 months ago by tpartner.
The topic has been locked.
  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 5 months ago #208315 by blocka
Replied by blocka on topic Exclusive Option in Ranking
Thanks muchly! That works perfectly.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose