Adding response pad code on coder

Hello!
I need help with creating code for response. I want the code to read the csv and record the responses and create a spreadsheet of all the response and identity whether the response is correct or not. Correct = 1, Uncorrect = 0.

Here are the files
experiment_9_3_2024.csv (20.9 KB)
Test46.py (38.9 KB)

Dear Anna_Nack,

The specific code for checking if a response is correct is:

                if (key_resp.keys == str('sdfg')) or (key_resp.keys == 'sdfg'):
                    key_resp.corr = 1
                else:
                    key_resp.corr = 0

Then to save the data:

    thisExp.addData('key_resp.keys',key_resp.keys)
    thisExp.addData('key_resp.corr', key_resp.corr)

Let me know if this what your were looking for.
Issac