Welcome to the LimeSurvey Community Forum

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

How to skip a Ranking question when less than 2 options available

  • tylerreed
  • tylerreed's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #239536 by tylerreed
LimeSurvey version: Version 5.4.12+221121
Own server or LimeSurvey hosting: Self-hosted
Survey theme/template: Default
==================
We have a multiple choice question:  Which colors do you like?   With 4 options (black, white, blue, red) and no constraints on how many the user can select.
We have a subsequent Ranking question that asks the users to rank the colors they selected in the multiple choice question
The Ranking question filters the appropriate answers, so if the user only selects "black" and "blue" options in the multiple choice questions, then those are the only 2 they see in the ranking question. Works great!  And we have a condition setup so that if the user selects none of the colors, the ranking question is skipped.

However, if the user selects a single color (say "black"), the Ranking question then shows up with a single item to be ranked, "black".  How can we skip the Ranking question is the Multiple Choice question has less than 2 selections?

Thanks,
Tyler

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago #239544 by Joffm
Hi,
so you have to count the selected items.

In the implemented functions
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]
you find the function "count" with the explanation "count the number of answered (non-blank) questions in the list"

And you display the ranking question if this count is greater than 1.
According this the condition is
count(Q1_SQ001,Q1_SQ002,Q1_SQ003,...)>1

Using the "that" variable
[url] manual.limesurvey.org/ExpressionScript_-....22that.22_variables [/url]
you only say
count(that.Q1)>1

Joffm

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

Please Log in to join the conversation.

  • tylerreed
  • tylerreed's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago - 1 year 3 months ago #239553 by tylerreed
Thanks Joffm, that's all it took! I just popped this in the Condition field:  (count(that.G03Q05)>1 and (G02Q07.NAOK == "Y"))
Last edit: 1 year 3 months ago by tylerreed.

Please Log in to join the conversation.

More
1 year 2 months ago - 10 months 6 days ago #239976 by Tomypop
  1. To set Display or Skip Logic, select the question you wish to perform the action on and select Display logic or Skip logic under Question behavior menu.
  2. Display logic will display the selected question only if conditions are met.



<!--td {border: 1px solid #cccccc;}br {mso-data-placement:same-cell;}--> watch stories
<!--td {border: 1px solid #cccccc;}br {mso-data-placement:same-cell;}--> cc generator
Last edit: 10 months 6 days ago by Tomypop.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose