Feedback: wrong order

Hi everyone. I am trying to create a code for a dual task. I want to react first to the first task and then to the second task. I want to break down the feedback into:

  • correct
  • wrong
  • too slow
  • wrong order

This is the code I have so far:

if not key_t2_respond.keys and key_t2_respond is not “none” :
feedback = “too slow”

elif key_t1_respond.corr and key_t2_respond.corr:
feedback = “right”
else:
feedback = “wrong”

thisExp.addData(‘feedback’, feedback)

How I create the feedback “wrong order” I don’t understand.

I am quite new in the field and would be very happy if someone could help me!!! :slight_smile:

How about the following?

if key_t1_respond.keys and key_t2_respond.keys:
     if key_t1_respond.corr and key_t2_respond.corr:
          if key_t1_respond.rt < key_t2_respond.rt:
               feedback = 'right'
          else:
               feedback = 'wrong order'
     else:
          feedback = 'wrong'
else:
     feedback = 'too slow'

Thank you so much for help! It works quite well. However, when I simulate the experiment, the feedback “wrong” often appears although the reaction was correct. Do you have any idea what this could be?

Is the code in End Routine?

I’d recommend using some print commands to work out what’s going on.