Manually defined functions don't work when running experiment online

I think you need to double define your functions because they are not inmediately assigned to the name you geve them in JS. Have a look at this: