SoSci Survey
Translations of this page:
 

caseToken()

string caseToken()

Each questionnaire has an internal ID (token), which enables it to be identified during the course of the survey. The ID also appears after “Next” has been clicked on for the first time in the browser's address bar (e.g. https://www.soscisurvey.de/demo/?t=12345abcde).

Using this ID, it is possible to leave the current questionnaire to do something else (e.g. surf another website, and then subsequently comes back and resume the questionnaire. The prerequisite is that the external website saves the internal ID, and submits t as the GET variable in the URL back to the questionnaire (URL to the questionnaire).

Note: The external website has to actively accept the token, save it, and add to it to the URL back to the questionnaire. As a rule, this is only possible if the external website uses a server-side scripting language (e.g. PHP or AS). Saving and returning the ID has to then be separately implemented on the external website.

Note: The questionnaire ID is not visible in the data record. If you collect data on the external website and assign this to the questionnaire, you also have to transfer the case number (caseNumber()).

Tip: The questionnaire ID is also available in the predefined placeholder %caseToken% (see example).

Example

In the following example, the questionnaire ID (token) and case number are submitted to an external website www.s2survey.net, which the participant will be sent to by using redirect().

redirect('https://www.s2survey.net/?tk='.caseToken().'&num='.caseNumber(), true);

Instead of using functions, the corresponding placeholder could also just be used in the command redirect().

redirect('https://www.s2survey.net/?tk=%caseToken%&num=%caseNumber%', true);
en/create/functions/casetoken.txt · Last modified: 24.01.2015 12:19 by alexander.ritter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki