--- API: 2.1 OpenSesame: 3.3.8a1 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 round_decimals 2 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/Downloads" set disable_garbage_collection yes set description "A template containing a practice and an experimental phase" set coordinates uniform set compensation 0 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 random set offset no set item trial_sequence set description "A single block of trials" set cycles 2 set continuous no set column_order "" set break_if_on_first yes set break_if never setcycle 0 text word1 setcycle 1 text word2 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 inline_script define_lists_of_coordinates set description "Executes Python code" set _run "" ___prepare__ # Import the library numpy import numpy as np # Define properties of the list of x and y positions: # (By preceeding the variable names with the .var # notation, we make sure that they are recognized in the interface # and logged by the logger item) var.x_start = 0 # first x coordinate var.x_end = 300 # last x coordinate var.y_start = 0 var.y_end = 300 # Define the number of steps # The higher, the smoother, but also # the higher, the slower # (Max is the length of the lists of coordinates) var.n_steps = 100 # Define list of x positions by using the np # function linspace() list_x_pos = list(np.linspace(var.x_start, var.x_end, var.n_steps)) # List of y positions: list_y_pos = list(np.linspace(var.y_start, var.y_end, var.n_steps)) # Reverse the lists # (So that we can use the pop() function in the trial sequence) list_x_pos = list_x_pos[::-1] list_y_pos = list_y_pos[::-1] __end__ 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 random 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 practice no run block_sequence define sketchpad final_sketchpad 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="Press a key to continue" x=0 y=0 z_index=0 define inline_script get_coordinates set description "Executes Python code" set _run "" ___prepare__ var.x_pos = list_x_pos.pop() var.y_pos = list_y_pos.pop() __end__ define keyboard_response keyboard_response set timeout infinite set flush yes set event_type keypress set duration keypress set description "Collects keyboard responses" define logger logger set description "Logs experimental data" set auto_log yes define loop move_loop set source_file "" set source table set repeat "[n_steps]" set order sequential 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 move_sequence define sequence move_sequence set flush_keyboard yes set description "Runs a number of items in sequence" run get_coordinates always run sketchpad always 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="[text]" x="[x_pos]" y="[y_pos]" z_index=0 define sequence trial_sequence set flush_keyboard yes set description "A single trial" run define_lists_of_coordinates always run move_loop always run final_sketchpad always run keyboard_response always run logger always