I have created a demo to illustrate the problem I encountered. The program runs correctly on my local machine, but when published online, it produces an error.
I have uploaded the demo for your review and would greatly appreciate it if you could help me identify and resolve the issue.
OS : Windows 11 Enterprise PsychoPy version: 2024.2.4 Standard Standalone Installation? (y/n) If not then what?: URL of experiment:untitled [PsychoPy] Do you want it to also run locally? No What are you trying to achieve?:
What did you try to make it work?: Try to ask GPT to generate java code, but it still can not work.
What specifically went wrong when you tried that?:
**
Error**
Unfortunately we encountered the following error:
ReferenceError: None is not defined
Try to run the experiment again. If the error persists, contact the experiment designer.
Thank you very much for your help — the experiment can now proceed to the first screen. However, a new issue has appeared:
Error
Unfortunately, we encountered the following error: ReferenceError: clicked_now is not defined
Try to run the experiment again. If the error persists, contact the experiment designer.
Could you please provide some guidance on how to resolve this error?
Did you simplify your experiment by adding text to each button and deleting the text components? You could also remove the ‘right aka continue’ arrow that you currently use to proceed to the next trial, by setting each button to end the routine. Many things that you do with self-written code can be done using all the parameters that the Builder provides for a component.
To check where the ‘clicked_now’ error occurs, press F11 when running the experiment in your browser, open the developer tools, go to the console, and click on the line containing the error.
You use the clicked_now variable in your code component. in the each frame tab. You need to define this variable before using it in an online context. However, see my remark above about using all the parameters provided by the Builder for each component.