I have been having problems getting my experiment online to pavlovia after I managed to get it running smoothly locally on my laptop.
I have tried quite a few different things, so imagine it is probably something to do with the code element I added in the main trials but I can’t figure which element it is. I am not that familiar with psychopy and the different types of code.
When I have piloted the experiment through pavlovia it does show an initialising screen but then it goes straight to an ‘Unspecified JavaScript Error’. When I open up the help screen it shows me this:
null - window.onerror @ core-2020.2.js:1846
FATAL unknown | null - BrowserConsoleAppender.append @ log4javascript.min.js:1
Unchecked runtime.lastError: The message port closed before a response was received.
I have linked my experiment at the start, please let me know if you are not able to see this. Any advice would be really gratefully recieved.
I have tried this and I am still getting an error. However, I uploaded the experiment without my code component and it worked (apart from what the code controlled of course - changing opacity, colour of polygons and click number and time). I then put the code back in and just ‘hashed out’ the JS side of the code and this stopped it working again. I am quite confused by this! Is there anything you can see in my code that would cause this?
Thank you so much, I really appreciate it.
The code in my begin routine box is:
myStimuli = [A_resp, B_resp, C_resp, D_resp]
clickCount = 0
for thisStim in myStimuli:
thisStim.clicked = False
The code in my each fram routine is:
myStimuli = [A_resp, B_resp, C_resp, D_resp]
for thisStim in myStimuli:
if mouse.isPressedIn (thisStim) and thisStim.clicked == False:
thisStim.clicked = True
clickCount += 1
Hashing doesn’t comment out JavaScript, so that won’t work. Equally, you get an error if you have an auto code tab where all of the Python is hashed out.
I don’t know about thisStime.clicked=False
However, I do know that auto translate doesn’t work for colours.
Have a look at my crib sheet (see pinned post) to see how to define black and white in a both code component. Then try thisStim.fillColor = black (without quotes).
I notice you have a reference in your crib sheet to something that might be relevant: for i, j in enumerate(distList[‘list’]): - is this a similar issue?
Essentially, the code needs to check if two of four polygons have been clicked on (they change after each click).
I think the problem might be with my polygons (A_resp, B_resp, C_resp, D_resp) and how i’ve included them in my code becasue when I substituted the polygons with an image in the code I didn’t get an error online. It all worked (apart from the changing colour on click componenet).
What would you advise the best way is to define and incorperate clickable polygon stimuli in JS code so it works online?