Repeat the first loop according to the accuracy rate

OS** (e.g. Win10): Win10

PsychoPy version** (e.g. 1.84.x): v2021.2.3

There are two study loops of the experiment, sequential and random. The first loop is for participants to practice, which includes practice sentences and 15 questions.

My ideal pattern:

If the participant’ accuracy rate hasn’t reached 13/15, they will repeat the first loop.

If the participant’ accuracy rate reached 13/15, they will continue and enter the second loop.

I was wondering how I could realize this.

Thanks in advance.

1 Like

Hi @gxwynl,

as far as I am aware, you can terminate a loop using js:

trials.finished = true

With that, you can put an endless loop around your practice loop, count the number of accurate responses in the inner loop and terminate the endless loop when the criterion is met.

Best,
Adrian

1 Like

Thank you very much! I got your point and will have a try.