Version Notice: This article covers features in our r9/IS Pro platform. If you're looking for information on this topic related to r8, see Skip logic tutorial.
Overview
Another place logic is commonly used is in survey branching and skips. We have a variety of programming tags to help create any necessary flow and survey pathing.
Related reading and resources
The following articles can be used for reference with this training module:
- showif and skipif
- Groups
- autocode
- Auto Coding Conventions
- goto (use only as a last resort, when the above methods are unavailable or greatly prohibitive)
Applying skip logic
Open the 'Tutorial - skip logic.docx' document (linked at bottom) and review the skip-related questionnaire instructions highlighted in green. We will add the code covered below to your FLast_r9_intro survey's existing content.
Questionnaire Content | Discussion Details | Coded SPL |
[Skip A2 if option 2 (no) is selected at A1] |
In this first skip instruction, Tip! The implementation of logic doesn't always align perfectly with the instructions provided. Design the logic to provide the functionality requested, bearing in mind that the questionnaire instructions may not always be optimal. Flexibility and adaptability in the logic design are key to ensuring the survey functions as intended despite any discrepancies or ambiguities in the instructions. If you ever doubt your interpretation of the instructions, clarify with the client. Checked functions are used to evaluate closed end data:
|
Place this code on A2: showif: anyChecked($QA1,1) |
[Skip A2A if options 3 (green), 6 (red), 8 (yellow) are NOT selected at A2] |
For A2A, the instruction requests to skip the question if specific options are not selected in A2. The |
Place this code on A2A: showif: anyChecked($QA2,3,6,8) |
[Skip A2D if only 1 option selected at A2] |
For the skip at A2D, The
|
Place this code on A2D: showif: countChecked($QA2)>1 |
[Skip A2F if option 99 (none) is selected at A2D AND option 99 (none) is selected at A2E] |
Sometimes when creating skip logic, it's important to clarify whether a respondent selected (or did not select) a specific option at a question, regardless of whether they saw the question or not, or if it is only applicable when the respondent saw a question, and deliberately chose to select or not to select an option at a question. For example, the skip instruction for A2F could be interpreted as the client wanting the respondents to skip A2F if they did not select any colors at A2D and A2E. However, it is important to note that A2D might have been skipped. After clarifying the intention with the client, let's assume we specifically need to skip the question if A2D and A2E were both seen and "None" was selected at each question. To accomplish this, we can use the Tip! The |
Place this code on A2F: skipif: anyChecked($QA2D,99) and anyChecked($QA2E,99) |
[Ask follow up questions A3C-A3G if 1 or more entered at A3B] |
When a set of consecutive questions has the same condition(s) for showing or hiding them, it is best to place the content in a group. To build a group, add the After the last question, include the |
Place this start group: A3CtoG condition: $QA3B>0 #QA3C-QA3G here end group: A3CtoG |
[Skip B1D if None for all shapes at B1B] |
List functions were developed to help check table logic. List functions iterate over a list in a row or column, check a condition, then return a value. There are several list functions available. Three of them are applicable to the skip instruction at B1D.
|
Place this code on B1D: showif: listCount(SHAPES; anyChecked($QB1BR[id],1..6)) > 0 OR showif: listSum(SHAPES; $QB1BR[id]) OR showif: listWhich(SHAPES; anyChecked($QB1BR[id],1..6)) |
Practice what you've learned
Continue to work in your FLast_r9_intro survey (visit Training tutorials for set up steps) by integrating the new content from above.
Once you finish reviewing each survey question, add the new content to your survey area via the SPL editor. When the survey compiles successfully, run it in Testmode by clicking the Test 2 button from the compilation screen or open the Test Survey applet from the left navigation menu. Practice testing the skip patterns in your survey by making the necessary selections to see a subsequent question. Then, use the back arrow in the Testmode toolbar to go back and change your answer, and intentionally skip the question.
Reminder, once you integrate all the new content from this tutorial and test it, publish your survey before moving on to the next tutorial.
Previous/Next
Term logic tutorial (r9)/Selection logic tutorial (r9)
Comments
0 comments
Please sign in to leave a comment.