Branching

What is branching? Branching enables you to skip certain questions based on the responses of an earlier question. If, for example, some questions apply only to men, the survey could skip these questions if the respondent indicates she is a woman.

Now, how do you indicate that you want to branch in the syntax file? Just put a $branch in the question cell. OSuCre supposes that the branching will be based on the question that precedes the $branch and that this question is of the radio button type (or hidden type; see further). Now, this previous question will have a number of answer options. In the label section of the same line where you put the $branch, you need to tell where the branch should point to, for each answer option of the previous question plus one. For example: if the question on which the branch is based has two answer options (man and woman) you would need to enter three options. How do the options work? A one (1) would mean you just continue to the next page. A two would mean that you skip a page and go two pages further, and so on. This means that you have to make sure that at least two more pages exist. Now why do you need to enter the third option? This tells the survey what to do when no answer was given.

An example:

QUESTION TYPE SIZE DIRECTION CONTROL LABEL 1 LABEL 2 LABEL 3
1. Do you know OSuCre radio 2 v   yes no  
$branch         1 2 2

Here you see that branching is based on question 1. If the respondent checks yes, he will continue to the next page where he can answer the questions about OSuCre. If, on the other hand, the respondent picks no she will skip the next page and go to the third page. If nothing was selected, the survey will also skip the second page page.

Note that if you would want to branch, based on gender, you need to skip an extra page. Consider the following example:

QUESTION TYPE SIZE DIRECTION CONTROL LABEL 1 LABEL 2 LABEL 3
gender radio 2 v   man woman  
$branch         1 2 3

Choosing man will take the respondent to the next page. Choosing woman will skip a page. Now, logically if you have chosen man as gender, after filling in the next page you should not continue to the page with the female questions. This can be accomplished by adding a new branch on the male page.

First add a hidden question to the male page. Set the question and size to one (1). Now add $branch on the next line and set label1 and label2 to two (2). No matter what your respondent does on this page, it will skip the next page (on which only female questions appear). You can check out the example (see start menu) to see how it works. Note that your database will contain a field containing "ones".

Result:

QUESTION TYPE SIZE DIRECTION CONTROL LABEL 1 LABEL 2 LABEL 3
1 hidden            
$branch         2 2  

Note that you can only branch, based on a radio button question. This means that this question should be the last one in the syntax file for a specific page (before the $branch option). However, you could of course move this question on a specific page to another position using your favourite web editor.

An example can be found in the OSuCre folder of your start menu (example.csv).