Stroop task feedback across multiple blocks trouble

Win10
PsychoPy 2022 2.4

First post, apologies the formatting might not be all up to scratch

I am working on a stroop task that plays different sound files in separate blocks to see how it effects performance (First off, thank you forum for helping me get this far!). before each experimental block there is a practice block that allows participants to get use to the sounds, with said practice blocks giving correct/incorrect and RT feedback.

The problem is the first trial block (T1) jams up the feedback for subsequent blocks. All feedback after T1 finishes is locked as the last response of the block (If the last trial in T1 was wrong, all feedback in T2 and onwards comes back ‘Wrong’, and if it it was right comes back ‘Correct’ with the exact response time.

I think the problem is a case of the feedback is running off the data stored in the loop as opposed to the keypress itself, and after that first loop ends it keeps producing the latest response (the last output for T1) but I do not have the coding knowledge to fix it.

The code being used for the loop is:
Begin Experiment:
msg=‘’ (Double apostrophe)

Begin Routine:
if resp.corr:
msg=“Correct RT=%.3f” %(resp.rt)
else:
msg=“Wrong”

with a text component below the code component displaying $msg with ‘set every repeat’ enabled.

Any help would be greatly appreciated, and if there’s anymore info needed from the experiment itself please let me know! (Didn’t want to flood the post with unnecessary tat).

Hello PsychTech

simply surround your code with three ` to get proper code formatting. Anyway, do you mind posting your experiment flow, especially block T1 and the subsequent block.

Best wishes Jens

Hi Jens,

No problem!

The subsequent blocks are more or less carbon copies of T1, with a slight tweak to a code component to play the different sound files:
Begin Experiment:
/block_sound = sound.Sound(‘us.wav’)
block2_sound = sound.Sound(‘whitenoise.wav’)
block3_sound = sound.Sound(‘ns.wav’)
/

Begin Routine:
/if experiment2.thisN == 0:
block2_sound.play()
/

experiment2 being changed depending on which loop its a part of

End Routine:
/if experiment2.thisN == 29:
block2_sound.stop()
/

With the problematic feedback code properly formatted it displays as:
/if resp.corr:
msg=“Correct RT=%.3f” %(resp.rt)
else:
msg=“Wrong”
/

Hello PsychTech,

You did not reuse the old routines, trial_p1 and feedback, but used new routines, trial_p2 and feedback2. Well, if only stimuli change between trials (warm-up, block1, block 2), I reuse the routine.

Do you mind showing the routines trial_p1 and trial_p2? How do you call the keyboard-component in these routines? I assume that you did not adapt the if-else-construction to the different name in the second trial-routine.

The sound don’t have anything to do with the feedback. And don’t forget the triple `

Best wishes Jens