Description of the problem: I write prospective memory experiments by reading the targets and fillers into separate arrays and then interleaving them.
To keep things simple for the student, I ask for all the stimuli to be in the same csv file, which means that I have to use slice to extract the targets, because there are always fewer targets than fillers.
My target_loop has $slice(0,10) at the selected rows, which I think is the only instance of slice used in my template experiment. In the Javascript, this has translated to:
“slice()” doesn’t exist in JS, array.slice() and string.slice() do. I think the way importConditions works in JS, it just doesn’t work that way. You may have better luck with alternative syntax, like [0:10].
The reason I use slice is because I can’t get other syntax to work in PsychoPy (standalone).
slice(0,10) works
[0:10] gives Python syntax error in field Selected Rows when trying to set the loop
[0:10] gives TypeError: ‘NoneType’ object is not iterable when starting the experiment
[0,10] gives IndexError: list index out of range when trying to set the position of the first target
$[0,10] works in standalone but gives TypeError: Cannot read property ‘push’ of undefined online. The error is in the line targetlist.push(Target);
I’ve just followed your PsychoPy link and realised that $[0,10] will only load two targets, not ten.
0:10 (no brackets) seems to work, in that it’s fine locally but I still get the TypeError as above.
I’m not surprised that using $slice() doesn’t work. slice is a class in Python but it’s a method in JS. And I don’t think we need to worry about the problem with import in general as this is about the importConditions function.
What it really needs is for the importConditions in the JS lib to handle strings and treat them as slices in the same way as the Python code. So that simply writing 0:10 in the selectedRows box works!
I also wrote $order in the Selected rows of the loop GUI, as depicted here:
In pavlovia it works until the 10th trial. After that the stimulus/video is not played anymore and no error is shown in the Console . When less trials are run, 4 or 8, all goes as it should be: the experiment stops when all trials are finished.
I tested the experiment on different machines and I have a similar issue: at a certain trial stimuli/video are not played anymore.
The size of the resource folder is ~800 MB, I hope it is not a matter related to the big folder dimensions.
If someone of you has a suggestion, I’ll appreaciate it. Thanks a lot!