Linking feedback code to specific image

hi!
for my experiment I want to have practice trials with feedback. basically, its a go/no-go task.
so there are blue shapes and red shapes. if a red shape appears and participant doesn’t respond, then feedback must say correct. if red shape appears but participant responds with any key, feedback must show its wrong.

However, there are blue images that when shown, if participant presses letters “x” or “n” the feedback must say correct. if they fail to press those letters, feedback must say it is wrong.

I used this code :
if not key_resp.keys :
msg=“That was correct!”
elif key_resp.corr:#stored on last run routine
msg=“Correct!”
else:
msg=“Oops! That was wrong”

however this is a general code. but how do I link the feedback code to the type of image being shown? how do I make it show specific feedback to the blue stimuli but different feedback to the red stimuli?

Hello Maya,

Maybe you can define your feedback code and the correct key on your condition file.

1 Like
if 'y' in key_resp.keys or 'n' in key_resp.keys:
    msg=“That was correct!”
else:
    msg=“Oops! That was wrong”
1 Like