Description of the problem:
I am using a demo of a Corsi task. When running online it says that nextSwitch is not defined. Python was not translated to JS automatically ( and I have no clue how to do it). I used online resources to check the python syntax and they didn’t find any problem. However, an online JS translator found an issue with for in line 16.
Sorry I am having trouble replicating this error - the demo seems to run ok for me. Is it the case that the error occurs when you click and run this link? corsi [PsychoPy] if so what operating system and browser are you using?
It looks like the code component in your version is “Auto->JS” wherar the code type in the demo is “Both” with different code typed both sides. The syntax error occurs because the python used here does not transpile automatically, so custom JS was used on the right hand side in the demo.
Dear Becca,
The demo is running fine in Psychopy, but after being uploaded to Pavlovia, whenever I try to run it it gives me this error. The browser I am using is Chrome and the OS is Windows 10.
Yes if you follow Wake’s suggestion and just upload your corsi task, it should hopefully work because as far as I could tell, you have not made any changes to the actual task itself.
I thought my experiment was automatically in a separate folder. It contains several routines. Or do you mean that I should create a folder only for a psyexp file?
An experiment folder should have one psyexp file, but may also have a py file, two js files, plus spreadsheets and any other resources (some of which may be in sub folders). You shouldn’t be able to see “routines” when viewing a folder. They are contained within the experiment and viewable in Builder.