Description of the problem:
Hi,
I’m a bit of a coding novice and a relative newbie to PsychoPy! Just wondered if anyone could help with this. One of my students has written a Corsi Block Tapping Test in Psychopy and has asked me to host it on Pavlovia. The script works fine on my computer but as soon as I host it online and access it from the URL I get the above error.
Can anybody explain in layman’s terms how I would go about fixing this please? Any advice would be most welcome!
Cheers
Rich
This means that when the experiment is run online it can’t find the variable ‘doingResponse_4’
Could you tell us a bit more about what this component is in your experiment? (e.g. is it a key press or a variable? also if you are able to share the URL to the project with us that can help us see what you are seeing from your experiment page click > View code> settings (cog on left panel) > permissions > set to public > share that URL with us
Thanks so much Becca! As far as I can see it refers to a mouse click, and it’s in Practice_Trial… I checked out the Code Component for it and changed the Code Type from ‘Both’ to ‘Auto->JS’ and that has got rid of that error. However I get another one about * ReferenceError: nextSwitch_4 is not defined now. Anyway, I’ve followed your advice and made the URL publicly accessible, I told you I was a noob haha!
Many thanks and best wishes
Rich
This shows you that there is an error in python script. Therefore, your python script cannot be auto-translated to JS.
Try to delete one line after the other to identify the line that causes the syntax error. Any specific reason why you import the libraries scipy and numpy? If you plan to run the experiment online, you do not need to import these (see here).
Thanks very much for the reply Jens, I’ve removed the import Scipy and Numpy as you suggested, and i’ve also followed your advice regarded deleting each line until the syntax error disappeared. That’s narrowed it down to this section:
for label, block in blocks_4.items():
block.pos = random(2)*0.8-0.4
blockCoords_4.append(block.pos)
dist_4 = scipy.spatial.distance.pdist(blockCoords_4)
block.color = ‘white’
Any advice from here at all? Coding definitely isn’t my strong suit so any help you can give would be very much appreciated! Thanks for your time
Rich
Thanks for the extra advice Jens, sorry if this is a dumb question but what would I enter instead. I can see that blocks_4 refers to this in the script: