Here is a picture of my experiment sequence for reference:
Currently my experiment runs as is, which is a great start. The next thing I need to do is to have the ‘Popup_Loop’ run conditionally. I currently have the Loop run based on the condition file (which is working), but this means that it is attempting to run the loop during every run of the ‘Trial_Loop’. I only want the ‘Popup_Loop’ to run when the value of a variable in the condition file is 1, not when the value is 0 (i.e. run Popup_Loop when variable Popup_Presence = 1. Do not run Popup_Loop when variable Popup_Presence=0).
From what I understand, I think I need to add a code component before the Popup_Loop (I’m thinking at the end of the previous ‘Email’ routine, but unsure). I really know nothing about coding in Python and I have no idea how to make this happen so that it will skip the entire loop if the value is 0.
I have attempted to insert the following code, adapted from the BranchingExp demo, but it isn’t working. There is no error that occurs; the experiment still runs fine, but it does nothing to skip the Popup_Loop. The experiment runs as if this code didn’t exist at all.
I am wondering if this is happening because PsychoPy doesn’t recognize my variable ‘Popup_Presence’ as a variable. This variable is defined in my conditions file, which is then referenced in another file to divide the trials into blocks. The only reason I am skeptical of this is because other variables are recognized in this way for images, etc.
All help is appreciated!