Completed URL giving Python syntax error

I’m following this guide: PsychoPy (Pavlovia) Help Page · Sona Systems

But when I try and add the completed URL to my Pavlovia study in builder I am getting notice of an error.

Edit: Per a previous post, I switched to “straight quotes” and it now works. I’m leaving this up in case there is some other issue with the guide I posted.

Hmm, everything is working, except when I test the experiment, clicking in SONA on the “Sample Link with embedded URL” the survey runs fine, saves my data, but then just hangs on a grey screen instead of going back to SONA. Any idea what might be causing that?

Please could you show your Completed URL?

You got it:

$"https://carleton.sona-systems.com/webstudy_credit.aspx?experiment_id=2513&credit_token=69748ad551ee43618190e6fea6af6469&survey_code=" + expInfo['participant']

And here is a screenshot in case it is helpful:

I can’t see an error in that, though I notice that you are still using html as an Output path. Do double-check that all of the single and double quotes are "dumb" not “smart”.

Though I now see that you’ve maybe fixed it

Thanks for taking a look.

Is there something I should use instead of Output Path = html?

Ah if I leave output path blank it works!

1 Like

Hi David, I was just wondering how did you manage to fix this problem in the end? I didn’t get what you mean by “switched to straight quotes”…
The problem I’m facing now is exactly the same as yours, and when I put $" before the URL that I copied from SONA in the “completed URL” box, I will have an error saying that "Python syntax error in field ‘Completed URL’ ".
Please can you give me some suggestions?
Thanks!

Hello Tarro!

I managed to get it to work by clearing “html” from the Output path.

By straight quotes I meant " instead of ”.

Hope it helps!
Dave

Ahhh, I see. Thank you for your reply David! But in my case the output path is already in blank and if I add $” before the URL, then the error will appear.

If I didn’t put $” and test it, I can run the study and save my data, and then there’s a grey black window but cannot redirect back to SONA…

I need to let participants go to Pavlovia first then to Qualtrics. I’ve followed instructions on SONA’s helping system but didn’t work. Don’t have any clue what the problem is.

Please show exactly what URL syntax you are using (preferably with both a screenshot and pasted text).

Hi, here is the syntax I’m using

And here is a screenshot of the error. Hope it is helpful.

Thanks

And by the way, the version of my PsychoPy is v2022.1.3, just in case it can help.
Thank you

It looks like you have smart quotes round participant. Try deleting them and retyping them.

Thanks a lot! Problem solved!