| Reference | Downloads | Github

Online experiment not creating RT column in output file

URL of experiment:

Description of the problem:

I have created a task where participants complete blocks of trials that repeat a set number of times. One of the tasks is to assess whether a number is odd or even via key press. Something I am noticing is that if participants don’t respond to a single trial in a block of trials, the rt column will not be created. This causes issues because when I am sifting through the data and concatenating multiple subjects, the data columns don’t align and I have to manually go in and fix it.

Is there any way to ensure that an RT column will be created even if there are no key responses? I tried to write a small line of code to enter “None” in the RT column if no response is made, in the “End Routine” column:

if (key_resp_15.keys == null) {
    psychoJS.experiment.addData("key_resp_15.rt", "None");

But this did not change anything about the output file. The other thing is that I need the column to be placed in the same position it would be in if someone actually made a response.


Offline I’ve had headaches due to this issue for manually saved variables, so I now remember to add thisExp.addData(“Score”,"") when I don’t have a score to save on that loop. Online, I’m using the database option so that I don’t have to worry about columns not matching up.