It is possible to set conditions on when Text/HTML items, Questions and Collections will appear, as well as, when/if specific responses are available to a participant. Each of the editors for these items include a Show-if tab that enables a user to define when the item should be displayed. The show-if tab allows users to specify that an item should be always shown, conditionally shown, or never shown (disabled).
Show State
An item set to ‘Always shown’ will be presented to all participants, and will appear in the Survey Editor with a green circle next to its name. By default, all questions, collections, Text/HTML items and page breaks are always shown.
An item set to ‘Never shown’ will not be shown to any participants, and will appear in the Survey Editor with a red circle next to its name. It will still be in the data dictionary, and any data collected in that field prior to it being set to never shown will be available for download in the Data Manager.
Adding Show-if Conditions to Items
An item set to ‘Only show if’ will be displayed only if the conditions that have been defined are met and will appear in the Survey Editor with a yellow circle next to its name. Follow these steps to set show-if conditions:
- Check the ‘Only show if’ option at the top of the Show-if tab.
- In the Collection list, click once on the name of the collection that contains the question to be tested. The questions in the collection will appear in the item list to the right.
- Click once on the question to be tested. The name of the question appears in bold blue type beneath the Collection list. Underneath the question name will be a pop-up list with the words “was-not-answered”.
- Select the test type from the pop-up list. Notice that if any test type other than “was-answered” or “was-not-answered” is chosen, a list of responses to the selected question appears to the right. (This is true only if the question being tested has multiple response options.)
- Select the value to test from the list on the right. If testing a text or Yes/No question, the value being tested must be typed in. If testing whether the response “is-any-of” or “is-none-of,” multiple options can be checked in the list on the right.
- Click Add to apply this condition.
- (Optional) Add more conditions by repeating steps 2-6.
- (Optional) If more than one condition has been defined, then how to group the conditions must be decided. If ‘And’ is selected from the list labeled ‘Group all expressions with’, then the current question will be shown only when ALL of the conditions defined have been met. If ‘Or’ is selected, the question will appear when ANY of the conditions have been met. Custom groupings for conditions may also be defined.
- Click OK to save the conditions.
Editing Existing Show-if Conditions
To edit existing Show-if conditions:
- In the Survey Editor, double click on the item to be edited.
- Click on the Show-if tab.
- In the list of conditions at the bottom of the Show-if tab, click on the condition to be edited.
- Follow steps 2-5 under Adding Show-if Conditions above.
- Click Replace (not Add) to replace the condition.
- Click OK to save changes.
Removing Individual Show-if Conditions from an Item
To remove individual show-if conditions:
- In the Survey Editor, double click on the item to be edited.
- Click on the Show-if tab.
- In the list of conditions at the bottom of the Show-if tab, click on the condition to be removed.
- Click the Remove button.
- Click OK to save changes.
Removing All Show-if Conditions from an Item
To quickly remove all of an item’s Show-if conditions:
- In the Survey Editor, double click on the item to be edited.
- Click on the Show-if tab.
- Check the Always shown option.
- Click OK to save changes.
Setting Show-if Conditions for Prompts within a Question Table
To set show-if conditions on the individual prompts within a question table, follow these steps:
- In the left pane of the survey designer, click on the Question Table to be worked with. Note in the image below that the MATRIX question table is selected in the left pane, and the prompts belonging to the MATRIX question table appear in the right pane.
- In the right pane, double click on the prompt.
- Click the Show-If tab in the Prompt Editor.
- Follow the instructions under ‘Adding Show-if Conditions’ above.
- Click OK.
If creating a question table with many prompts that will share the same show-if conditions, save time by creating one prompt with the show-if condition, then copying it repeatedly and changing the prompt text. To copy a prompt, right click on the prompt and choose Copy, then right click again in the right pane of the Survey Editor and choose paste. Change the name and the prompt for the new item when it is pasted. The new item will have the same show-if conditions as the original.
Adding Show-if Conditions to Responses
It is possible to assign show-if conditions to individual responses, or multiple responses, in Select One and Check All type questions.
To set show-if conditions on responses:
- Open the question with the responses to set show-if conditions on by double clicking on the question in the right pane of the Survey Editor.
- Select the Response Options tab.
- Click on the response to assign the Show-if conditions. To Assign the same logic to multiple responses at the same time, hold the Control Key and select all of the Responses to set.
- Click the Show If Button.
- Select the radio button for Only Show-if.
- Set the Show-If conditions with the same steps as setting them for a Survey Item. See above ‘Adding Show-if Conditions to Items’.
- The responses will show the Show-If Icon in the list.
- When the question is saved the question type icon will appear yellow showing conditions set to responses and not the question itself.
Custom Grouping of Show-if Conditions
Custom grouping enables the mixing of AND and OR in show-if conditions.
To use custom grouping:
- Define all of the conditions that will be tested, as described above.
- Choose the Custom group expression option under Expression Grouping.
- Use labels, parentheses and the words “and” and “or” to group expressions, as described below.
When the conditions to test are defined, the Question Editor will assign a label to each condition. In the image below, “GENDER = [Male]” is labeled as A. “AGE_RANGE = [36-45]” is labeled as B and “MARITAL = [Single]” is labeled as C.
If the question should appear to all participants who are Male, or 36-45 and Single, type the following under Custom group expression: A or (B and C). This means, display the question if condition A is true (participant is male) or if both B and C are true (36-45 and Single).
In this example, Illume Next will first check to see if both conditions B and C are true. If both are true, Illume Next will go on to see if condition A is also true. If either one of B or C is false, and A is true, Illume Next will display the question.
The following grouping would give a completely different result: (A and B) or C. In this grouping, Illume Next will display the question if both A and B are true (participant is male and 36-45) OR if C is true (participant is single).
Further Notes About Custom Grouping
If an expression uses nested parentheses, the more deeply nested parentheses are evaluated first. For example, in the following expression: A and (B or (C and D)), Illume Next first checks to see if conditions C and D are both true. Illume Next then checks to see if B is true (if necessary– this expression requires only that one item inside the blue parentheses be true). Finally, Illume Next checks to see if A is true.
Each parenthesized expression is always reduced to a single true or false value. In the following example, let’s assume that underlined conditions are false and non-underlined conditions are true. (A and (B and (C or D or (E and F)))) Here is how Illume Next interprets the expression: Starting within the deepest parentheses, Illume Next sees that condition F is false. Because E and F are not BOTH true, the entire expression within the deepest parentheses is then false. So now we have this: (A and (B and (C or D or false))).
Illume Next then looks at the items in the set of parentheses. Because these are grouped with OR, if any one of the conditions is true, the whole parenthesized expression is true. Illume sees that false is not true. It sees that condition D is not true. It sees that condition C is true. Now the entire group within the red parentheses is true. (A and (B and (true))) Illume Next then sees that both B and the condition that follows B are true, so the entire expression in the highest parentheses becomes true. (A and (true)) Now Illume Next sees that both A and the condition that follows A are true, so the entire expression is true. Illume Next has reached the outermost condition, and it is true, so Illume Next will display this item.