Hi, I am trying to run a pilot study via psychopy builder. Basically, I want participants to choose the last frame of the video they saw before using a slider. That is to day, based on their response, the corresponding pictures should update in real-time. The pictures’ format is something like butter_melt0011.jpg. My codes are like this:
I got the error saying couldn’t find the image, and I guess because slider.getRating() returns None, but not the number. What other code should I put here? Should I also include a mouse component to record participants’ response?
Thanks for the reply.
That is the code on code component in psychopy builder. Basically, thisImage is for the image component to find the corresponding image that participants choose depending on their rating.
@JensBoelte suggested that you add a line print(thisImage) to see whether the issue is with the filename.
Since this is online then the issue may be simply that you haven’t added the images in Experiment Settings/Online/Additional Resources. Showing the error message would help with checking this.
Does it work locally?
If you have too many possible frames to want to load them all into memory at the start of the experiment then you may need to use a code component (prepareResources) or a Resource Manager component to load them while the participant is reading the instructions.
Hi,
Thanks for the help. I added print(thisImage) but nothing shows up. My whole procedure is that participants watch a animation and hear a sentence with a cross on the screen, then they move the slider. I tested it locally but not online via Pavlovia yet. It doesn’t work locally. Can I have more information about the prepareResources?