Loop.finished not working online (again)

URL of experiment: https://gitlab.pavlovia.org/kylemorgan/pavl

Description of the problem: I am developing an online experiment where participants need to achieve 60% accuracy in order to break out of a Train + Test loop and end the experiment. In a code component located in the Test phase of my experiment I check to make sure they are on the last trial of the Test block, I check their accuracy, and if they are on the last trial (40) and are above 60% accuracy the loop (named outerLoop) should end. Here is the relevant code component:

if accuracy >= 0.6 & num_trials >= 40:
outerLoop.finished = true

This works flawlessly offline (Python), but online it just sends them back through my Test/Train loop even when they achieve 100% accuracy.

I have read through the 3-4 other threads of people having my exact issue and have tried changing “outerLoop.finished = true” to “trials.finished = true” but I get a “Can’t find variables: trials” error when I do so. This leads me to believe I am either not understanding the trials.finished command or my experiment is so different from theirs that the fix is perhaps not applicable. Is anyone available to help me out? Thanks!

Hello @kmorgan,

You are using an older version of the library, 3.2, and, consequently, the latest approach you mention does not work for you.
Is it possible for you to upgrade to 2020.2?


Hi - I just updated PsychoPy to the latest version on my Mac and pushed an update. However, I still see on my Experiment Dashboard that my library is version 3.2. Are there more steps to update my library on Pavlovia? There doesn’t seem to be a drill-down menu to select a different version on my Dashboard.

As a temporary (hacky) workaround, I just have the experiment quitting when the criterion is reached using psychoJS.quit().

As far as I can ascertain from the logs and from GitLab, you are still using version 3.2 and never switched to 2020.2. Could it be that you updated PsychoPy but did not regenerate the code?
Certainly I am glad your workaround is functioning. I would still encourage you to switch.
Best wishes,