Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Variables storing problem in inline_javascript

Hello,

due to COVID19 outbreak, I would like to run my experiment online. So, I am translating from python to js some inline objects. Unfortunately, I am having some troubles with variables storing: despite I have defined my variable (vars.target_orientation = myvalue), the debug window give me this error "The variable 'target_orientation' does not exist. Tip: Use the variable inspector (Ctrl+I) to see all variables.".

I am currently using the last version of Opensesame (3.3.5).


I can't figure out what I am doing wrong.

Any suggestions are more than welcome.

My script is:

//Set target orientation variable. 1 = right, 2 = left
vars.target_orientation = Math.round(Math.random())+1
vars.target_image = 't'+String(target_orientation)

//Set fillers orientation variable. 1 = horizontal, 2 = vertical
vars.filler1_orientation = Math.round(Math.random())+1
vars.filler1_image = '1f'+String(filler1_orientation)

vars.filler2_orientation = Math.round(Math.random())+1
vars.filler2_image = '2f'+String(filler2_orientation)

vars.filler3_orientation = Math.round(Math.random())+1
vars.filler3_image = '3f'+String(filler3_orientation)

Thank you.

Comments

  • Hi Elle,

    Can you provide more info on how your experiment is built up? The inlinescripts themselves look fine, but maybe they are not put at the right location in the script (e.g. keyword prepare-run strategy). If you could upload your experiment, we can try to track down the problem.

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.