Running loop (block) based on performance

URL of experiment:

Description of the problem: trying to run multiple time a block based on performance.

I am trying to add this feature in my exp, where if participant make more than 20% incorrect response, that block will repeat.

I am trying as
1: nResp section; i am defining one variable rept = 0 in begin experiment.
then i am after completing block, based on accuracy i am adding rept = rept + 1

but this is not updating in nResp section, as it is only running once irrespective of accuracy.

is there any goto or flag kind of feature available in psychopy. I would also do this in online would same code for psython would work or different for js.

Thanks in advance

As I told you elsewhere:

PsychoPy also doesn’t support jumping around the code using a goto function or similar.

You have to set the loop up for the maximum number of iterations and then break out early when minimum performance has been reached.