Using on-page routing

You can now control whether Snap automatically inserts a page break before a question with routing. This worksheet describes how to do this, when you can't do it, and how to use different routing to get the effect you want.

Background

When you have routing in a Snap WebHost or offline questionnaire, Snap used to insert a page break immediately before every question with routing. This was because it stopped:

  • questions disappearing and appearing in front of respondents, depending on their previous answers
  • text within questions changing in front of respondents, depending on their previous answers.

This behaviour was due to a combination of the way the Snap interviewer displayed questions, and the way the questionnaire was created.

The behaviour does not appear in Web HTML questionnaires, as these are created as a large single file, rather than as separate pages.

If you have recently updated your copy of Snap, on-page routing may be disabled to ensure that previously created surveys publish as before. To turn on-page routing on:

  1. Select Tailor|Advanced to open the Advanced Tailoring dialog.
  2. Select the Internet tab.

    Advanced tailoring dialog: internet tab

  3. Check the box for Use on page routing

Note that this will make your published survey incompatible with early versions of Snap Interviewer which may be installed on PDAs, kiosks or a local copy of Snap WebHost. You can either clear this box and re-publish, or upgrade the version of Snap Interviewer or Snap WebHost.

Summary of steps

In this worksheet, you will create or download a simple questionnaire. You will add routing to display or hide a space for entering further details to an Other response. You will then add conditional routing and dynamic text to your questionnaire and preview the questionnaire to see what effect they have.

Step 1: Creating a simple questionnaire with routing

Create the Snap WebHost questionnaire shown in the graphic. This has one multi-choice question followed by an other question, then two single-response questions and a thank-you note.

(You can download a finished questionnaire from here.)

Veg questionnaire no routing displayed

You are going to create a routing rule so the space for describing the other food is only visible if the respondent selects Other.

  1. Select the Please enter... question by clicking anywhere on it to highlight it.
  2. Click Routing button on the questionnaire window toolbar to open the routing rules dialog.

    Empty q1a routing rules dialog

  3. Click [Add] to add a routing rule

  4. Select Conditionally Ask Question as the Type and click [OK].
  5. Type q1=4 into the If field. This tells Snap to ask the question only if the Other box (code 4) has been selected.

    Routing rule q1a if q1 = 10

  6. Click [OK] to add the rule to the questionnaire.
  7. Click Save button on the questionnaire toolbar to save the questionnaire.

Step 2: Preview the routing in your questionnaire

  1. Select File|Publish or click [Ctrl] + [Shift] + [W] to publish your questionnaire.
  2. Select Preview only as the publish Method and click [Publish].
  3. Enable the active content in your browser if it is not already enabled.
  4. All the numbered questions should be displayed, but the Please enter question should not be visible.

    Preiew veg questionnaire showing Q1

  5. Select Other. The Please enter question should appear.

    Veg survey showing other question in preview

  6. Close the preview window and return to Snap.

Step 3. Add routing to make the questions appear in response to answers

If someone does not select Meat, you do not want them to see the question about which meat they like. If someone does select Meat, you don't want to ask them if they're a vegetarian.

You might think that it would be a good idea to put routing after each of the selections, so that if they select Grains and vegetables, they jump straight to Q3, and if they answer Q2, they go straight to the end of the survey.

However, this has two problems:

  • Someone who selects Grains and vegetables and Meat will skip the meat question and go straight to the vegetarian question
  • This puts two sets of routing on Q1. The responses are used to jump to a different question and to decide whether to display the Please enter question (Q1.a)

This causes Snap to insert a page break between the Other response and the Please enter question.

It is better to ask questions Q2 and Q3 conditionally, according to how people reply to Q1. This simplifies the routing, and ensures that it can all stay on the same page.

  1. Select Q2, and click Routing button on the questionnaire window toolbar to open the routing rules dialog.
  2. Click [Add] to add a routing rule
  3. Select Conditionally Ask Question as the Type and click [OK].
  4. Type q1=(3,4) into the If field. This tells Snap to ask the question only if the Meat (code 3) or the Other box (code 4) has been selected.
  5. Click [OK].
  6. Select Q3, and click Routing button on the questionnaire window toolbar to open the routing rules dialog.
  7. Click [Add] to add a routing rule
  8. Select Conditionally Ask Question as the Type and click [OK].
  9. Type q1=(1,2) and not q1=(3) into the If field. This tells Snap to ask the question only if the Grains and vegetables or the Dairy options have been selected and the Meat (code 3) has not been selected. This ignores the Other responses, as you can't be sure what they will be.

    Routing q1=(1,2) and not (q1 = 3) for veg

  10. Click [OK].
  11. Click Save button to save the questionnaire.

Step 4: Preview the new routing in your questionnaire

  1. Select File|Publish or click [Ctrl] + [Shift] + [W] to publish your questionnaire.
  2. Select Preview only as the publish Method and click [Publish].
  3. Enable the active content in your browser if it is not already enabled.
  4. Only Q1 should be displayed. The other questions appear according to what selections you make in Q1.

    veg survey short Q1 vis in preview

You can see how Q2 takes the place of Q3 as you change the answers to Q1. This is one of the reasons why it can be advisable to insert page breaks when using routing.

The question numbers have been left in to help show what is happening. Removing them for a real survey with routing is described in the worksheet: Hiding question numbers in web surveys.

Step 3: Add dynamic text to your questionnaire

You can make the text in Q3 more precise by including dynamic text substitution.

  1. Ensure that Font is selected in the toolbar topics list so the [Insert] button is visible on the questionnaire toolbar.
  2. Delete the text do not eat meat. in Q3 and type eat followed by a space.
  3. Click [Insert] and select Variable Field from the list that appears.

    Veg survey showing Insert dropdown list

  4. The New variable field dialog appears.

    New variable dialog with no variable selected

  5. Select Q1 in the Variable list.
  6. Set Aspect to Reply (this means that the response will be used).
  7. Set Modify case to lower case (as you use the words inside a sentence) and click [OK]. The variable will appear within the question.

    Veg survey showing {Q1} dynamic text in Q2 question

  8. Click Save button to save the questionnaire.
  9. Select File|Publish or click [Ctrl] + [Shift] + [W] to publish your questionnaire.
  10. Select Preview only as the publish Method and click [Publish].
  11. Enable the active content in your browser if it is not already enabled.
  12. Check the options for Grains and vegetables and Dairy.
  13. Although the front page still appears the same, when you first look at the survey, checking Grains and vegetables will no longer result in Q3 being displayed on the same page.
  14. Click [Next] to move to the next page of the survey.
  15. Q3 is displayed and the reply to Q1 has been substituted into the question text.

    Second page of veg showing text substitution in Q2

Conclusion

Snap has inserted a page break before Q3 because Q2 uses dynamic text as well as routing. Snap does not know how to display the text of Q2 until Q1 has been answered. To ensure that this works Q2 is placed on a new page.

A page break will also be inserted if:

  • the question uses masking as well as routing
  • the question is routed to in more than one way.
  • the question uses both conditional and goto routing

You may have to rewrite your questions so they do not use dynamic text if it is very important for them to appear on the same page of your survey as an earlier question.

You can have Goto questions round the whole questionnaire, or Goto questions that jump over questions with routing. Page breaks are only required if the same question contains two sets of routing.

For further information about routing, see the Snap routing rules tutorial in the manual and online help.

You may also find it useful to read the section on Examples of If conditions in routing for multi-choice questions.

For further information about dynamic text, see the section on Inserting dynamic text in the manual and online help.