psychopy.org | Reference | Downloads | Github

Feedback routine only provides negative feedback

What are you trying to achieve?:
In the trial loop of my experiment, I have the following routines in sequential order: Stimulus, Response, and Feedback. I am receiving feedback following the keyboard response, however, regardless if the response was correct/incorrect, the feedback is always the negative feedback.

The following is the code I used. It was copied verbatim from the StroopReverse Demo:

Under ‘Begin Experiment Tab’:
#msg variable just needs some value at start
msg=’’

Under tab ‘Begin Routine’:

if resp.corr:
    msg = "Correct! RT=%.3f" %(resp.rt) 
    msgColor = "green"
else:
    msg = "Wrong!"
    msgColor = red

-‘resp’ refers to my keyboard response
-‘corr’ refers to my correct answer parameter from the excel sheet

when inputting code, should there be spaces between words, or no spaces? For example:
" msg = “Correct! RT =%.3f” %(resp.rt) "
" msg=“Correct!RT=%.3f”%(resp.rt)"

Which is correct; or are both fine?

All of my ducks are in a row for the experiment, with the routines running as planned. The only hang-up is that the feedback is always negative regardless of correctness of answer.

Please also provide a screenshot of your keyboard component settings, and show the content of your conditions file that contains the column with the correct answers.



It’s a capitalisation issue. The keys you allow the user to press are “left”, “right” etc but the correct answer you set is “Left”, “Right”… The participant can never get the answer correct because “left” is not the same as “Left”

You need lower case for the names of keys

Jon, thank you. That was, in fact, the exact issue. Feedback is up and running now.

One final question regarding feedback, Jon, sir:

Is there a way to insert sounds/tones into the feedback code?

Like, if participants get correct answer, they get a high frequency ‘beep’, and if they get wrong answer, they get a low frequency ‘boop’?

There is a sound stimulus option, but I do not see any inherent setting to include a sound as a feedback response.

Well, that would work just like above. Sound stimuli take a value for what the sound is ( can be a name like “F” or a frequency like 440).

if resp.corr:
    msg = "Correct! RT=%.3f" %(resp.rt) 
    msgColor = "green"
    toneF = 660
else:
    msg = "Wrong!"
    msgColor = red
    toneF = 330

and then set your sound to be $toneF like you set your text to be $msg

Thank you, Jon. I’ll be sure to add your name to the acknowledgements section of the research paper I may get published! You and the community here, have been a big help thus far.