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:
Does a component “make sense” online? e.g. Grating stimuli require a luminance calibrated monitor. Does your participant have a photometer at home?
PsychoJS is younger than PsychoPy!
When we add code components we have the choice to add code as either:
Py - pure Python
The last option is very cool and useful - but it can catch people out if something doesn’t translate smoothly!
Always check the status of online options status of online options before making your experiment
Push your experiment little and often (don’t make your full experiment perfectly locally and then try to push it online)
Read the crib sheet
Check out the psychoJS documentation
Update to the latest release! Version 2021.2. improved transpiling alot and you can save alot of manual debugging online using that version.
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:
Counterbalancing online using sequential participant IDs
Scaling your screen (e.g. so that we can use cm units online).
Headphone checkers using huggins pitch (e.g. so that we can use cm units online).
Eyetracking online using the webgazer library. Note that in 2021.2.2 there is a different way of loading resources
The assignment we will complete! (fork the task then find the bugs…)