Description of the problem:
I have an experiment, working in builder, which I am trying to transfer to Pavlovia. I am using importConditions to read in a csv file (see this thread for the backstory), but it seemed from the web console that, though the import line runs, the variable doesn’t exist or is empty.
Relevant portions of the original python code with importConditions:
# ------- import words & distracters -------
testfile = './html/resources/practice_EN_NH.csv'
practList = {}
practListData = importConditions(testfile)
for k in practListData[0]:
practList[k] = [d[k] for d in practListData]
catchList = {}
for k in practList:
catchList[k] = practList[k][6:].copy()
print('catch list ' + k + ':')
print(catchList[k])
del practList[k][6:]
Error encountered:
TypeError: "_pj_a is undefined"
experimentInit https://run.pavlovia.org/Aisa2/dictimport_test/html/dictImport.js:115
_runNextTasks https://run.pavlovia.org/Aisa2/dictimport_test/html/lib/util-2020.1.js:1091
_runNextTasks https://run.pavlovia.org/Aisa2/dictimport_test/html/lib/util-2020.1.js:1094
update https://run.pavlovia.org/Aisa2/dictimport_test/html/lib/util-2020.1.js:1058
core-2020.1.js:1438:12
onerror https://run.pavlovia.org/Aisa2/dictimport_test/html/lib/core-2020.1.js:1438
FATAL unknown | {} log4javascript.min.js:1:40074
append https://cdnjs.cloudflare.com/ajax/libs/log4javascript/1.4.9/log4javascript.min.js:1
doAppend https://cdnjs.cloudflare.com/ajax/libs/log4javascript/1.4.9/log4javascript.min.js:1
callAppenders https://cdnjs.cloudflare.com/ajax/libs/log4javascript/1.4.9/log4javascript.min.js:1
log https://cdnjs.cloudflare.com/ajax/libs/log4javascript/1.4.9/log4javascript.min.js:1
fatal https://cdnjs.cloudflare.com/ajax/libs/log4javascript/1.4.9/log4javascript.min.js:1
dialog https://run.pavlovia.org/Aisa2/dictimport_test/html/lib/core-2020.1.js:921
onerror https://run.pavlovia.org/Aisa2/dictimport_test/html/lib/core-2020.1.js:1439
More info: the js code it references for “_pj_a is undefined” is this:
for (var k, _pj_c = 0, _pj_a = practListData[0], _pj_b = _pj_a.length; (_pj_c < _pj_b); _pj_c += 1) {
k = _pj_a[_pj_c];
practList[k] = function () {
var _pj_d = [], _pj_e = practListData;
for (var _pj_f = 0, _pj_g = _pj_e.length; (_pj_f < _pj_g); _pj_f += 1) {
var d = _pj_e[_pj_f];
_pj_d.push(d[k]);
}
return _pj_d;
}
.call(this);
}
so _pj_a is the first entry of practListData.
I am not sure if I have included some code incompatible with psychoJS, or if the problem is coming from elsewhere. Has anyone seen this before?