Problem accessing the cursor_x variable
I would like to make a simple Corsi block design, in which blocks first flash in a pattern, and then the participant clicks on them to replicate the order. I would ultimately like to convert the script to OSWeb. I would also like to make the blocks flash with a color when clicked, as feedback to the participant.
Since all of my blocks are on the same y-axis, I thought I could achieve this by using the cursor_x variable as a runif conditional in sequence element. But I get the error File "<conditional statement>", line 1, in <module> NameError: name cursor_x is not defined
I imagine my problem is related to the one described in this post, but the solutions there don't seem to work for me. I can see in the variable inspector that mouse clicks are being registered for cursor_x, so I can't figure out why I can't use that information. I have tried pre-defining cursor_x using a javascript block, but that didn't help. I have also tried handling the conditionals using a java-script block, but that doesn't work either. The message is always the same: that cursor_x is undefined. Help, anyone?? A sample experiment is attached.
/Ethan

Comments
Hi @ethanweed ,
This is because you are using
sketchpaditems, which are prepared in thepreparephase of your experiment. At this point, the x and y positions of the (first) mouse click do not yet exist. When usingfeedbackitems instead (which are prepared only in therunphase of the experiment) the "cursor_x is undefined message" should disappear. Could you tru?See also:
Cheers,
Lotje
Did you like my answer? Feel free to

Thank you Lotje, that fixed it!
Now I have other issues, but I'll try to fix those myself first ;-)
/Ethan