Description of the problem:
I want to shuffle some sound stimuli and congruency information.
As it is not possible to access an excel file with xlrd, I created two lists (one for the sound stimuli and one with the congruency information). When running the experiment, I get the error “cannot read property 0 of undefined”. I read some threads and tried to remove “var”, but then I get the error that i is not defined. I also read the python --> javascript crib sheet and specified shuffle (shuffle = util.shuffle), but the error persists. I would be happy about any idea why this might happen?
Please could you open the developer tools when you reach this error, and click on the red message with the name of your experiment in the developer panel (see ‘finding the problem’ in the URL shared). That will take you to the exact line in your experiment where this is occurring. If you can share with us the exact code segment causing the issue that will also be helpful so we can figure out how to tackle the issue
This is a screenshot with the loop in it, (because the excel import did not work in javascript, I created two lists, in which I listed all of the stimuli). I reckon that the mistake is somewhere in the for loop, in which the order of the symbols is shuffled.
I’ve just had a look at your experiment and codeInit as imports in the JS (which won’t work) and a syntax error.
Also, in the trials loop, I think you should remove the $ from num_items.
The reason for the error is because your code translations aren’t working. Have a look at my crib sheet (see pinned post) but you will need someone who at least understands the Python code in your experiment.