Unable to feedback timeout correctly

Hi there,

I hope the feedback screen will be displayed for 1000 ms, and the correct response will show “correct”, the wrong response will prompt “wrong”, and the slow response (that is, no response after the stimulus disappears) will prompt “No response detected”.
At first, I was able to successfully display right and wrong, but after adding the intermediate code, psychopy prompted “TypeError:’ >’ Not supported between instances of’ list’ and’ float’. ”I tried to modify it, but it couldn’t distinguish between a reaction error and a timeout.I want to know how to modify my code.

My code is as follows

if key_resp.corr == 1:
    f_text = 'right'
    f_col = 'green'
    count=count+ 1
elif key_resp.rt > 1.0:
    f_text = 'No response detected'
    f_col = 'blue'
else:
    f_text = 'wrong'
    f_col = 'red'

I hope you can help me! Thank you in advance!

Are you saving all keys? If so then .corr and .rt might be a list.

Thank you for your willingness to help solve the problem.And I don’t think I need it. Is the computer setting all the keys? Change my statement to the following, and the program can run.That’s why?

if key_resp.corr == 1:
    f_text = 'right'
    f_col = 'green'
    count=count+ 1
elif key_resp.rt:
    f_text = 'wrong'
    f_col = 'red'
else:
    f_text = 'No response detected'
    f_col = 'blue'

Ah. Now I see the issue.

You were looking for long reaction times when in fact there was no response and therefore the RT was instead of a number. Checking for the existence of an RT works.

I’m sorry to see your reply now.
Does this RT refer to the storage start/end time in the keyboard assembly?
Thanks again.