psychopy.org | Reference | Downloads | Github

"Export HTML" not generating component javascript (?)

Hello,

I’m trying to run an experiment where participants can enter typed information on the screen and have it displayed back to them as they type. The experiment was building normally on both psychopy 3.1.2 and pavlovia; however, when I went to add this new feature, I had to add custom code, which messed things up a bit. My custom code works in psychopy, and I tried to translate it to javascript to run online, but I may have made an error as I’m relatively new to both python and js.

When I try to run the experiment online, it gets stuck at “initializing the experiment…” and when I open the web js console, it shows the message: Failed to load resource: the server responded /cc99/vviq_10-4/html/VVIQ.js:1 with a status of 404 ()

I think this may be due to the fact that the export html feature on psychopy isn’t working properly. As I understand it, when you click “export html” or when you sync the project online, psychopy should generate both html and .js files, whereas it only generates an html file for me, no js.

URL of experiment: https://pavlovia.org/cc99/vviqfinal

Thanks for any and all help!

Jeff

Hi @jeffkravitz, if the export html is not working, it means that somewhere an error occured when trying to create the JS, probably due to a coding issue in your code component.

To help, there is already a working demonstration of presenting user input on screen. You can download the demo, and take a look at the code in the code component.

Demo: https://run.pavlovia.org/demos/textinput/html/
Code: https://gitlab.pavlovia.org/demos/textinput

Hi @dvbridges,

Thanks for your quick response!

That’s actually the demo that I’m working off of, but I’ve had to modify certain things to fit our experiment. I’m not sure how to debug my js code because i’m not sure how to see where the error is in the code if the .js never compiles to begin with…

I’ll attach some screenshots of my modifications:


Would you mind sharing your minimal working example of your script, that does not compile correctly? That way, I can run it and see what errors occur