Resetting responses for each trial

Win11
PsychoPy version 2024.1.5
Standard Standalone

Hi there,

I am currently building a version of Stroop (Stroop Squared), where participants are shown three stimuli (one target text and two response text words). They are required to select one of the two bottom words based on the colour of the top word. I have it set up to record correct responses, and also to show a tick or a cross on top of the relevant word for correct/incorrect responses (when a mouse response is made to the relevant word). This is all working well, but what I cannot work out is how to make my tick/cross disappear between trials (routines). At the moment the tick/cross stays on screen at the end of the routine, and then updates when there is a response made to the next routine - but I would like the tick/cross to disappear as soon as the next routine starts (and only appear in response to the mouse click). I hope that makes sense.

The code I am using is set out below:

End routine tab:
if mouse_Stroop_Response.isPressedIn(textLeftWord):
if textLeftWord.text == stim_word_colour:
green_tick.opacity = 1
green_tick.pos = textLeftWord.pos + [0, 0.1]
else:
red_cross.opacity = 1
red_cross.pos = textLeftWord.pos + [0, 0.1] # Dynamic position above textLeftWord

elif mouse_Stroop_Response.isPressedIn(textRightWord):
if textRightWord.text == stim_word_colour:
green_tick.opacity = 1
green_tick.pos = textRightWord.pos + [0, 0.1]
else:
red_cross.opacity = 1
red_cross.pos = textRightWord.pos + [0, 0.1] # Dynamic position above textRightWord

I should note that I have tried adding this code in the begin routine tab, but when I do the ticks/crosses do not appear at all:

green_tick.opacity = 0
red_cross.opacity = 0

Also - my green_tick and red_cross components are images, and I have their appearance set as 0 opacity at constant.

Any help gratefully appreciated! Thanks.

This:

does exactly that:

I assume that on clicking the response the routine is ending. This in turn triggers the code in your “End routine”-tab - making the tick visible. In the very next moment (there is no delay between ending the routine and starting the next one) you make the ticks invisible again by using the above code.

So maybe you might want to redo the design: How about you remove the logic of your ticks from the current routine and create a second “feedback” routine afterwards. Here you can recreate the three words and set a fixed duration. You can create the ticks here as well and use a starting condition (something like you did in your code earlier) instead of a starting time.
Or, instead of using the starting conditions, you could even just paste your code from above in the “Start routine”-tab of a code component on this new feedback routine.

Thanks for the help!

I couldn’t get the code to work to set up a response routine (I’m still new at this), but I used your logic to come up with a solution that seems to work. I have set the red cross and green tick in the routine to appear for 0.5 seconds only, and I have inserted a Blank100 routine after my trial routine that runs for 0.1 seconds. It is not perfect but it does the job! That is now working, with the ticks disappearing at the end of the routine and just the text stimuli showing up at the start of the next routine.

Thanks again.