Repeating unsolved tasks after break

Have a look at my Repeat Subset online demo from PsychoPy Online Demos

Repeat Subset code | try it

Adds errors made during the first loop to a list which used by the second loop, so that only incorrect trials are repeated.