On the problem of Stroop paradigm practice cycle

PsychoPy version (v2023.1.1):
I am new to PsychoPy, having some problems setting up my experiments.

I want to implement it in the Stroop paradigm, and enter the formal experiment when the total number of practice trails exceeds 10 and the accuracy rate is 80%.
I set up a loop during the practice phase (only once, with 6 trails per loop) and a loop during the accuracy phase. But when I run the program, even if the conditions for entering the formal experiment are met, I am still continuing the practice cycle.
Sorry, I failed to upload the image. I will upload images in the comments section.
I don’t have PsychoPy experience, so if there is a way to do this just in builder, I would so appreciate it, but if not, I’ll take what I can get.

Thank you very much for your help

In code 2 you have trails = 0 just above a line where you check whether trails >= 10. Don’t reset all your variables in code_2

Your good advice was very much appreciated. Based on your suggestion, I removed trails=0 in code_2, and the experimental program achieved the desired result. Thanks for your attention and kindly advice.