====== 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 [[:en:glossary#pageidentifier|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 ''[[:en:create:functions: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 ''[[:en:create:functions: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 ([[:en:create:access|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 ([[:en:survey:url]]). 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 ([[:en:create:filters]]) and/or * One can adapt/replace individual terms in the further questionnaire ([[:en:create: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 ''[[:en:create:functions: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 Questionnaire** → **Manage 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 ([[:en:create:php-filters|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(); }