Howdy, Stranger!

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

Supported by

Run if statements not working

edited May 2020 in OSWeb

In my experiment, participants get assigned one of three shapes, and then see a screen in which they have to click which shape was assigned to them. Based on the cursor_roi of a mouseclick, participants should see either a screen saying that they clicked on the right shape or a screen saying they clicked on the wrong shape. This works perfectly fine when running this in OpenSesame, but once I run it in my browser using OSWeb, I always see the screen saying it's incorrect. I'm assuming this is because the run-if statements don't work. I've had a similar issue and fixed it by using a JS inline, but for this issue I'm not sure how to fix it.

My run-if statements currently are:

correct_screen: run if [cursor_roi]=[you]

incorrect_screen: run if [cursor_roi]!=[you]

[you] is the variable that holds the name of the correct shape; the elements on the linked sketchpad are named according to their shapes. 

I tried solving this by adding a JS inline script with the following code:

if (vars.cursor_roi === vars.you){

    vars.correct_resp = 1

} else if (vars.cursor_roi !== vars.you){

    vars.correct_resp = 0

}

And then I've set the run-if statements like this:

correct_screen: run if [correct_resp]=1

incorrect_screen: run if [correct_resp]=0

but this hasn't solved the issue. Any ideas?

Comments

  • Figured out that this is just impossible in OSWeb since it does not support linked sketchpads and thus I cannot check what the cursor_roi was!

Sign In or Register to comment.