Description of the problem:
OS: Windows 10
PsychoPy version: v2020.1.3
Standard Standalone? If not then what?: Not sure
Problem summary: When an image name is a variable generated in previous code components, the image is not presented (doesn’t appear) when running in Pavlovia, but it works fine when running locally.
What are you trying to achieve?:
I have 60 images in the resources folder. The image names are listed in a CSV file. I want to use code components to determine which image to present in a particular routine.
I first loaded the image names from the CSV file using this JS code:
Then I reordered the images and created a variable “lastFrame” which should contain the name of the image to be presented
I used “$lastFrame” as the image name in an image component
When I run the experiment locally, this presents the desired image. But when pushed to Pavlovia, the image does not appear. There is also no error message popping up or in the browser developer tools console.
What did you try to make it work?:
If I explicitly define the variable “lastFrame” as
lastFrame = "plw_collinear_images/plw_collinear_01.png"
, then the appriopriate image is presented on Pavlovia. I don’t know what’s different in the “lastFrame” variable when it’s generated from the code in the previous screenshots. So to check what’s in the variable when it’s generated by my code (not directly defined as the path to an image), I added a text component to print out the “lastFrame” variable at the same time as the image (like this)
This printed the name of the desired image when running locally. But when running on Pavlovia, it printed “Hello World” on the screen. I have no idea where that came from…
Please help me… Thank you so much for your time!