Hi all,
I'm afraid I need some help as I'm very new to PHP. I will try to describe my issue clearly.
What I need: Halfway through the survey, participants will be redirected to a behavioural task on Pavlovia, parsing their prolific ID as 'participant' and the interview ID as 'token'. I need this token to later continue this interview; if I understood the information on the following link correctly: https://www.soscisurvey.de/help/doku.php/en:create:functions:redirect
What I tried: In my redirect link, the reference is always passed on (this would be 'r' in the link on pavlovia. It's the id token that is problematic and I tried a few different ways. The current version is that I attempt to get 'i' from the sosci URL bar with readget()
by using a PHP function on an otherwise blank page in the 'compose questionnaire' area, see: https://www.soscisurvey.de/help/doku.php/en:create:functions:readget#readget.
What happens with this version is that the url after redirecting to pavlovia says: https://run.pavlovia.org/S4HRI/mlj_a2b/html/?participant=333333&token=%id%. In other words, it passes $id as a literal STRING instead of replacing it with the unique letter-number combination.
If, instead of 'i' I use casenumber or casetoken (https://www.soscisurvey.de/help/doku.php/en:create:functions:casetoken) in the link, it does pass as a number without having to use readget()
, but this number does not work as a continue token when Pavlovia redirects back to the questionnaire at the end of the task (SoSci will show an error to the participant saying that the token is invalid).
Specifically:
- What is the token I need to be able to continue the survey directly after coming back from an external site?
- And if it is indeed the '&i=xxxxx' part of the url, how do I parse it?
TL;DR - The address bar of my survey has a php variable i. I need to grab this i and pass it on to Pavlovia.