-
Notifications
You must be signed in to change notification settings - Fork 40
How to combine formr with surveys from SoSci survey
We're not jealous. If a different survey engine fits your needs better, but you want to use formr to organise e.g. when invitations to your diary will be sent, we want you to be able to integrate the two.
Integrating with https://www.soscisurvey.de is fairly simple:
In your run, you include an "External" module with a link to your survey and the user's code, e.g.
https://www.soscisurvey.de/demo/?q=fb1&r={{login_code}}
That way the variable called "session" in formr will be stored in a variable called "REF" in your SoSciSurvey data. With these, you can link data between formr and SoSciSurvey.
But maybe you would not just like to redirect users to the survey, but you'd like to know whether they finished it. To do this, turn on "end using API". We'll get to what this means in the next step.
In SoSciSurvey make a new page in your survey towards the end. Click PHP code and paste and edit the following snippet:
$value = value('REF');
debug($value);
$sp = sendPOST( "https://formr.org/api/post/end-last-external/",
array( "request" =>
'{ "run" : { "name" : "Konfliktstudie" , "session" : "' . $value . '" } }') );
debug($sp);