Welcome to the LimeSurvey Community Forum

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

Condition for an answer option

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 2 months ago #225975 by Jmantysalo
Condition for an answer option was created by Jmantysalo
Let's suppose you ask for age and then what to drink. People under 18 should see water and juice, adults should see water, juice and beer. For multiple choice question ("checkbox") this is easy, just use condition for a subquestion. For single choise question ("radiobutton") it's not simple as there is no condition for answer options.

It is of course possible to copy a question, modify copy and use conditions age >= 18 and age < 18. This has of course drawbacks: If you modify text from juice to apple juice you must do the change in two plave. Is there any reasonable other way to this?

We are using 5.x, no older than 5 week ago released version.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #225979 by tpartner
Replied by tpartner on topic Condition for an answer option
Joffm has provided many examples of this.

Insert a hidden (via CSS) multiple-choice question and set its sub-questions with a hidden equation question. You can then filter the list-radio question by the hidden question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #226002 by holch
Replied by holch on topic Condition for an answer option
We really need answer option relevance in addition to subquestion relevance.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: Jmantysalo, f_funke

Please Log in to join the conversation.

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 2 months ago #226052 by Jmantysalo
Replied by Jmantysalo on topic Condition for an answer option
Any link to an example? I already tried to google this.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago - 3 years 2 months ago #226053 by Joffm
Replied by Joffm on topic Condition for an answer option
[url] forums.limesurvey.org/forum/can-i-do-thi...tion?start=15#216947 [/url]

Shows how to use the hidden multiple question and how to preset it.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 2 months ago by Joffm.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #226061 by tpartner
Replied by tpartner on topic Condition for an answer option
It should also be noted that you don't necessarily need to filter all answers. So, to use your example, you could have a single sub-question with the same code as "Beer" in the hidden multiple-choice.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 2 months ago #226099 by Jmantysalo
Replied by Jmantysalo on topic Condition for an answer option
I made a help page for this: survey.tuni.fi/help/condition-option.html
The following user(s) said Thank You: tpartner

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 months ago #226114 by tpartner
Replied by tpartner on topic Condition for an answer option
Nice, but as I suggested above, if these answers are to always be show, you don't need the "wa" or "ju" sub-questions in the hidden question. You can have a "partial" array filter.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 2 months ago #226115 by Jmantysalo
Replied by Jmantysalo on topic Condition for an answer option
I didn't get that to work. ...and now, with another try, it works like a charm.

Gonna change the text later, i guess. Thanks.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose