Gitlab: https://gitlab.pavlovia.org/VeraLudwig/purm-workplace-experiment-v8
Description of the problem: I originally had a working experiment from Psychopy, but it did not upload to pavlovia. I’ve looked at countless threads and learned that none of the libraries worked so I used a shuffle function and an excel reading function that was shared by dvbridges, which finally got my experiment to run. Now I wanted to put each of the elements in a column to separate lists and my code looks as follows:
ps1_cond = [];
gender_cond = [];
connective_cond = [];
ps2_cond = [];
gender_cond2 = [];
descriptive_cond = [];
for (var rowx = 1, _pj_a = (num_items + 1); (rowx < _pj_a); rowx += 1) {
ps1_cond.push(trialList[rowx]['ps1_cond']);
gender_cond.push(trialList[rowx]['gender_cond']);
ps2_cond.push(trialList[rowx]['ps2_cond']);
gender_cond2.push(trialList[rowx]['gender_cond2']);
if ((valueX >= 6)) {
connective_cond.push(trialList[rowx]['connective_cond']);
descriptive_cond.push(trialList[rowx]['descriptive_cond']);
} else {
connective_cond.push(trialList[rowx]['descriptive_cond']);
descriptive_cond.push(trialList[rowx]['connective_cond']);
}
}
And the error I got is TypeError: cannot read property of ‘ps1_cond’ of undefined. When I changed the ‘ps1_cond’ from the line ps1_cond.push(trialList[rowx][‘ps1_cond’]); to any other word, it will show up with the same error but with the different word. I saw from dvbridges’ code that he put the column headers in that same spot and it worked, so I’m wondering what is wrong on my part.