Hi, we are trying to develop an fMRI compatible version of a reaction time task and need to use numbers 1-4 as corrAns values. However, the experiment is not registering these key presses as a response. The task works when letters (i.e. a,b,c,d) are used.
We have tried to save the corrAns values in excel as strings (i.e. added apostrophes before each digit), and subsequently changed Allowed keys to str(corrAns) … but the issue remains.
we have tried both the numbers on the main keyboard, and on the number pad. Doesn’t work for either.
Yes, tried both “corrAns” and “$corrAns”
The issue is that we are trying to reference the variable corrAns in two places, and to check that the key pressed is an exact match for the string in the corrAns column of the excel sheet. The code will only progress when that exact match is registered.
The issue seems to be that the number (e.g “1”) is being compared in a logical statement, but there is an issue because it is comparing a number to a string and therefore no match is found.
@Becca -any ideas?? (we are using Windows OS, with Psychopy3 v2020.1.3)
Also, we have tried saving the excel sheet as a .csv
And we have tried using a preceding apostrophe (read in previous forum that this should be read in as a string)
if you are using Store correct and compare it to Correct answer you get a new variable in the result file key_resp.corr (if key_resp is your keyboard-component’s name) that contains 1 when the response is correct and 0 when the response is incorrect. Furthermore, there is a variable called key_resp.key that contains the key the participant pressed. If you check "Force end of Routine the routine is finished as soon as one of allowed keys has been pressed.
It works in the uploaded example (notice; I am using ; as column separator). You may use the number-keys in the top-row of your keyboard, not the number-keys on the numeric keypad.