Limesurvey, 4 Routing Conditions
Routing is the process of determining a route through your survey. For instance, after asking the age of a person in question 1, you can decide what the next question has to be. If the age is more than 18, you can for instance go to question 2 about marriage and later skip question 3, otherwise skip question 2 and go to question 3 about toys. Tradionally routing is hard and leads to complicated graphs with many arrows and complicated if this, then that statements. Fortunately Limesurvey decided to stop using routing altogether from version 2.0 onward. Rejoice! We are using version 7. You will never, ever have to learn about routing.
Instead of routing (remember, routing is bad, complicated and error prone) Limesurvey uses the concept of Conditions (formerly called Relevance). Conditions are good, trivial to use and can stop global warming, war and bad music. All you have to do is decide for each question group, question or subquestion whether it is relevant given the circumstances. You do this in the Condition field.
Now go back to our survey Family Life. Go to the question group Marital status to the question Are you married
It does not make much sense to ask this question to minors, so whe will make it isvisible for people under the age of 18
Click on the question text and in the lower right select the + in front of New logic Select the previous question that th econdition depends on, the comparison operator and enter the Free value 18:
After setting the condition in this way, you can see the condition that you just constructed with the condition designer in the Question settings -> Condition field. It will say something like age >= 18 but likely a bit obscured by parentheses and extra code:
It is usually necessary that you put this question in a new question group. If the question about age would be in the same group as the question about marriage, then the latter cannot appear conditionally. It wil be there always or never. Question groups do not change once they are shown on the screen. (Well that that used to be the case, but it is still best practice not to change a page once it has been shown to the participant.)
Test the entire survey by hovering over the eye icon in the top right and clicking English. Try it twice. Once using 12 for age, once using 20 for age. Do you notice that the question about mariage is only shown if it is relevant? That is what the condition field is all about. By default there is a 1 in this field. That means true. You can replace it with 0, which would make the question always irrelevant
Group and subquestion conditions
Conditions can be set for whole question groups and for subquestions as well. You cannot use the condition designer however. You can enter the condition directly in the Group settings -> conditon field after clicking the group title. A condition of 1 means always:
A condition of 0 would mean never
For subquestions it works the same way as for question groups. You must enter the condtions manually
If you like the conditon designer and you want to use it for a question group or a subquestion, feel feel to design the condition for a question and then copy-paste it to the conditon field of the question group or subquestion.
More complicated conditions
To replace routing, more complex relevance equations are necessary too:
- You may want set two conditions to prevent certain people from entering your survey.
- age>17 && name!="Elizabeth Taylor"
- Or make exceptions to allow some to marry younger.
- age>17 || name=="Bo Derek"
Continue with the next lesson