Hi everyone! I’m a new user, am trying to upload an experiment to Pavlovia and am seeing the same error as reported above. I am going to document this to the best of my ability below, so this will be quite a long and verbose error report. But am desperate for help so would LOVE anybody’s insight into this.
Ok. Running PsychoPy v2021.2.3 locally on a Mac (OsX Sierra, 10.12.6). I have built my experiment using builder and then dropped a little bit of custom code in two routines with the Auto->JS set.
The code itself (very similar code in two different routines - for validating input before making the ‘continue’ button visible and changing the colour of polygons on mouse clicks) is making the experiment fall over. I have tried removing the code and re-uploading - and the experiment runs. BUT… all the procedures I have learnt in my recent 3 day workshop and following all the documentation I can find - has not helped me isolate the error. In fact to me it looks like some wierd very low level general kind of thing with constructors of generic objects or something. Hmmm…
Ok. Here are the deets.
Url: DPCLnPhishingVal 01 [PsychoPy]
Error message:
Using inspect, I see the console details the following errors:
The sources tab then reveals the following sections of code:
I cannot for the life of me work out what I am supposed to do to fix this.
I will include the code snippets I am using in the routine to provoke this error. I don’t think I’m doing anything particularly fancy here - EXCEPT I am a creating an object (my continue button) programatically and then referring to it using the Mouse component (sequentially below the code component).
BEGIN ROUTINE:
ContinueButton_Y = visual.ButtonStim(win,
text='Continue', font='Arial',
pos=(.6, -.4),
letterHeight=0.05,
size=[.25, .1], borderWidth=0.0,
fillColor='darkgrey', borderColor=None,
color='white', colorSpace='rgb',
opacity=None,
bold=False, italic=False,
padding=None,
anchor='center',
name='ContinueButton_5'
)
ContinueButton_Y.setAutoDraw(False)
#Flags for revealing continue button
ContButton=False
HaveVal=False
# RADIO BUTTONS COLOUR CHANGE
boxlist = [YesCheckbox,NoCheckbox]
# initialize the boxes
for box in boxlist:
box.selected = False # assign a custom attribute to say if this box is currently selected
box.fillColor = 'lightgray' # reset the color
# control the allowed timing intervals of click events
clickInterval = 0.2 #time between clicks (prevents very fast clicking on and off)
lastClickTime = 0
And then in EACH FRAME:
# RADIO BUTTONS COLOUR CHANGE
if mouse_4.isPressedIn(YesCheckbox):
if t > lastClickTime + clickInterval: # Debounce
YesCheckbox.selected = True
NoCheckbox.selected = False
print("Clicked in box 1")
HaveVal = True
if mouse_4.isPressedIn(NoCheckbox):
if t > lastClickTime + clickInterval: # Debounce
NoCheckbox.selected = True
YesCheckbox.selected = False
print("Clicked in box 2")
HaveVal = True
# set the color of clicked and non clicked boxes
for box in boxlist:
if box.selected:
box.fillColor = 'green'
else:
box.fillColor = 'lightGray'
if HaveVal and not ContButton:
print("MAKE BUTTON!")
ContinueButton_Y.setAutoDraw(True)
ContButton=True
END ROUTINE:
ContinueButton_Y.setAutoDraw(False)
Note my mouse object is set to end routine on ‘Valid Click’ on ‘Clickable Stimuli’: ContinueButton_Y
I am utterly stumped and don’t know how to move forward with this.
Any help or advice would be WILDLY appreciated. <3
Thanks folks!
Dan.