Welcome to the LimeSurvey Community Forum

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

Show question when a specific option is one of the selected items in a ranked q

  • Aaargh
  • Aaargh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 5 months ago #233508 by Aaargh
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.4.9+221101
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity
==================
I have a ranked question with a bunch of options, one of which is "other.."  if the participant uses this as any of their choices, I want to show an additional large-text question allowing them to elaborate. 

What I'm struggling with is how to set up the condition for this field. I can of course do (pseudocode): "if rank1 == other || rank2 == other || rank3" but that gets old fast if you have a lot of options. Is there a way to simply do something like: "q1.selectedOptions.contains(other)" ?

I can't find anything like this in the manual. 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #233522 by Joffm
You only have to count the appearance of "Other" and display the question if the count is greater than 0.
Use function "countif" like
countif("98",that.Q1)
with
98 = code of "Other"
Q1: Code of rank question

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Aaargh
  • Aaargh's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 5 months ago #233631 by Aaargh

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose