OS Win10:
PsychoPy version 2020.2.10:
Standard Standalone? y :
What are you trying to achieve?:
I have some code that checks the participant and session numbers in expInfo and determines whether data have already been collected for that subject. If data have already been collected, it will create a dialog box that asks if the experimenter wants to proceed, quit, etc.
This works beautifully if I manually put in this chunk of code after the section “#Store info about the experiment session,” i.e. where expInfo is defined. However, since I want to keep everything in Builder, it is a nuisance to manually put the code there every time I want to make a new script/update some other part of the experiment.
What did you try to make it work?:
I’ve tried putting the code into a code component “Before Experiment,” but this places the code before expInfo is defined. If I put in the “Begin Experiment” tab, the window gets created before my code executes, and my dialog box never appears.
I’ve also tried putting the code that I need my code to go after (i.e. “Store info about the experiment session”) before my code in the “Before Experiment” tab, and then unchecking the “show info dialog box” in Builder. This almost works, but the script automatically makes another “Store info about the experiment session” section, which resets expInfo to empty, which causes a host of issues.
Any idea if this is possible? It would make my life a lot easier since I am implementing these logical checks in every task that I use.
Thanks.