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

**URL:** <https://discourse.psychopy.org/t/online-version-marking-all-keyboard-component-responses-as-false-reading-in-csv-of-keypress-names-differently-offline-vs-online/12983>\
**Category:** Online experiments\
**Tags:** csv\
**Created:** [May 4, 2020, 5:49am UTC](https://discourse.psychopy.org/t/online-version-marking-all-keyboard-component-responses-as-false-reading-in-csv-of-keypress-names-differently-offline-vs-online/12983 "2020-05-04T05:49:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![naomileenaomi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/naomileenaomi/32/7352_2.png) [@naomileenaomi](https://discourse.psychopy.org/u/naomileenaomi)\
**Post date:** [May 4, 2020, 5:49am UTC](https://discourse.psychopy.org/t/online-version-marking-all-keyboard-component-responses-as-false-reading-in-csv-of-keypress-names-differently-offline-vs-online/12983/1 "2020-05-04T05:49:37Z")

</div>

**URL of experiment** : [https://pavlovia.org/naomilee/num-abb](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:

```auto
if corrAns == "left":

```

PsychoJS

```auto
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!
