Howdy, Stranger!

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

Supported by

is it possible to draw stimuli with OSweb?

Hey guys!

I want to create an experiment where participants have to recreate simple visual stimuli from memory. I'm thinking a drag and drop style test. Participants can select shapes drag them to the intended location and then cycle through some colors by repeatedly right clicking on the shape.

However I cant seem to find a method to draw on the surfaces OSweb creates. Any help would be appreciated!

Comments

  • Hi @reichardtr ,

    In OSWeb, you cannot draw things programmatically onto a Canvas object in the same way that you can do that with a Python script in regular OpenSesame. However, what you can do, and what works ok in many situations, is to define sketchpad items in terms of variables, and then using inline_javascript items to manipulate these variables.

    To be a bit more specific, say that you initially show a sketchpad with stimuli that the participant can select by clicking on them. This is then followed by a mouse_response that registers the location of a mouse click. Based on the variables cursor_x and cursor_y you can then deduce which stimulus the participant clicked on, with some simple logic in an inline_javascript item, and assign this to, say, a variable called selected_stimulus . Next, you collect another mouse click with another mouse_response , and then finally show a feedback item that uses the variables cursor_x , cursor_y , and selected_stimulus to draw the selected stimulus on the location that the participant clicked on. That's a crude form of drag-and-drop, basically.

    Hope this helps!

    — Sebastiaan

  • Hi Sebastiaan,

    great idea, thank you! I am almost done with the task now, seems to work perfectly.

    All the best,

    Richard

Sign In or Register to comment.