Using a variable to set image each repeat

I’m getting the following error when trying to test my paradigm online

  • when setting the image of ImageStim: response_image
  • when getting the value of resource: stimuli/B1_30.png
  • unknown resource

stimuli/B1_30.png is from the variable current_image, created with the following line of code:

current_image = 'stimuli/B1_' + str(currentPos) + '.png'

The image component then has $current_image, set every repeat

Putting the same path directly into an image component finds the image with no problem

Copy your images to html/resources/stimuli locally and resync

Brilliant, that’s working now. Thank you!

1 Like

Cool. Please could you mark my reply as the solution?

I am accounting the same error.

Unfortunately we encountered the following error:

  • when setting the image of ImageStim: image
  • when getting the value of resource: grp1Letter\adlam_10.png
  • unknown resource

Try to run the experiment again. If the error persists, contact the experiment designer.

PS: I have copied the images locally in html\resources\grp1Letter locally, and re-synced. Still the error persists

Using forward slash “/”, instead of backslash “” solved the problem.