Correct responses for three loops

-Win10 -PsychoPy version v2020.2.0 -Standard Standalone? y
What are you trying to achieve?:

In the learning phase of my experiment, eight colored circles will be presented in specific positions. In the test phase, the color at the center point will be presented as a retro-cue. Then, 16 black circles will be presented and subjects will have to click on the correct one. If they click on the correct circle for all 8 circles during 3 loops, the test will be end, but even if they make a single mistake, it will be shown correct circle and they will return to the learning phase. How do I achieve this condition for the test phase?