Corsi demo_online_Python to JS_syntax error

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.

Can anyone give me a hand?

Hi There,

Please could you confirm it is this demo that you are using? corsi [PsychoPy]

Thanks,
Becca

Hi, Becca. Yes, I am using this demo.

Hi There,

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.

Thanks,
Becca

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.

Hi @Ramalho would you mind sharing the files you uploaded to Pavlovia as well as your run link to see if I can replicate this error on my end?

Dear @suelynnmah, here is the link to GitHub https://gitlab.pavlovia.org/Ramalho/phd_tests_2

Thanks for your help!

Each experiment (psyexp file) needs to be in a separate Gitlab folder.

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.