psychopy.org | Reference | Downloads | Github

Passing startup parameters


#1

As mentioned at PsychoPy 1.85.0 issues, it would be really good to have the option of passing startup attributes over GET, instead of sometimes having the start up window.

Its something that can be worked around though with a bit of code and tweaking of the generated JS, but would be useful to have out of the box on generation.

For online experiments in Inquisit, we pass parameters in the URL from another source (MTurk, Qualtrics or manually set via an emailed link) - so to ensure that we get the participant numbers set that we expect or require. If we were testing someone completely external, then they may not know what to enter - unless they are told to. They could also enter an incorrect number in error by leaving it under their control.

How i’d see such a feature working, is that you’d create your startup parameters (such as “participant” and “group” for example) in PsychoPy as usual. The PsychoJS script would first check to see if either of those exact case sensitive attributes are set over GET, via a URL like so:

http://myexp.com?participant=1&group=1

If both are set, it would bypass the need to prompt the user to enter any values and would start the experiment right away.

If we had the parameters “participant”, “group” and “age” set as startup items, but we only passed “participant” and “group”, like above - then i’d anticipate that the user would be prompted just for “age” only. This isn’t something that Inquisit does, as it is only limited to two parameters, but would be a very useful feature. Of course, alternative you could just collect it with a standard response stim at the start.


#2

I like it and I think it should be easy enough to implement. I guess it should be done automatically in the js lib (somewhere near 70-75?):
https://github.com/psychopy/psychopy/blob/master/psychojs/js/psychojs/gui.js


#3

That looks like a good place. Something at the start that checks for GET variables first, then have a condition in the dialogue generator to not include that attribute in the startup list.

There would also need to be a check added to only create the dialogue box if there are parameters still to complete.