URL of experiment: Pavlovia
I’m having some problems with using functions. I haven’t used these before in Psychopy so am wondering if they are reliable and ok – or what it is that I’m doing wrong. Have checked the crib sheets and forums etc…
It would appear that if I define a function in ‘begin routine’ tab – it works fine locally, but then crashes when I try to run it online.
This functions as intended and prints ‘Hello World’ to runner. But when I upload this to Pavlovia and attempt to run it I get:
So searching around in the forums for this issue I come across this post: JS function not recognised
Where @wakecarter suggests putting your functions in the ‘Before Experiment’ tab. Ok. Let’s give that a go. But, unfortunately, now a different problem emerges.
Whenever I try to Sync my experiment, Psychopy crashes out. Here’s the crash report I get:
Note, this particular crash is 100% reproducible by copying the same function definition into the ‘Before Experiment’ tab (see below). If I delete it here, Psychopy will sync just fine.
Any ideas or workarounds for this? I just wanna build a little function to clean up my code.