int caseNumber()
Each questionnaire in the survey project has a unique number, which also appears as the variable CASE in the data record (Addition Variables in the Data Set). This number can be called up with the function caseNumber()
.
The participant should maybe note down the number of their questionnaire so they can request an individual analysis later on.
html('<p>This is the questionnaire no. '.caseNumber().'</p>');
However, the predefined placeholder %caseNumber%
could also be used to give the same result:
html('<p>This is the questionnaire no. %caseNumber%</p>');
Or, the survey is composed of several questionnaires, because the second questionnaire (stimulus analysis) can be filled out multiple times, while the first questionnaire (master data) is only filled out once.
The various different data records belonging to a participant can be assigned with the case number. The following PHP code in the first questionnaire leads the participant to another questionnaire, and submits the case number as a reference (URL to the Questionnaire).
$num = caseNumber(); $url = 'https://www.soscisurvey.de/followup/?r='.$num; redirect($url);
The same thing but a little more compact:
redirect('https://www.soscisurvey.de/followup/?r='.caseNumber());
The function redirect()
supports placeholders as well as html()
and text elements:
redirect('https://www.soscisurvey.de/followup/?r=%caseNumber%');
At the second of the second questionnaire the participant would then be asked if they would like to evaluate another stimulus. Here, the reference (i.e. the case number from the first questionnaire) would have to be submitted, instead of the case number:
redirect('https://www.soscisurvey.de/followup/?r=%reference%');