jsPsych Help PageJoseph Orr2023-02-09T18:51:33+00:00
External Study Credit Granting with jsPsych
While these instructions refer to “credit granting”, they work for both credit and paid studies. For paid studies, participation will be marked (instead of credit granted) just like with any other paid study.
Here are the basic steps, which are subject to change (since the product is controlled by jsPsych):
On your Sona Systems site, change the Study URL so it includes ?sona_id=%SURVEY_CODE% in the URL. So if the jsPsych URL is:
then change it to
Having completed Step 1, the Study Information on your Sona Systems site now displays two URLs labeled “Completion URLs”. The URL to use would be similar to:
https://yourschool.sona-systems.com/webstudy_credit.aspx?experiment_id=123&credit_token=4e48f9b638a&survey_code=XXX” and is the client-side URL. Copy the Completion URL (client-side) value from there. Remove the XXX value from the end of it. Save that URL for the next step.
In jsPsych, go to the source code of the task for the experiment you wish to link to Sona. Add lines similar to the following block for both on_finish line and the line beginning with let sona_id. Use the Completion URL (client-side) from the Study Information Page in Sona. Add lines similar to the following on_finish line to your experiment (the URL you saved from the prior step with +sona_id after it as shown in example below) and the line defining sona_id at the top.