Not redirecting to SONA

URL of experiment: online_version_part_1 [PsychoPy]

Description of the problem : Credits not assigned automatically and no redirection to SONA.

What we did since :

We have followed instructions for integrating SONA with Psychopy.

We have checked all previous topics that are related to this project.

It still does not work.

We have been writing to our SONA people but they refer us to documentation we have already been through.

COMPLETION URL : https://mcgill-participantpool.sona-systems.com/webstudy_credit.aspx?experiment_id=848&credit_token=2714819b343a4adaa91ef997819d7f14&survey_code=XXXX

COMPLETED URL (set up on pavlovia) : $"https://mcgill-participantpool.sona-systems.com/webstudy_credit.aspx?experiment_id=848&credit_token=2714819b343a4adaa91ef997819d7f14&survey_code="+expInfo['participant']

We are so grateful for any tips as everyone at the lab is going crazy over this problem!

Thanks
Nicolas Goulet

Please could you show the URL to Pavlovia you have in SONA?

Here are both URLs (my mistake of not adding them in the first post!).

They are supposed to do part 1, then SONA make part 2 available online for them 24hours later.

https://run.pavlovia.org/NicolasGoulet/gabors_1?participant=%SURVEY_CODE%
https://run.pavlovia.org/NicolasGoulet/gabors_2?participant=%SURVEY_CODE%

We did not think we were using a second variable so we left it with ? instead of &

Thank you so much for your time!

In Sona you can try a test participant. What is in the URL location when you start Pavlovia?

Please show a screenshot of your Experiment Settings / Online (expanded or with two shots so the full URL is visible)

Why does your consent form ask for the Sona ID when you should already have it from Sona?

  • There are two way to tests it, I provide both links here :
  1. By clicking View Study Website
    https://run.pavlovia.org/NicolasGoulet/gabors_1/?participant=143776
  2. By clicking Sample Link with Embedded ID Code :
    https://run.pavlovia.org/NicolasGoulet/gabors_1/?participant=143776
  • Regarding why we ask for SONA ID, since it is still not automatically credited, we have been manually (for many years now) parsing the results once a week to manually credit the student for their participation. The only way to make sure a student had indeed

Here is the screenshot :

Thank you!

Edit : Sorry I forgot to save my edit with the URLs between ``

I am confused. If you aren’t going to credit automatically, why do you need the SURVEY_CODE at all. Either it is the SONA_ID in which case you don’t need to ask for it, or it isn’t in which case you don’t need it.

Why are you redirecting back to Sona at all?

We are trying to redirect to SONA because we want to automatize this process. Crediting automatically is what my post is about, sorry for the poor explanation.

We were trying to automatize this process for a very long time but just gave up.

Now that giving up is not an option anymore (not feasible to assign credit manually to all participant within a 24 hours window for them to complete the second part) we spent our last week working this issue out to no success.

Thank you for your reply!

Have you set Sona to credit automatically? It looks like everything is in place. What message do you get from soma when you are redirected?

If the redirection isn’t happening, do you have any End Experiment code that might be breaking it?

  • Yep, to my knowledge and after re-verifying, everything is in order. We also got confirmation from the tech team of our ‘‘SONA provider’’ that our study is setup correctly to work before I wrote this post.

  • We do not get a message from SONA as we are not redirected. I have made a mistake by not checking the console. Sorry for the mistake reruning experiment to see if there is an error message now

  • I’ve just realized there is a code block at the end :

import webbrowser
webbrowser.open("https://mcgill-participantpool.sona-systems.com/webstudy_credit.aspx?experiment_id=848&credit_token=2714819b343a4adaa91ef997819d7f14&survey_code=" + expInfo['participant'])

I am not the author of it, I will remove and push the changes see if it changes something, thanks for the pointer!

  • I removed the code block but it did not change the result. There doesn’t seem to be any end of experiment code that might cause this issue.

  • I checked the console and there are no error messages

INFO 16:04:51.523 PsychoJS.quit psychojs-2024.2.1.js:1246 | [PsychoJS] Quit.
log4javascript.js:148 INFO 16:04:51.526 ExperimentHandler.save psychojs-2024.2.1.js:992 | [PsychoJS] Save experiment results.
log4javascript.js:148 INFO 16:04:53.622 Logger.flush psychojs-2024.2.1.js:1201 | [PsychoJS] Flush server logs.
Window.js:125 windowAlreadyInFullScreen: false

Are you ending on escape?

No we end the experiment with enter, the return value in our keyboard component! Assuming the question is refering to the last input we ask of subjects before the experiment ends.

Shoud we switch it to escape?

I am concerned that you are exiting the experiment with a .quit call rather than exiting cleanly.

If you abort an experiment you will be redirected to the incomplete URL.

1 Like

Thank you for your input!

I am busy with other projects today but I let the members of the team that are available to try the two following things (after having reviewed your blog tip and the original post that inspired it) :

  • Change for a key press that we have not used yet (instead of ‘return’, I proposed to press ‘e’).
  • If that does not work, change the last routine to end after 10 seconds.
  • I want to point out we did not have issues registering subjects (like it was the case for the post that inspired your daily blog tip)

Is there somewhere in the code where I can check for this .quit call? I googled for related discourse posts on this but I wasn’t sure what to make of it.

I know directly modifying code is not a good practice when using Psychopy but I can program.

Which key press doesn’t matter. Do you have any code in your final routine or any code in End Experiment tabs?

Nop!

When you asked yesterday I made sure to verify there was nothing in any of the code blocks that were doing something at the end of the experiment.

There also no code blocks in the last routine or end routine.

Are you sure you are using the latest code?

What version of PsychoPy are you using?

EDIT : Yes I made sure by refreshing / restarting browser / changing to inactive back to running between each attempts. The version we are using is 2024.2.1 because we had a super weird bug when we decided to take our previously running experiment and split it into two. By changing to 2024.2.1 it seemed to fix the issue but we really couldn’t make sense of why because the same experiment was running correctly in 2024.2.3

I have just been informed by my colleagues that my latest push (the one changing the key press of ‘return’ to ‘e’) has made the experiment succesfuly redirect to SONA.

In one of your posts you mentionned that the last keypress had to be different than one we asked before, maybe that explained it?

I am a bit confused with this, I will try to replicate this behaviour in part 2 and our control part 1 and control part 2.

Thank you for your time.

I was only referring to Escape Vs normal keys. If changing from on normal key to another solved the issue then I still suspect that there is some code causing the experiment to abort.