OS: macOS PsychoPy version: 3.2.3 Standard Standalone?: y What are you trying to achieve?: stop a routine from being run
I tried to stop a routine from being run by putting continueRoutine = False in the Begin Routine tab of a code component (and placing this component at the top of the routine). However, this setting is overwritten once the code is generated and thus has no effect:
# ------Prepare to start Routine "trial"-------
# update component parameters for each repeat
continueRoutine = False
# (...)
continueRoutine = True
Thatâs an ancient old issue: canât understand how it has raised its head again if you are using version 3.2.3. Are you able to post your .psyexp file here?
Oh wow, this is bizarre. Can replicate that in 3.2.3 with other files too. Not sure how this hasnât been causing problems for other people too.
Will need to call on @jon and @dvbridges for this one, as it is due to how Builder generates the .py file, which is not a part of the code base I am very comfortable with.
Jon: looks like there has been some sort of regression to this issue, which you addressed back in 2016:
As noted, not sure how this isnât causing all sorts of grief to people, as setting continueRoutine = False is such a common technique. Have there been any recent changes that could have impacted this?
Looking further into this, by setting âUse Psychopy versionâ in the experiment settings, the behaviour was correct up until version 3.1.5, and then from 3.2.0 onwards, the old behaviour re-emerged, of resetting continueRoutine to True immediately before the routine begins.
So Jan, as a short-term workaround you could tell Builder to use version 3.1.5 in the âExperiment settingsâ of your file (assuming that doesnât cause issues with some other things that have changed recently, including the improved timing that came with version 3.2.0).
The first time you do this, there may be a slight delay, as PsychoPy will be downloading some of its 3.1.5 code in the background as required.
For us, the offending line in the repository is here:
Hi @frankbolton, if you are using a code component to end the routine on a particular condtion, then you need to move the continueRoutine = False command to the âEach Frameâ tab.