| Reference | Downloads | Github

Unable to stop loop on Pavlovia using javascript

URL of experiment:

Description of the problem: I have a simple experiment that determines whether to continue running a loop of trials depending on whether a criterion is met. I attempt to exit the loop inside of a conditional statement using loopname.finished = true. The conditional statement executes properly because I set a text string within it, and can see that the block of code is executed based on the value of that string. However, the loop does not end, despite the code setting .finished = true:

if (need_correction == false) {
    continueRoutine = false;
    reps_loop.finished = true;
    tmp_string = 'should be finished and this code ran!'

I have seen similar threads on this topic as well as what looks like a fix integrated on github, but I am not sure if this fix is active in the current stable release? I am running v3.1.5.

Can anyone advise if there is an error in my code or whether this is a known issue still awaiting a fix?

Thanks! - Evan

1 Like