I am keep encountering an error message saying “invalid string length”, whenever I finish my experiment.
The experiment works fine, the data is saved, but the final line return Scheduler.Event.QUIT; ‘sometimes’ doesn’t work. I am currently testing with the pilot mode, but when I run this as run mode, my credit was consumed.
When I download the data file (as I am running in pilot mode), an error message appears after 10s of pause, which is quite long…
This is an error message that I got,
and this is an error message that appears at my console.
I finish the experiment by pressing a space bar, but the error message still appears when I remove the keyboard component.
When running in pilot mode, the data file is saved after I press the space bar, I wait about 10 - 20 seconds, then the error message appears without green box (saying thank you for your patience).
And, pavlovia doesn’t return the message always. The experiment is finished normally sometimes, but is crashed in some occasions.
In Experiment Settings you have “Show info dialog” unticked. The dialog box is still showing online but it might be that there is a knock on effect since the value for participant is checked when saving the data.
Please could you try changing that? Do you have other experiments where there isn’t a problem and the show info dialog is ticked?
I’ve just tried piloting it a couple of times and have crashed with a memory error before reaching the end. I think that the issue is the amount of data that is getting saved. In Pavlovia, all data is stored in memory until the end, whereas in PsychoPy running locally it gets saved during the experiment. Do you need so much data for every single berry clicked?
It might be worth testing this theory by commenting out most of the data saving calls in Each Frame code components.
Another thought would be to move psychoJS.experiment.addData(“hitcode”, hitnum); from End Routine of the final routine to Begin Routine.
N.B. You can type thisExp.addData(‘hitcode’, hitnum) in an Auto code component and it will translate correctly.
I have no psychoJS.experiment.addData(“hitcode”, hitnum) in my js file (I was manually updating the git repository because I had a post-processing after exporting html files from PsychoPy), so this would not be the reason.
Memory would be the reason… It was just my hunch, but the error seems not appearing when I test the experiment with reduced time length. I still need every single berry clicks. I will try again with a little bit of modifications on my code: save the data at an array then save the array once when the trial is over