One practice trial after each mistake

MacOS Mojave
PsychoPy version 2020 1.2

For a picture naming experiments, I want participants to repeat one of the practice trials every time they make a mistake. The participant will receive feedback after each trial (“Correct”, “wrong”, “too slow”) which is all working smoothly. Thus, after ‘correct’ I want an additional loop giving them 1 practice trial item so that they will make fewer mistakes when they go on with the experiment.

I have no experience with coding and I am only able to copy paste what I found on forums. I do have instructions for a similar method but in E-prime. However, I am unable to translate this to PsychoPy. What I think needs to happen is a code saying 'if key.resp.corr = 0, go to practice trial". I’ll paste the E-prime instructions below if someone could make sense of it.

Does anyone know how I can do this/translate this to PsychoPy?

I hope I have provided enough information. Please let me know if you need something else!