How to receive negative feedback if the subject responds before stimulus presentaion?

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): 2020.2.5
Standard Standalone? (y/n) If not then what?: y

What are you trying to achieve?:
Dear all,
In my task, after displaying the cue, four images are shown to the subject. After a few seconds (randomly), the brightness of the image displayed in the cue location changes and the person has up to 700 milliseconds after the change to report it(by pressing the Right key). And if he/she reports, he/she receives positive audio feedback and if he/she does not report, receives negative audio feedback.
I also want the person to receive negative audio feedback if the he/she response before change occurrence and this trial dose not continue(fails) and go to the next trial, indeed the correct response before the change occurrence in image brightness is no response.

What did you try to make it work?:

To achieve this I created two columns in my condition file: ‘’‘corrAns’’’ and ‘’‘corrAns1’’’
and created two feedback routines but it didn’t work well.
This is the code in the feedback1 Before Experiment tab:

Begin Routine tab:

if 'right' in key_2.keys:
     sound= soundfile[1]
     continueRoutine = False
else:
    continueRoutine = True

What specifically went wrong when you tried that?:
When I don’t press any key before change occurrence routine ends and dose not continue but when I press ‘Right key’ on keyboard(before change) I receive the negative feedback and trial continues. I’m confused. What’s wrong about my code and method?
It’d be so glad if someone can help me out!
Thanks!

In the Each Frames tab of a Code component, you can compare timing by comparing the variable t to the start/stop values of components. So, if you want <700ms after the end of the image components, you could do:

if t > image_4.tStop + 700:
     sound= soundfile[1]
     continueRoutine = False
1 Like