Creating a checkbox in Sketchpad
Good evening,
I asked a question a few days ago, that was answered by sebastiann (cheers!), in regards to text_input. He's pointed me in the direction of creating a form equivalent using the sketchpad and the mouse_response; but I'm abit stuck.
I'm trying to determine which "checkbox" the user has clicked on but am unsure how to capture this or how to set the visual feedback for.
Here's what I have so far:
And the definition of the sketchpad, so far:
set duration keypress set description "Displays stimuli" draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=25 html=yes show_if=always text="Participant Details" x=0 y=-320 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=25 html=yes show_if=always text="Gender:" x=-320 y=-256 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=25 html=yes show_if=always text="Date of Birth:" x=-320 y=-160 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=25 html=yes show_if=always text="PI Number:" x=-320 y=-64 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=25 html=yes show_if=always text=Male x=-96 y=-256 z_index=0 draw rect color=white fill=0 h=32 name="[male]" penwidth=1 show_if=always w=32 x=-32 y=-266 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=25 html=yes show_if=always text=Female x=96 y=-256 z_index=0 draw rect color=white fill=0 h=32 name=female penwidth=1 show_if=always w=32 x=192 y=-266 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=25 html=yes show_if=always text=Other x=320 y=-256 z_index=0 draw rect color=white fill=0 h=32 name=other penwidth=1 show_if=always w=32 x=384 y=-266 z_index=0
So I'm trying to just assign each box to it's equivalent variable and provide some visual feedback.
Thanks
Comments
Hi,
Are you using the mousetrap plugin? WIth that one, you can draw rectangles (your checkboxes), and assign a response to each of them. That makes handling the responses much easier:
See here: https://osdoc.cogsci.nl/3.2/manual/mousetracking/
Does that help?
Eduard
Evening Eduard.
Turned out I didn't need to try to make the experiment work for the web so I abandoned this.
Thanks anyway though.