In my experiment I'm showing a random generated stimulus 'x', which I need to compare to a key that's been giving in by the user of the experiment. Basically, I have two lists:
- one with the stimuli
- and one with the correct answers (the keys they should give)
The order is the same, by which I mean that stimulus 1 should get the key that's at 'place 1' in the list with answers.
I've searched several topics on how to compare these two lists but so far it hasn't been working.
These are the options I've tried:
Answerruning = True
while Answerrunning:
if event.getKeys(keyList):
ReactionTime.getTime()
Keys = event.waitKeys()
for givenKey in Keys:
if givenKey == keyList:
answer_stimulus = 2
Answerrunning = False
window.flip(clearBuffer = True)
else:
answer_stimulus = 0
And this option but I think the other one is better:
keyList = []
givenKey = event.getKeys(keyList)
Answerrunning = True
while Answerrunning:
for x in stimulus:
if givenKey in keyList:
ReactionTime.getTime()
answer_stimulus = 2
Answerrunning = False
window.flip(clearBuffer = True)
else:
answer_stimulus = 0
I hope one of you can give me a hint on the problem how to compare those two en from there on my window will clear en the experiment can go on.