Welcome to the LimeSurvey Community Forum

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

Multiple options with secondary options question validation

  • Payek
  • Payek's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 3 weeks ago #165083 by Payek
Hi all,
how can I validate multiple options question with secondary options? I used workaround from the manual ( Here in Lime Manual ), and everything works perfectly. But in my scenario, I want to force a participant wich check primary answer to chose at list one of the appropriate secondary options.

My Lime: Version 2.72.3+171020

Any hints are highly appreciated :)

Payek
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 3 weeks ago - 6 years 3 weeks ago #165086 by Joffm
Hi,
you know the code of the primary answer (PA) and the code of the secondary answers (SA1, SA2).

That means, this must be true:
PA=="Y" and (SA1=="Y" or SA2=="Y")
PA!="Y" and SA1!="Y" and SA2!="Y"

Okay, you have to dapt to your needs.
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 years 3 weeks ago by Joffm.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 weeks ago #165093 by Joffm
A bit more detailled:

Enter the following in "question validation"
((Q1_PA=="Y") AND ((Q1_SA1=="Y") OR (Q1_SA2=="Y"))) OR ((Q1_PA!="Y") AND (Q1_SA1!="Y") AND (Q1_SA2!="Y"))

1. Error:


2. Fine

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Payek
The topic has been locked.
  • Payek
  • Payek's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 2 weeks ago #165124 by Payek
Thank you very much, working perfectly!
Just for the record - you can use 'Question validation tip' to explain to participants what kind of answer do you expect.

THX! Joffm,

Payek
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 weeks ago #165126 by Joffm
Hi,
therefore was the second line in the screenshot.
Well, it's German, because it was a quick and dirty example.
Meaning here: "If 1, then alo 2 or 3"

Joffm

And the first line is Spanish, because I used an old survey with base language Spanish.

So it's a mix, but just to help as fast as possible.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Payek
  • Payek's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 2 weeks ago #165127 by Payek
Hi,
Once more THX! for your help. I wrote about 'Tip" to make life easier for other fresh lemons (like me) for whom it isn't as obvious as for ripe ones ;-)

Payek
The topic has been locked.
  • Payek
  • Payek's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 2 weeks ago #165260 by Payek
Hi again,
I made some tests and find two issues linked to validation mentioned above.
1. You can't use "exclusive option" (from advanced settings) because it always gives you an error.
2. When you mark the primary option validation tip appears, then when you mark secondary option tip disappear - it's OK. But when you unmark primary option (with marked secondary) error message appears (but you can submit the question). This behavior can be confusing for the participant.

My Lime version is 2.72.3+171020 and I used the workaround implementation for 2.5

I create a short test survey here: TEST - Secondary multiple options (for LS version 2.5)

THX for any suggestions,

Payek
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 weeks ago #165279 by Joffm
I see,
but you did not send a *.lss file. So I cannot see your validation.

On the other side you use a non-standard workaround.
Maybe you can improve the validation.

Or you restructure the question.
I can recommend Headers (advisable if nearly each option has suboptions):


Or just split the question (advisable if only a few options have suboptions):

Advantage: The cleanest way. It's standard out of the box.

Regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Payek
  • Payek's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 2 weeks ago #165282 by Payek
Thank you for the answer,
secondary options are quite useful in my survey (I think not only in my), but, as you write, it can be easily replaced with multiple options with headers. I'm not a programmer, but f I find any solution I share it here :-)

Payek
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 weeks ago #165290 by Joffm
Hi,
sorry, I forgot to add the sample survey.

File Attachment:

File Name: limesurvey...3-12.lss
File Size:29 KB


Joffm

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