I am working on an experiment where the participant sees a string, and then must type whether it is grammatical (G) or nongrammatical (N). Right now, the participant responses are being recorded using the Textbox component. I have an excel file with the strings and correct answers on it, and I was trying to have the experiment check for the accuracy of the participant response. This is the code I am trying to use:
print('checking accuracy') if key_resp_2.rt: if textbox.text == corrAns: corr = 1 print('Answer was correct!') else: corr = 0 print('Answer was incorrect!') trials_2.addData('correct', corr) print('data saved')
However, none of the information that is supposed to be printed is appearing in the data file, so I am not sure that this is working as it should. Any help would be appreciated, thank you!
PsychoPy version: 2020.2.8