URL of experiment: https://gitlab.pavlovia.org/amazar/hea-4.git
Description of the problem: I keep getting the following error when trying to import a conditions file (“between.csv”) on Pavlovia:
TypeError: Cannot read property 'length' of undefined
at Function.importConditions (https://run.pavlovia.org/amazar/hea-4/html/lib/data-2020.1.js:304:44)
at Scheduler.trials_2LoopBegin [as _currentTask] (https://run.pavlovia.org/amazar/hea-4/html/Habit%20Attribution%20Experiment.js:614:29)
at Scheduler._runNextTasks (https://run.pavlovia.org/amazar/hea-4/html/lib/util-2020.1.js:1091:18)
at Scheduler._runNextTasks (https://run.pavlovia.org/amazar/hea-4/html/lib/util-2020.1.js:1094:31)
at update (https://run.pavlovia.org/amazar/hea-4/html/lib/util-2020.1.js:1058:23)
Here is the relevant piece of code. It seems that the issue is with the specific line:
TrialHandler.importConditions(psychoJS.serverManager, 'between.csv', 'Math.floor(Math.random() * Math.floor(8))')
var trials_2;
var currentLoop;
function trials_2LoopBegin(thisScheduler) {
// set up handler to look after randomisation of conditions etc
trials_2 = new TrialHandler({
psychoJS: psychoJS,
nReps: 1, method: TrialHandler.Method.RANDOM,
extraInfo: expInfo, originPath: undefined,
trialList: TrialHandler.importConditions(psychoJS.serverManager, 'between.csv', 'Math.floor(Math.random() * Math.floor(8))'),
seed: undefined, name: 'trials_2'
});
psychoJS.experiment.addLoop(trials_2); // add the loop to the experiment
currentLoop = trials_2; // we're now the current loop
Thanks!