URL of experiment: Sign in · GitLab
Description of the problem: I’ve tried defining an empty array in a BeginExperiment component several different ways, and assigning values to it multiple different ways, but I always get the ReferenceError: points_append in not defined error. I can get it to work in the console by running it in the different ways noted below, but not while running the experiment through pavlovia. I could really use some help with this.
In my experiment js file linked above the array is initialized in line 331-332, and the value is assigned in line 5168.
Here are the different ways I’ve tried initializing the array
var points_append;
var points_append = new Array()
let points_append = new Array(6) # 6 is the max size of the array
let points_append = new Array()
and assigning the values in a code component at the end of a block loop:
points_append[BlockNum]=points_cumul;
points_append.push(points_cumul);