psychopy.org | Reference | Downloads | Github

Fail to pass url parameters

URL of experiment: https://run.pavlovia.org/syahn/letter-based-attention/html
Description of the problem:

Hello,

I’ve built my online experiment through Psychopy v.2020.1.2, and found it running smoothly online through Pavlovia.

A problem arises when I’m trying to pass participants’ ID through URL parameters. I input URL parameters with correct keys of expInfo dictionary in the experiment file, but info dialog still keeps popping up asking participants to insert variables themselves at the start and the saved data also does not come with passed url parameter values.

I checked psychojs source code for dialogbox(https://github.com/psychopy/psychojs/blob/master/js/core/GUI.js), and they seem to get url parameters first and only create text entry if the key is not in the url, but not understand why this does not work from my end. I tried tweaking the code with util.getUrlParameters() but didn’t work well.

Anyone who has the same issue or has solved this kind of issue before? Any kind of tips will be greatly appreciated. Thanks!

Just found the same issue now. We’ve not got credits yet, but testing the pilot URL, i’ve tried to do the following:

https://run.pavlovia.org/fgasking/parametertest/html/?participant=1&group=2

But we still get the pop up screen prompting for input values.

Hello @young1 and @fgasking,

Thank you for bringing the matter to my attention. I made a quick change to handle the legacy Edge browser, which regrettably introduced that particular regression.
This is fixed. With my apologies for the mishap!
Cheers,

Alain

That’s brilliant, thanks for the very quick fix Alain.

Confirmed as working here. Had to refresh the browser a few times, that was all.

Have a good evening!

Frank

Wow thank you for your quick help, Alain.

I noticed that with certain browsing data (e.g., cached image and data) this error still persists somehow, but after deleting all cached data it begins to work like a charm.

Another bug I noticed related to this though is when you output the csv file, url parameters does not go into the corresponding column, but creating new column under that url parameter

e.g., my participant id is ‘5e79737a18ee0e52ff4a27c3’, and expected csv output will be having this id under the ‘participant’ column, but as you can see the attached screenshot, we have n/a for ‘participant’ column. I know we have a new column called ‘5e79737a18ee0e52ff4a27c3’ at the end and we can use this information to check the correct participant ID, but I was wondering if there’s any way to fix this bug easily?

1 Like

I am experiencing the same issue with the url parameters not going into the corresponding column. I am also having trouble saving the participant ID in the csv file name. Does your .csv file name contain the participant ID as or does it say “PARTICIPANT_studyname_etc.csv”?

Yep same issue with csv file name too!

1 Like

For me, refreshing the browser also solved that it does not ask for the participant code anymore.

However, probably related to the above mentioned issues with the csv files, I cannot access the content of the participant field within the experiment anymore. Usually, I dynamically load the session file based on the participant code by entering the following in the Conditions field of the loop:
$'sessions/participant_'+expInfo['participant']+'.csv'

But expInfo[‘participant’] seems not available as is evident from the following error in the JavaScript console:
Object { origin: "TrialHandler.importConditions", context: "when importing condition: sessions/participant_.csv", error: {…} }

@apitiot Are you working on a fix for this already? This is a severe bug as it prevents us from using Pavlovia with external recruitment systems such as Prolific and MTurk at the moment as we use individual session files for participants and thus require the “participant” parameter passed through the URL to be available from within the experiment with expInfo[‘participant’] as described in my post above.

Hello @frank.papenmeier,

I shall attend to it in the afternoon. With any luck, I should have a fix for you before end of business today.

Alain

Thanks for the swift response! I keep my fingers crossed that you can identify and resolve the source of this issue without to much effort.

Hello again @frank.papenmeier, @young1. @hrb,

I believe I have just fixed the issue, which had the same origin. That is to say, a quick change to accommodate legacy Edge browsers resulted in an inversion of key and value.
Would you like to give it a go and let me know if all is well on your end? Don’t forget to clear your cache so the new library replaces the old one.
Best wishes,

Alain

Hi @apitiot,

thanks for the quick fix. Works perfectly for me!

All the best,

Frank.