--- API: 2.1 OpenSesame: 3.3.6a4 Platform: posix --- set width 1024 set uniform_coordinates yes set title "Extended template" set subject_parity even set subject_nr 0 set start experiment set sound_sample_size -16 set sound_freq 48000 set sound_channels 2 set sound_buf_size 1024 set sampler_backend psycho set round_decimals 2 set mouse_backend psycho set keyboard_backend psycho set height 768 set fullscreen no set form_clicks no set foreground white set font_underline no set font_size 18 set font_italic no set font_family mono set font_bold no set experiment_path "/home/lotje/Documents/Research, teaching and programming/OpenSesame/Scripts/Others/Andre Keizer/questionnaire" set disable_garbage_collection yes set description "A template containing a practice and an experimental phase" set coordinates uniform set compensation 0 set color_backend psycho set clock_backend psycho set canvas_backend psycho set bidi yes set background black define loop block_loop set source_file "" set source table set skip 0 set repeat 1 set order sequential set offset no set item trial_sequence set description "A single block of trials" set cycles 3 set continuous no set column_order "" set break_if_on_first yes set break_if never setcycle 0 question "What is your favorite pet" setcycle 0 y1 0 setcycle 0 y2 75 setcycle 0 y3 150 setcycle 0 r1 cat setcycle 0 r2 dog setcycle 0 r3 bunny setcycle 0 r4 hamster setcycle 0 r5 other setcycle 0 y4 225 setcycle 0 y5 300 setcycle 0 title "Online questionnaire" setcycle 0 x1 -352 setcycle 0 x2 -352 setcycle 0 x3 -352 setcycle 0 x4 -352 setcycle 0 x5 -352 setcycle 1 question "I really like programming" setcycle 1 y1 0 setcycle 1 y2 75 setcycle 1 y3 150 setcycle 1 r1 "Completely disagree" setcycle 1 r2 Disagree setcycle 1 r3 Neutral setcycle 1 r4 Agree setcycle 1 r5 "Completely agree" setcycle 1 y4 225 setcycle 1 y5 300 setcycle 1 title "Online questionnaire" setcycle 1 x1 -352 setcycle 1 x2 -352 setcycle 1 x3 -352 setcycle 1 x4 -352 setcycle 1 x5 -352 setcycle 2 question "How often did you use OSWeb?" setcycle 2 y1 0 setcycle 2 y2 75 setcycle 2 y3 150 setcycle 2 r1 never setcycle 2 r2 once setcycle 2 r3 "fewer than three times" setcycle 2 r4 "fewer than six times" setcycle 2 r5 "seven times or more" setcycle 2 y4 225 setcycle 2 y5 300 setcycle 2 title "Online questionnaire" setcycle 2 x1 -352 setcycle 2 x2 -352 setcycle 2 x3 -352 setcycle 2 x4 -352 setcycle 2 x5 -352 run trial_sequence define sequence block_sequence set flush_keyboard yes set description "A sequence containing a single block of trials followed by feedback to the participant" run block_loop always define sequence experiment set flush_keyboard yes set description "The main sequence of the experiment" run experimental_loop always define loop experimental_loop set source_file "" set source table set skip 0 set repeat 1 set order sequential set offset no set item block_sequence set description "A loop containing one or more experimental blocks" set cycles 1 set continuous no set column_order practice set break_if_on_first yes set break_if never setcycle 0 x_continue_box 160 setcycle 0 width_continue_box 256 setcycle 0 y_continue_box 288 setcycle 0 height_continue_box 60 run block_sequence define loop get_response_loop set source_file "" set source table set repeat 1 set order random set description "Repeatedly runs another item" set cycles 1 set continuous no set break_if_on_first yes set break_if never setcycle 0 empty_column "" run get_response_sequence define sequence get_response_sequence set flush_keyboard yes set description "Runs a number of items in sequence" run mouse_response always run js_determine_my_cursor_roi always run js_determine_response always run js_determine_cursor_continue_button always run show_response_500ms "[continue_roi_ticked] = yes and [my_cursor_roi_ticked] = yes" run show_response_0ms "[continue_roi_ticked] = no or [my_cursor_roi_ticked] = no" run new_repeat_cycle always define inline_javascript js_determine_cursor_continue_button set description "Executes JavaScript code (ECMA 5.1)" ___run__ let _x = vars.x_continue_box let _y = vars.y_continue_box let _w = vars.width_continue_box let _h = vars.height_continue_box if (vars.my_cursor_roi_ticked != "no"){ if ( vars.cursor_x >= _x & vars.cursor_x < _x + _w & vars.cursor_y >= _y & vars.cursor_y < _y + _h ){ vars.continue_roi_ticked = "yes" } } console.log("continue_roi_ticked = " + vars.continue_roi_ticked) console.log("my_cursor_roi_ticked = " + vars.my_cursor_roi_ticked) __end__ set _prepare "" define inline_javascript js_determine_my_cursor_roi set description "Executes JavaScript code (ECMA 5.1)" ___run__ let roi let x let y let w = 32 let h = 32 for (roi = 1; roi <= 5; roi++) { y = vars['y' + roi] x = vars['x' + roi] if ( vars.cursor_x >= x & vars.cursor_x < x + w & vars.cursor_y >= y & vars.cursor_y < y + h ) { vars.my_cursor_roi = 'box' + roi } } if (vars.my_cursor_roi != 0) { vars.my_cursor_roi_ticked = "yes" } __end__ set _prepare "" define inline_javascript js_determine_response set description "Executes JavaScript code (ECMA 5.1)" ___run__ // Determine the text corresponding to the selected button: let counter for (counter = 1; counter <= 5; counter++) { if (vars.my_cursor_roi === "box" + counter){ vars.clicked_response = vars["r" + counter] } } console.log(vars.clicked_response) __end__ set _prepare "" define inline_javascript js_set_rois set description "Executes JavaScript code (ECMA 5.1)" set _run "" ___prepare__ vars.continue_roi_ticked = "no" vars.my_cursor_roi_ticked = "no" vars.my_cursor_roi = 0 __end__ define logger logger set description "Logs experimental data" set auto_log no log subject_nr log question log clicked_response log questionnaire log my_cursor_roi define mouse_response mouse_response set timeout infinite set show_cursor yes set linked_sketchpad "" set flush yes set event_type mouseclick set duration mouseclick set description "Collects mouse responses" define repeat_cycle new_repeat_cycle set description "Optionally repeat a cycle from a loop" set condition "[continue_roi_ticked] = no or [my_cursor_roi_ticked] = no" define feedback show_response_0ms set start_response_interval no set reset_variables yes set duration 0 set description "Displays stimuli" draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[title]" x=0 y=-224 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[question]" x=0 y=-128 z_index=0 draw rect color=white fill=0 h=32 name=box1 penwidth=1 show_if=always w=32 x=-352 y="[y1]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[r1]" x=-260 y="[y1]" z_index=0 draw rect color=white fill=0 h=32 name=box2 penwidth=1 show_if=always w=32 x=-352 y="[y2]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[r2]" x=-260 y="[y2]" z_index=0 draw rect color=white fill=0 h=32 name=box3 penwidth=1 show_if="[r3]!=None" w=32 x=-352 y="[y3]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r3]!=None" text="[r3]" x=-260 y="[y3]" z_index=0 draw rect color=white fill=0 h=32 name=box4 penwidth=1 show_if="[r4]!=None" w=32 x=-352 y="[y4]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r4]!=None" text="[r4]" x=-260 y="[y4]" z_index=0 draw rect color=white fill=0 h=32 name=box5 penwidth=1 show_if="[r5]!=None" w=32 x=-352 y="[y5]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r5]!=None" text="[r5]" x=-260 y="[y5]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box1" w=32 x="[x1]" y="[y1]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box2" w=32 x="[x2]" y="[y2]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box3" w=32 x="[x3]" y="[y3]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box4" w=32 x="[x4]" y="[y4]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box5" w=32 x="[x5]" y="[y5]" z_index=0 draw rect color=white fill=0 h="[height_continue_box]" penwidth=1 show_if="[continue_roi_ticked] = no" w="[width_continue_box]" x="[x_continue_box]" y="[y_continue_box]" z_index=0 draw rect color=gray fill=1 h="[height_continue_box]" penwidth=1 show_if="[continue_roi_ticked] = yes" w="[width_continue_box]" x="[x_continue_box]" y="[y_continue_box]" 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=continue x=288 y=320 z_index=0 define feedback show_response_500ms set start_response_interval no set reset_variables yes set duration 500 set description "Displays stimuli" draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[title]" x=0 y=-224 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[question]" x=0 y=-128 z_index=0 draw rect color=white fill=0 h=32 name=box1 penwidth=1 show_if=always w=32 x=-352 y="[y1]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[r1]" x=-260 y="[y1]" z_index=0 draw rect color=white fill=0 h=32 name=box2 penwidth=1 show_if=always w=32 x=-352 y="[y2]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[r2]" x=-260 y="[y2]" z_index=0 draw rect color=white fill=0 h=32 name=box3 penwidth=1 show_if="[r3]!=None" w=32 x=-352 y="[y3]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r3]!=None" text="[r3]" x=-260 y="[y3]" z_index=0 draw rect color=white fill=0 h=32 name=box4 penwidth=1 show_if="[r4]!=None" w=32 x=-352 y="[y4]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r4]!=None" text="[r4]" x=-260 y="[y4]" z_index=0 draw rect color=white fill=0 h=32 name=box5 penwidth=1 show_if="[r5]!=None" w=32 x=-352 y="[y5]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r5]!=None" text="[r5]" x=-260 y="[y5]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box1" w=32 x="[x1]" y="[y1]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box2" w=32 x="[x2]" y="[y2]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box3" w=32 x="[x3]" y="[y3]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box4" w=32 x="[x4]" y="[y4]" z_index=0 draw rect color=white fill=1 h=32 penwidth=1 show_if="[my_cursor_roi]=box5" w=32 x="[x5]" y="[y5]" z_index=0 draw rect color=white fill=0 h="[height_continue_box]" penwidth=1 show_if="[continue_roi_ticked] = no" w="[width_continue_box]" x="[x_continue_box]" y="[y_continue_box]" z_index=0 draw rect color=gray fill=1 h="[height_continue_box]" penwidth=1 show_if="[continue_roi_ticked] = yes" w="[width_continue_box]" x="[x_continue_box]" y="[y_continue_box]" 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=continue x=288 y=320 z_index=0 define sketchpad sketchpad set start_response_interval no set duration 0 set description "Displays stimuli" draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[title]" x=0 y=-224 z_index=0 draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[question]" x=0 y=-128 z_index=0 draw rect color=white fill=0 h=32 name=box1 penwidth=1 show_if=always w=32 x=-352 y="[y1]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[r1]" x=-260 y="[y1]" z_index=0 draw rect color=white fill=0 h=32 name=box2 penwidth=1 show_if=always w=32 x=-352 y="[y2]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="[r2]" x=-260 y="[y2]" z_index=0 draw rect color=white fill=0 h=32 name=box3 penwidth=1 show_if="[r3]!=None" w=32 x=-352 y="[y3]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r3]!=None" text="[r3]" x=-260 y="[y3]" z_index=0 draw rect color=white fill=0 h=32 name=box4 penwidth=1 show_if="[r4]!=None" w=32 x=-352 y="[y4]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r4]!=None" text="[r4]" x=-260 y="[y4]" z_index=0 draw rect color=white fill=0 h=32 name=box5 penwidth=1 show_if="[r5]!=None" w=32 x=-352 y="[y5]" z_index=0 draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if="[r5]!=None" text="[r5]" x=-260 y="[y5]" z_index=0 draw rect color=white fill=0 h="[height_continue_box]" penwidth=1 show_if=always w="[width_continue_box]" x="[x_continue_box]" y="[y_continue_box]" 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=continue x=288 y=320 z_index=0 define sequence trial_sequence set flush_keyboard yes set description "Runs a number of items in sequence" run sketchpad always run js_set_rois always run get_response_loop always run logger always