Please help me with an accuracy rate problem,THANK YOU VERY MUCH!

OS :Win11
PsychoPy version: 2023.2.3
I have a problem, please help me, thank you very much! I am a beginner, please forgive me!
I’m setting up a stroop experiment with a practice program. When the correct rate of practice is ≥80%, I want to display the text - "practice passed, please press the space to continue the experiment. “.Otherwise the text is displayed - “the correct rate is not 80%, please press the q key to return to practice”. To do this, I added an extra loop out of the Practice loop and wrote the following code in the end routine:if correctNumbers/(trial_loop.nTotal + 1) >= 0.80:
practicetext.setText(“practice passed, please press space bar to continue”)
trials_practice.finished = True
practicetext.setText(“The correct rate is not 80%, please press q to return to practice”).
trials_practice.finished = False
Then,i set a text component named"practicetext”.But at the end of the practice, only a blank screen is displayed.What should i do?

You put the code in the wrong place.You should write the "parcticetext.setText"parts in the begin routine instead of end routine.

It worked,thank you a lot!!!