Need help with word showing error in self-paced reading task

OS (e.g. Win10): Win11
PsychoPy version (e.g. 1.84.x): 2023.2.3
Standard Standalone? (y/n) If not then what?: y
What are you trying to achieve?:

Hello.

I have been working on a SPRT experiment and its 99% complete.
What makes it incomplete is an error in the practice trials.

I made looped practice trials named ‘trialsPractice’.
In these trials, the fixation cross is shown for 1 second, then the words in the sentence are shown one by one. After that, a question is asked, and feedback is given after the answer is typed.

The problem is that after the fixation cross, the last word of the previous sentence is shown for about half a second and then replaced with the word of the sentence that needs to be shown.

For example, the sentence “I love you.” is presented first, and then “He loves me.” is presented afterward.
After completing the practice run for the first sentence, the word ‘He’ should be presented when the cross is passed.
However, the last word of the first sentence, ‘you’, is shown very shortly before the word ‘He’ is shown.

How can I fix this error?
I’ve attached a link of the experiment I worked on.

Thank you in advance for your help.
Jay.

Is the text component set to update each frame? If so it will have the previous value for the first frame. Does it need to change within the routine or could you set it to update each repeat?

Hello.
Thank you for your reply.

I changed it to set every repeat as you suggested, but no text is visible at all.

The code I wrote (prac_SPRTcode) is in the begin routine, each frame part…
Should I try to correct the code to fix the error?

I have main trials that use the same code as the practice trials, but they don’t have any issues like the practice trials.
If it’s a problem with the code, shouldn’t the same problem occur in the main run?

Thank you for your help.
Jay.

Put the code in Begin Routine and ensure the code component is above the text component

It worked!! :smiley_cat:
Thank you for your help!
Have a good day.

Jay.