Completed URL from Pavlovia to SONA not working

I’m attempting to integrate Pavlovia with SONA and I’ve run into some trouble. I have participants answering questions in Qualtrics and completing an experiment on Pavlovia. The order doesn’t matter and I’m able to pass a participant ID from SONA to Qualtrics to Pavlovia or from SONA to Pavlovia to Qualtrics (so this isn’t an issue).

The problem I’m having is with the completion URL. I was having participants go from SONA to Qualtrics to Pavlovia. This all worked fine, but my completion URL isn’t working at the end of the Pavlovia experiment.

Even if I have the link go directly from SONA to Pavlovia and back to SONA, it’s not working. I need the participant to be redirected to SONA so they can be granted credit. I’ve followed all the instructions for integration, as far as I can tell so I’m not sure what’s going on.

This is my current Completion URL: $“https://ucf.sona-systems.com/webstudy_credit.aspx?experiment_id=1976&credit_token=6f2e3bb143bd42658ed5f6b034f9244c&survey_code=” + expInfo[‘participant’]

Any help is much appreciated!

  • Elisabeth

Are you using simple quotes ” and ‘ or smart quotes as in your post?

I honestly don’t know the difference (or if it matters?). I just used the key on the keyboard if that helps.

I think that despite editing, my previous post has “smart quotes” which curve differently at the beginning and end of words.

For coding you need "simple quotes" 

If you typed your code into PsychoPy with the keyboard, you probably have simple quotes. If you copy pasted from a document (including my crib sheet) then they may be smart and need fixing.

Okay, I believe they’re simple quotes then. I just checked them and re-typed them. After a test, nothing has changed. There is still no redirect happening. I get the standard “Thank you for your patience” message and then nothing happens.

This problem seems to have miraculously solved itself overnight and now everything works fine. I think it was a syncing issue between PsychoPy and Pavlovia because now I’m having some other troubles, but hopefully they will resolve themselves.

Hi - I’m having the same issue. Here is what I have in my experiment settings:

Yet when I run the task, it ends with “Thank you for your patience” and stays at the same Pavlovia URL. I have tried syncing and re-syncing many times, and the github page says the project is recently updated, so I don’t think that’s the issue.

I am still in “pilot mode” with my Pavlovia project - could that be the issue? Are you not able to redirect to a new url in pilot mode?

Thanks for your help!

This is how the sync updated my code (line 6):

I’m new to js, but this doesn’t look quite right?

Hi @sbanker, you shouldn’t have to update any of your JS code manually (if you do, you’ll run into problems when you re-sync your study from PsychoPy). Also, if you want/need the participant number to transfer, make sure to include that in your URL in PsychoPy! There are a couple things you can try:

  1. If you’ve read through this thread, make sure you’re using simple quotes as Wake Carter indicated. If you’re not sure, just remove the quotes and re-type them in PsychoPy in the URL field.

  2. Clear your cache on your web browser. If you’re in Chrome, go to Settings and search for Cache, then clear it. If you’re on a different browser, a simple Google search should give you the answer. Then re-sync your project and test.

  3. Run through your experiment and when you get to the end, click ‘Ok’ on that message that says Thank you… If clicking ‘Ok’ works to redirect you (which it should), you can add a message to that window that tells participants to click the ‘Ok’ button. I can give you more info on this if you need.

Thanks @Eslifkin! I tried all of these - unfortunately, no luck. The task exits full screen when I click “Ok”, but just brings be to a blank grey screen with the same pavlovia url.

Could it be an issue with syncing between the github and pavlovia pages? For some reason my code on the github page accurately says it was updated today, but it doesn’t say that on the page where I run the experiment:

Screen Shot 2020-12-02 at 9.12.32 PM

Yes, it could definitely be that. Sometimes clearing the cache fixes this issue, but other times it persists. If this is the issue, it generally clears up on its own (annoying, I know). The only other thing I have done is delete my project from Github and re-upload a new project from PsychoPy. You could also copy your entire experiment folder to a new location and rename it slightly to create a new project without deleting the old one. This will tell you if that’s the only issue (hopefully).

Thanks for your help! I figured it out - that was indeed the problem. I didn’t realize you needed to switch the project to “inactive” in order for it to update.

1 Like

Hi,

I removed the completed URL from pavlovia, and I am able to access my experiment by going through SONA, but other participants are not. Any idea what this is about?

The Completed URL is supossed to only be for assigning credits, students should still be able to access the experiment through the SONA system, but they all seem to be getting error messages.

Is the error message happening at the end (or related to the completed URL)? If so, please could you show a screenshot of your completed URL.

Hi @darcyen,
Have you tried the things listed above (clearing cache, setting project to inactive, etc.)? If your project is not in “Run” mode on Pavlovia, nobody else will be able to access your study. Make sure that the link to Pavlovia in the Sona system is the direct link to your experiment (you can copy this directly from Pavlovia).

Right, I’ve tried all that and I can run the experiment through the SONA site, but the code for assigning the automatic research credits is not working. When participants are finished the experiment, they are supposed to be redirected back to the SONA site, which is not happening. I had it all running on Monday and then it stopped working Tuesday, so let’s hope that doesn’t happen this time.

The completed URL I put into the experiment settings was

$“https://tcd-psy.sona-systems.com/webstudy_credit.aspx?experiment_id=105&credit_token+399d75a3b546dcbc91bb9c6c20fec5&survey_code=” + expInfo[‘participant’]

and the URL for the PAVLOVIA experiment on SONA as:

image.png

I think that this ?participant=%SURVEY_CODE% is incorrect as it is supposed to go after the URL, which is supposed to have a html at the end.

Thanks for all the help

Kind Regards,

Please could you show a screenshot. It could be a case of smart/dumb quotes, or the fact that you have spaces either side of the + in your example above.

Wakefield,

See attached as requested but you cant read the full URL, that’s why i pasted it in an early message. The experiment crashed again another day or so afterwards so I removed this participant code. Now the experiment wont run online anymore. Why does this keep happening every 24hrs? The experiment stops running for absolutely no reason, without any edits made. So I go back in, re-sync it, it runs again fine for another 24hrs and then stops running. Except this time I cant get it running again. There’s no error message, it just wont load fully, it’s stagnates on 6/10.

Screenshot 2021-02-01 at 21.36.28.png

I just tried it and it stopped on 6 for a little and then continued. It then starts without an error.

I haven’t been to the end to look for the error message.

hi @wakecarter, I am having the same problem the redirect is not working. I would like the participants to get the credits no matter what.
I have the experiment on run:
Url: https://run.pavlovia.org/DavidAisicovich/motorskillsv4/html