Translations of this page:
 

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])

  • QuestionnaireIdentifier
    The identifier of the questionnaire to which the participant should jump.
  • TextIdentifier
    Identifier of a text to be displayed if the participant has already filled in the questionnaire.
  • Restart
    If the second parameter has the value true, no text will be displayed if the subordinate questionnaire has already been filled in, but the questionnaire will jump to the page specified in the third parameter and can be filled in/changed again from there on.
  • If this parameter is set and contains a valid pageidentifier, the subordinate questionnaire does not start on the first page or does not continue a possibly already started interview on the last active page, but jumps directly to the specified 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.

  • If the participant has been assigned a personal identifier (SERIAL), this will also be noted in the questionnaire to which goToQuestionnaire() refers.
  • If no person identifier is known in the current interview, a new string (e.g. CASE000123) is generated. The case number (CASE) of the original data record is noted in both cases as a reference (REF) in the new data record.

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.

  • One can then show or hide individual questions (Filters and Conditional Questions) and/or
  • One can adapt/replace individual terms in the further questionnaire (Placeholders).
  • Or one can present different questionnaires to the persons depending on the answer. With this solution, however, you get two cases per participant:in in the data set. One case for the input questionnaire with selection and a second case for the subordinate questionnaire. One may have to link these cases again in the data analysis.

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();
}
en/create/functions/gotoquestionnaire.txt · Last modified: 05.09.2023 23:34 by swissel.uni-mannheim
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki