TypeError: Cannot use 'in' operator to search for 'return' in undefined

Hi there,

I’m quite inexperienced with Javascript so have been trying to stick to creating my study in the PsychoPy GUI. I have an experiment where participants hear 4 sound files then answer four questions (2 per screen) - a radio response, slider response, text box entry and another slider response. Participants press the ‘return’ key to continue to the next screen, but I don’t want them to continue until they’ve attempted each question. I’ve added some code elements based on this forum: Don't take key press until slider response is made! - #23 by tkallies

It now works perfectly when I run it through PsychoPy locally but spits out the following message when running online: TypeError: Cannot use ‘in’ operator to search for ‘return’ in undefined.

As I have almost no experience with Javascript, I’ve been finding it a bit difficult to understand where the bits of code should be added in the code elements…

Here is my experiment file:
task.psyexp (84.0 KB)

Thank you for any assistance in advance! And apologies for my naivety!

The code components should have an “auto->JS” mode in the drop-down at the top, and you should use that. “in” does not exist in JavaScript, but the auto-converter creates something equivalent for you (otherwise it’s something of a hassle).