Hello! I’m trying to translate the python custom code to JS for my experiment. somehow the variable stimposition (see the image below) is undefined whenever I run the experiment online. I have replaced the python index() with indexOf() for JS but that still did not work. What is wrong with this code?
Hey @thuy, like stim.text
and stim.color
you could try setting a position property on the stim
object using stim.position = ...
or declare stimposition
using e.g. let stimposition = ...
Thank you! Your comment reminded me to check how stimposition was defined in the JS. I just realized that stimposition is actually a variable, and it was not properly translated as a new var in the JS.
No problem, happy coding