Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

How to rerun a loop after checking accuracy ?

aswvaswv Posts: 9

I am new to opensesame and I find it really cool. Get software.

I need help with the following scenario.

In my experiment, there is a learning phase and a testing phase. Participants learn words during the first phase(loop-sequence) and are tested in the second phase(loop-sequence).
After the test phase, I want to re-run the learning phase(loop) if the accuracy is less than 80%.

My problem is how do i specify, if the acc is less than 80, run this loop.

I tried python script, but its not working for me.


  • sebastiaansebastiaan Posts: 2,846
    edited May 26


    Say that you want to repeat block_loop when accuracy is less than 80%, then you could do the following:

    • Embed block_loop in another loop, here meta_loop
    • Set the repeat value for meta_loop very high (so that it's practically infinite)
    • Set the break-if statement for meta_loop to [acc] >= 80, and disable 'Evaluate on first cycle'

    Do you see the logic?


    image.png 68.6K

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

  • aswvaswv Posts: 9

    Works perfect.

    Thanks Sebastian...

  • fefflefeffle Posts: 2

    Hi there,

    I am trying to do a similar thing and have tried this method but it seems to take the cumulative accuracy across all completed block repetitions. Is there a way to break the loop based only on accuracy of the most recent block?


  • eduardeduard Posts: 1,001


    If you reset the feedback in the end (or the beginning) of a block, only the most recent block should be used for the computations. So just drag the reset_feeback item in the beginning of your block_sequence and you should be set.

    Good luck.


  • fefflefeffle Posts: 2

    That worked a treat, thanks so much!

Sign In or Register to comment.