URL of experiment:
Description of the problem:
Hello,
I am trying to convert a Psychopy experiment, created in Builder, to PsychoJS and run on Pavlovia. The Python custom code was working as it was supposed to but I converted the custom code to JS and I’m encountering an issue so I’m unsure where my syntax went wrong. What the first part of the experiment is meant to do is select a subset of possible .csv files for each participant based on a randomly generated number. However, it seems like the files aren’t reading in correctly and I’m not sure why. Before any images are displayed, this error message is displayed:
TypeError: Cannot assign to read only property ‘undefined’ of object '#'
I tried to define my list using the following:
if ((version === 10)) {
cond = ["1_start_ver_10_walk.csv", "2_start_ver_10_walk.csv", "3_start_ver_10_walk.csv", "4_start_ver_10_walk.csv", "5_start_ver_10_walk.csv", "6_start_ver_10_walk.csv", "7_start_ver_10_walk.csv", "8_start_ver_10_walk.csv", "9_start_ver_10_walk.csv", "10_start_ver_10_walk.csv"];
shuffleArray(cond);
goal_list = ["ver_10_goals.csv"];
trial_list = ["ver_10_trials.csv"];
}
cond1 = cond[0];
and then call on these lists in the TrialHandler:
trials_1 = new TrialHandler({
psychoJS: psychoJS,
nReps: 1, method: TrialHandler.Method.SEQUENTIAL,
extraInfo: expInfo, originPath: undefined,
trialList: cond1,
seed: undefined, name: 'trials_1'
});
I’m not sure why this isn’t working or what the error is referring to.
Any help would be hugely appreciated!
Best,
Iva