psychopy.org | Reference | Downloads | Github

Experiment not saving data Online, generates empty CSV files

URL of experiment:
https://pavlovia.org/run/aendrs/dataval_a/html/

Description of the problem:

My experiment is saving the data properly when run locally, but it is not saving the data online, it gives me empty .CSV files. I have tried to modify different parameters but no luck so far.

Do anyone have experienced the same issue? Could you provide a suggestion?

Thanks in advance

Hi, looks like its an issue with the trials.finished statement. You are quitting the loop on the first iteration, so the call to save data is not made. We can look at this scenario, but for now add the following to your code component in the trial routine:

trials.finished = true;
psychoJS.experiment.nextEntry();  // save data and move to next row in Excel sheet

Thanks for the answer!
it seemed to work, now i get proper CSV files but there is an uninteded error.

The ‘key_resp.keys’ and ‘key_resp.rt’ columns are shifted by one element. That is, the first trial row is empty and its corresponding key_resp value is on row 2, and so on until the last trial row. This eliminates one trial since the last one is not saved (and the previous ones are shifted).

Do you think it can be solved?
Otherwise I will have to shift the key responses when doinig the analysis and just lose one trial. It’s not ideal but it’s better than nothing.
Thanks again for your help

Looks like a simple solution. The problem is that nextEntry is being called before the keyboard can add the data to the experiment handler. If you move your code component to the bottom of the routine so it appears after the keyboard component, this error should go away. By the way, I have made a pull request to fix this error for future users - see GitHub.

This solved the issue, thank you very much for your help!

1 Like