The simplest way to implement routing is the conditions manager. With a simple user interface you can select what questions and answers determine whether any given question should show – or not show, depending on the situation.
First off, LimeSurvey uses a hide/show logic for every question and question group to implement routing. This means that you cannot directly set a question to ‘jump to’ another section or question based on a previous answer. You can of course simulate such behaviour by setting questions that you want to skip not to show based on a condition.
Secondly, the conditions manager is based on a user interface that is somewhat limited, it supports only the listed operators, and does not allow for calculations or other advanced operations in a condition. Similarly, when you use multiple conditions, there is no way to change how they interact; LimeSurvey will automatically use “AND” or “OR” operators based on some simple rules. While you can use scenarios to circumvent this, it might be easier to use relevance equations.
To use the conditions manager, first open the question you want to enable routing on. (I.e. the question that you want to show/hide). Once you have the question open, you can use the conditions manager button in the questions menu to bring up the user interface.
At the top of the manager, directly below the menu, you can see the current conditions for this question. By default, this shows “This question is always shown”. Below that, you can set the options for a new condition. The question field shows a list of all previous questions, and if relevant, sub questions. A second tab for token fields is also available, allowing you to set conditions based on (custom) tokens. In between you can find the comparison operator, giving you a choice of mathematical operators to use when comparing question and answer. The answer is set in the bottom field, and can be a pre-defined answer (an answer option for that question), the answer to another question, a token, or a constant.
By setting these fields, you can create a condition formula, for example “if sex equals ‘female’”. If this formula equates to true, LimeSurvey will show the question. Other examples might be “if age is greater than or equal to 18”, and countless more.
When you select a question in the top section, the answer field in the bottom is populated with predefined options based on that question (the defined answer options, e.g. male/female, 1-10 on a 10 point scale, etc.). The constant tab in the answer section allows you to compare the question to a constant value, e.g. to check if a respondent is 18 or older. The question tab allows you to compare the answers to two questions, and finally the token fields tab allows you to compare a question to the participants token (note that tokens are only available when you enable them, see the access control section for more information)
In cases where you have multiple conditions, things can get a bit tricky. LimeSurvey will assign “AND” or “OR” operators without giving you the option to change them. Conditions that check against the same question will always be assigned the “OR” operator, while conditions that check against different questions will always be assigned the “AND” operator. This can cause problems when you want question X to trigger when either question Y or question Z are answered in a certain way. By default, LimeSurvey would assign the “AND” operator to these multiple conditions, meaning the question would not always trigger.
The workaround is to use scenarios. Scenarios should be seen as manual groupings of conditions, which LimeSurvey interprets with the “OR” operator. To create a new scenario, click the edit button to the right of an existing condition, or create a new condition, and in the top click the ‘+’ icon next to scenarios. You can now fill in a scenario number (note; this HAS to be an integer value, a whole number, or LimeSurvey will give you an error). The default scenario has the number 1, fill in any other number to assign the condition to a new scenario. Your end result should look like the image below.
This question would show when the respondent is either a woman, or is familiar with the brand Fiat. (Which makes no sense in any scenario, but this is a demonstration after all.)
•Once you are done with your conditions, always test them. Questions should appear/disappear when you change your answers.
•If your conditions are very complicated, you might consider using relevance equations instead. While a bit more technical, it allows for a lot more flexibility.