psychopy.org | Reference | Downloads | Github

Online version marking all keyboard component responses as false: reading in .csv of keypress names differently offline vs. online?

URL of experiment: https://pavlovia.org/naomilee/num-abb

Description of the problem: Reading in the names of keys for checking the correctness of keypresses is not working online. All responses are marked as false and logic checking whether the variable equals a text string name like “left” is always failing, even though the offline PsychoPy keyboard component is being checked for correctness correctly (and the logic in the offline code component is working correctly). How does .csv reading work on PsychoJS? How can I get it into the right format for a keyboard component answer check?

More detail: In two of my routines (training_choice and validation), I have keyboard components (choose_button and choose_valid, respectively) that I have set to “Store correct” answers. In both cases, the correct answer (‘left’, ‘down’, or ‘right’) is read from a .csv file with a column “corrAns”. I also have a code component in the training_choice routine that evaluates on the basis of what corrAns is (with effects on the animation).

The offline PsychoPy version is recording choose_button.corr and choose_valid.corr correctly based on user feedback, but the online PsychoJS version is marking all of those keypresses as incorrect. Moreover, the code component logic works offline, but is always failing online:

PsychoPy:

if corrAns == "left":

PsychoJS

if ((corrAns === "left")) {...}

I would appreciate any help / detail on
a) how PsychoJS reads in .csv files (and how that might differ from PsychoPy),
b) what format the names of keys need to be in to be used for checking correctness of responses correctly, and/or
c) other advice on how to fix this issue.

Thank you in advance, PsychoPy community!