64-bit OS (Win10)
PsychoPy version 2021.1.2
Standalone standard? Yea
Doubt:
In my experiment, in each trial, I present 4 images simultaneously and I want my participants to select with the mouse how many images they prefer among the 4. So, I could have a participant who selected 1 images, 2 images, 3 images, 4 images or no image. In case he does not want to select any image, there is an image of a button called “Next”.
The problem is that I wanted the trial to end only when the participant clicked next, but that all the clicks on the images he selected were computed and left on the data output.
In addition, I would like there to be a way of clicking on each image, the image would be detached, with some kind of mask or border that would show the participant that that image was selected when clicking.
I am very amateur in creating codes and I need help in that regard.
So, I would be very grateful if someone could help me with this.
The experiment ran well in Psychopy’s Bilder, but I had a problem when uploading my experiment to Pavlovia. The following message occurred: TypeError: clicked_images.append is not a function
This function is described in a code component as follows:
Each Frame:
for im in images:
if im.clicked == False:
if im.contains (Mouse_1):
im.opacity = 0.5
else:
im.opacity = 1
if Mouse_1.isPressedIn (im):
if im.clicked == False: #if it has not yet been clicked
im.opacity = 0.5
clicked_images.append (im.image)
print (clicked_images)
im.clicked = True
Switch the “Code type” from “auto → JS” to “Both”, so that you can manually edit the generated JavaScript. In that JavaScript, try replacing append with push, which I think is the JavaScript equivalent.