Welcome to the LimeSurvey Community Forum

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

Skip Logic Based Question

  • jlindemann
  • jlindemann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 11 months ago #234125 by jlindemann
Skip Logic Based Question was created by jlindemann
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.1.17+211025
Own server or LimeSurvey hosting: Own Server
Survey theme/template: Modified Default Theme
==================
First time trying to use "skip logic" questions within LimeSurvey and unclear on the formatting or how to write the logic.
In my survey (attached) I want to base this logic off Group1 Question 3's answer. (G01Q03). 
Depending on the answer I want to either hide\show the other specific question groups.

If G01Q03 = "In-person on campus..."
     then show G03
     then hide G04

If G01Q03 = "mostly in-person but also virtual..."
     then show G03
     then show G04

If G01Q03 = "via Zoom..."
     then hide G03
     then show G04

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago #234129 by tpartner
Replied by tpartner on topic Skip Logic Based Question
The group relevance is a binary equation where the group is only shown if that equation returns true.

I have not looked at your survey but, for example if G01Q03 is a single choice question with answer codes 1, 2, 3, the relevance equations would be:

G03:
Code:
G01Q03 == '1' OR G01Q03 == '2'

G04:
Code:
G01Q03 == '2' OR G01Q03 == '3'

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.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 11 months ago - 1 year 11 months ago #234130 by Joffm
Replied by Joffm on topic Skip Logic Based Question
Hi,
each group / question / subquestion has a field "condition"
Question level:

Here you enter a logical term that is either TRUE or FALSE.
If TRUE the subquestion / question / group is displayed, if FALSE it is not.
Therefore you often see a "1" in this "condition" field.
In the programming language "0" means FALSE, "1" means TRUE
As described in the manual 
[url] www.limesurvey.org/manual/Question_type_...vance_equation.22.29 [/url]

Now, what is your condition for "G03" (group "In Person")?
This is a group. So you enter the condition on group level.
 
Either the respondent selected code "AO01" or he selected code "AO02" in question G01Q03.
Written as a logical term: G01Q03=="AO01" OR G01Q03=="AO02"

Exactly the same for group "G04" ("Zoom")
Either the respondent selected code "AO02" or he selected code "AO03" in question G01Q03.
Written as a logical term: G01Q03=="AO02" OR G01Q03=="AO03"

And if you use numerical codes instead of this "AO01", "AO02" you may do it shorter instead of using text as code and have to surround with brackets.
G03: G01Q03<3
G04: G01Q03>1

Especially in questions like G03Q01.
I assume later you will calculate some statistical values, like mean, std.deviation, median,... and do some tests like t-Test,...
How do you do this with text?
To be honest: The mean of "AO01" and "AO04" is not "AO02.5"


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 11 months ago by Joffm.
The following user(s) said Thank You: jlindemann

Please Log in to join the conversation.

  • jlindemann
  • jlindemann's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago #241876 by jlindemann
Replied by jlindemann on topic Skip Logic Based Question
It's been a few months since I looked at doing this. I had a little more time before this survey had to go out again this time and spent the time looking at your answers.

The brunt of my skip logic was based on my original question asking how they attended a class which had (4) radio button options

G01Q03
- AO01 In Person Location A
- AO02 In Person Location B
- AO03 Mostly In Person, some virtual
- AO04 All virtual

Since I had the rest of my survey blocked into themes/grouped related questions the next step became very easy where at the group level of questions I simply selected the group name (in this case "in person") - then selected EDIT

There are only a few fields here. Selecting the Relevance Equation I entered the following code so that it would display this block of questions based on the answers from my targeted question
G01Q03 == "AO01" OR G01Q03 == "AO02" OR G01Q03 == "AO03"

If the user answered from the first 3 options, it showed this block of questions. If the person answered the 4th option, this block was skipped.

Thanks again to Joffm and tpartner

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose