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

**URL:** <https://discourse.psychopy.org/t/please-help-me-with-an-accuracy-rate-problem-thank-you-very-much/37145>\
**Category:** Builder\
**Created:** [October 28, 2023, 3:31am UTC](https://discourse.psychopy.org/t/please-help-me-with-an-accuracy-rate-problem-thank-you-very-much/37145 "2023-10-28T03:31:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bwdcccc](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bwdcccc](https://discourse.psychopy.org/u/bwdcccc)\
**Post date:** [October 28, 2023, 3:31am UTC](https://discourse.psychopy.org/t/please-help-me-with-an-accuracy-rate-problem-thank-you-very-much/37145/1 "2023-10-28T03:31:05Z")

</div>

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  
else:  
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?  
 ![1698463359493](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/8/6/8692bf76cf498a05b8ce6c9ebc0ce0126ad5dbf2.png)  
 ![1698463290597](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/b/5b566d2b580ff46d3064b243902973989dfc4142.png)

---

<div class="post-metadata">

**Author:** ![yapi](https://avatars.discourse-cdn.com/v4/letter/y/e9bcb4/32.png) [@yapi](https://discourse.psychopy.org/u/yapi)\
**Post date:** [October 28, 2023, 3:42am UTC](https://discourse.psychopy.org/t/please-help-me-with-an-accuracy-rate-problem-thank-you-very-much/37145/2 "2023-10-28T03:42:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bwdcccc](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@bwdcccc](https://discourse.psychopy.org/u/bwdcccc)\
**Post date:** [October 28, 2023, 3:57am UTC](https://discourse.psychopy.org/t/please-help-me-with-an-accuracy-rate-problem-thank-you-very-much/37145/3 "2023-10-28T03:57:11Z")

</div>

It worked,thank you a lot!!!
