Key_resp.corr always returning 0 – feedback only shows “woops!” (Builder)

Hi everyone,

I’m working on a dual lexical decision task in PsychoPy Builder and I’m having an issue where my feedback routine always shows “woops!!” and never “Well done!!”.

In my code component I have:

if key_resp.corr == 1:
    msg = 'Well done!!'
else:
    msg = 'woops!!'

My Keyboard component settings:

  • Allowed keys: ‘a’, ‘l’

  • Store correct: :check_mark:

  • Correct answer field: $CorAns

  • Conditions file column name: CorAns

In my conditions file, the column header is exactly:
CorAns

And the values in that column are:
a
l

(all lowercase, no spaces)

Despite this, key_resp.corr seems to always evaluate to 0.

I’m not supposed to change the feedback logic (it was provided by my instructor), so I’m trying to understand why the correct responses are not being registered.

Has anyone encountered this issue before? Is there something I might be missing in the Keyboard or Loop settings?

Thanks in advance!

Is your keyboard component set to save all keys instead of first/last?
Does your keyboard end the trial?

Hello @poppy.15

There is no need to compare key_resp.corrto 1. key_resp.corris 1 when the response was correct. I always use something along the following lines:

if not key_resp.keys:
    msg = "Failed to respond"
elif key_resp.corr: 
    msg = 'Well done!!'
else:   
    msg = 'woops!!'

In addition, I initialize msg with a value that is not be used in experiment. e.g. msg = “doh”. You could print the value of key_resp.corr, key_resp.keys and corrAns to Stdout to check their values, e.g. print("key_res.corr: ", key_resp.corr)

Where do show the feedback in your flow? In an extra routine following the trial routine? In the same routine as your trial?

Best wishes Jens