psychopy.org | Reference | Downloads | Github

Variables passed in completion URL not being detected in second experiment

URL of experiment: FlankerAttA_1 [PsychoPy]

Description of the problem:I am calibrating the stimulus size using wakecarter’s screen scale code.
I want to then pass the x_scale and y_scale values to a second experiment using the completion URL along with the participant code.

Knowing that the completion URL is generated at the begining of the code before any variables generated during the running of the experiment would exist as described here: CompletedURL / IncompleteURL - #18 by lnnrtwttkhn
I am using the recomended command in a code component after the x_scale and y_scale variables have been populated.

psychoJS.setRedirectUrls("https://run.pavlovia.org/Anthony_Risuq/trailmakingcs-5/html?participant=+expInfo['participant']&x_scale=$x_scale&y_scale=$y_scale", "https://www.google.com" );

I get no errors when generating the javascript and I am redirected to the next experiment at the end of the first, however when it comes time for the second experiment to use the x_scale and y_scale variables I get an error message stating that it was unable to convert the variable to numerical value since it was a NaN.

If I paste the completion url directly into a browser without specifying the values of x_scale and y_scale I get the same error message at the same point. However if I directly specify the values in the url when pasting it into a browser, and without using the $ before the value then the experiment runs properly.

I tried removing the $ in the completion url but I get the same error message as originally.

All this leads me to believe that the values are not being properly sent to the second experiment.

What can I do to fix this?

Thank you.

Try

"https://run.pavlovia.org/Anthony_Risuq/trailmakingcs-5/html?participant="+expInfo['participant']+"&x_scale="+x_scale+"&y_scale="+y_scale

Hello,

That did the trick. Thank your very much.