Gorilla to pavlovia and back: error

URL of experiment: https://run.pavlovia.org/cmfo/exp-4-srt-1-session-1/html

Description of the problem: I have programmed an experiment in Gorilla and I have a couple of nodes redirecting to Pavlovia as I am using some tasks I programmed in Pavlovia. The problem is that I am using a link with a completion token so that participants can then return to Gorilla and continue the experiment, however it does not work. The task is working well in pavlovia, but when gorilla sends the participant to pavlovia with the completion token it always shows this error:

Unfortunately we encountered the following error:

* **Unspecified JavaScript error**

Try to run the experiment again. If the error persists, contact the experiment designer.

Is there any good guidelines for how to go about it?

I assume that Gorilla is directing to a link of the form https://run.pavlovia.org/cmfo/exp-4-srt-1-session-1/html/?id=xxxx

Please could you give an example of what xxxx looks like?

Alternatively, is the issue that Gorilla is still working in full screen and Pavlovia isn’t able to create a full screen window within the Gorilla window?

I think this is the information appended: www.your-url-above.com? completion_token = COMPLETION_TOKEN

I was wondering what a completion token might look like.

However, https://run.pavlovia.org/cmfo/exp-4-srt-1-session-1/html/? completion_token = COMPLETION_TOKEN won’t work because it contains spaces and your experiment is looking for a variable called id. Try https://run.pavlovia.org/cmfo/exp-4-srt-1-session-1/html/?id=COMPLETION_TOKEN

I obtained this response from the support at Gorilla:

So, the starting redirect url is
As you have a variable for the Append Public ID set, the first thing gorilla will do is append the public ID to this
where PUBLIC_ID is generally an alphanumeric string (it will vary a little depending on the recruitment policy you are using)
Next, it will then add in the completion code
https://run.pavlovia.org/cmfo/exp-4-srt-1-session-1/html?id=PUBLIC_ID& completion_token = COMPLETION_TOKEN
where COMPLETION_TOKEN is another alphanumeric string (this will always be an alphanumeric string, just letters and numbers)
both the variables ‘id’ and ‘completion_token’ be customised to be any variable names you require. So, if Pavlovia is already looking for particular variables in the query string, you can change them to match those.

Ideally, Pavlovia needs to accept and store both of these variables. The value of id is then used to set the identifier for the participant (so you can match them up to your participants list in Gorilla) The value of the completion_token is then appended to the end of the return url so the return URL becomes
https://research.sc/participant/login/resume/ COMPLETION_TOKEN

@jon Does this mean I should have a variable in the code to store the completion token?

If you send id and completion_token then you need to set id and completion_token in your expInfo dialogue box. Personally I would recommend using participant and session since they are the defaults.

So use https://run.pavlovia.org/cmfo/exp-4-srt-1-session-1/html?participant=PUBLIC_ID&session=COMPLETION_TOKEN

and then return with $"https://research.sc/participant/login/resume/"+expInfo['session']

(assuming that nothing else is needed)


Thanks so much! It worked!

Thanks so much for helping @cat500 getting this setup! I’ll make sure this gets written up on our side to guide users in the future.