goToQuestionnaire()

By calling goToQuestionnaire() the participant is redirected directly to another questionnaire in the same survey project. Thereby an additional record is created, which carries the number (CASE) of the original record as reference (REF).

void goToQuestionnaire(string QuestionnaireIdentifier, [string TextIdentifier], [string Page])

void goToQuestionnaire(string QuestionnaireIdentifier, [boolean Restart], [string Page])

Important: Unlike multiLevelDown(), the participant is not redirected back to the original questionnaire after completing the questionnaire (reaching the last page). If this is desired, the command goToParent() must be used in the questionnaire (e.g. on the penultimate page).

The function goToQuestionnaire() allows a participant to fill out an otherwise locked questionnaire (access mode “internal/locked”). This is especially useful if the participant has previously authenticated themselves via serial mail, participation code, or login.

A renewed call of the questionnaire by the same participant is treated as if a link personalized by serial mail or participation code was called again. That means: If nothing to the contrary has been set in the questionnaire settings of the questionnaire (Create questionnaire → tab Settings), then a possibly already existing data record of the participant will be continued. If the interview has already been completed, the text specified with TextIdentifier will be displayed. If no identifier has been specified, no content will be shown – by default, SoSci Survey will then skip to the next page.

Select target group

Sometimes different target groups are to fill in different questionnaires – and not always the persons of the target groups can be addressed separately (URL to the Questionnaire). In this case, one can query the target group on one of the first questionnaire pages in a selection question.

Note: In many cases it is more efficient to work with filters and placeholders.

For jumping to the subordinate questionnaire one can use goToQuestionnaire() or multiLevelDown(). The second command is especially useful when (a) respondents should continue with the main questionnaire again after the subordinate questionnaire or (b) when data should be passed to the subordinate questionnaire.

You can create the different questionnaires under Create QuestionnaireManage Questionnaires.

If the target group was queried on the second page of the questionnaire with the selection question AF01, the following PHP code on page 3 (PHP-Filter) would redirect the respondents to one of the three questionnaires “group1”, “group2” or “group3”.

if (value('AF01') == 1) {
  goToQuestionnaire('group1');
} elseif (value('AF01') == 2) {
  goToQuestionnaire('group2');
} elseif (value('AF01') == 3) {
  goToQuestionnaire('group3');
} else {
  // In case none of the three options has been selected
  repeatPage();
}