URL of experiment:
Description of the problem:
I am using v2020.1.2 on OSX
The outerLoop of a nested 2 loop experiment is not responding to the outerLoop.finish command when run online, however the innerLoop operates correctly. The code runs correctly using builder.
I created a cutdown experiment to demonstrate the issue.
The intention is that a ‘return’ , ‘c’ , ‘f’ on the keyboard component will force end the doRoutine.
if its a ‘return’ it simply steps to the next row of the inner loop (and proceeds to outer loop if inner loop completed)
if its a ‘c’ it will terminate the inner loop.
if its an ‘f’ it will also terminate the outer loop hence finish the program.
What happens when run online is that the ‘f’ key just terminates the inner loop and ignores the outerLoop.finish
In order to get round the problem I have used several versions of the code back to v3.1.5 but non worked correctly and I tied myself up in knots.
I have read that use can be made of trials.finish regardless of the actual loop name to finish a loop ie: "all loops are called “trials”. and “for nested loops the inner loop is referenced. It may not be possible to reference the outer loop ( refer to discourse 11190)”.
My question is : am I correct that nested looping indeed dosn’t directly convert from Python to JS and if so would it be easier to implement nested loops directly coding into JS or creating an alternative workround method directly addressing rows in just a single loop which can be terminated by the loop.finish method.
Any confirmations suggestions would be appreciated, as said I’m very confused on how to proceed.
Thanks