So your task was running perfectly offline, then you pushed it online, and it doesn’t work - why? There are lot’s of reasons something might not work online, but the most common errors are coding errors.
The PsychoJS library doesn’t yet contain everything in PsychoPy, for several reasons:
When we add code components we have the choice to add code as either:
The last option is very cool and useful - but it can catch people out if something doesn’t translate smoothly!
The forum is always there!
Still relevant to 2021.2.2
Even though we’ve improved the transpiler, we can’t expect to transpile whole python libraies (e.g. numpy). So if you are using specific functions you will need to find the JS equivilent and add that to your experiment. We might also need to change code type to “Both” and make sure to use the new method (average) instead of refering to
Sometimes you might not get an error message, but things “don’t work” - what do we do here?
you can open developer tools in your browser (the crib sheet) gives tips how to do this on different browsers/operating systems) This will tell us where our (which line) error is occuring
We can then open up our JS file and take a look further.
There are several other tools that can be useful including:
Let’s practice debugging errors, then play with advanced plugins we can use online ( Advanced online).
Then we will try Coding a full experiment.