Here is my code (though incomplete):
for k in range(len(ace)):
recognitionstim.image = ace[k]
old.draw()
new.draw()
if ace[k] in ac:
recog = 'old'
else:
recog = 'new'
win.flip()
trialClock.reset()
resp = event.waitKeys(keyList = ['a','l'])
rt2 = trialClock.getTime()
if resp == 'a' and recog == 'old':
accuracy = 'correct'
else:
accuracy = 'incorrect'
writer.writerow([k,ace[k],rt2,recog,resp,accuracy])
What this code does is it shows a series of images, and if they came from the list titled 'ac' they will be called 'old.' What I'm trying to do is write code that takes things that are 'old' and pairs them with a key press ('a') so that if old and 'a' is pressed it will log it as 'correct'. However, it doesn't appear to be able to read 'recog'. Any ideas on how I might fix this? Any help will be greatly appreciated. :)