--- API: 2.1 OpenSesame: 3.2.8b1 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 "/usr/share/opensesame_resources/templates" 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 xpyriment set bidi yes set background black define loop block_loop 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 4 set continuous no set column_order "" set break_if_on_first yes set break_if never setcycle 0 location_plural -320 setcycle 0 location_singular 320 setcycle 1 location_plural 320 setcycle 1 location_singular -320 setcycle 2 location_plural -320 setcycle 2 location_singular 320 setcycle 3 location_plural 320 setcycle 3 location_singular -320 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 reset_feedback always run block_loop always define inline_script define_lists set description "Executes Python code" set _run "" ___prepare__ import random # We need this module to shuffle the lists # Define the two lists of 32 words: list_singular = ["apple", "banana", "book", "script", \ "dog"] list_plural = ["apples", "bananas", "books", "scripts", \ "dogs"] # Shuffle the lists: random.shuffle(list_singular) random.shuffle(list_plural) __end__ define sketchpad end_of_experiment set start_response_interval no set duration keypress set description "A sketchpad notifying the participant that the experiment is finished" 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 any key to exit" x=0 y=0 z_index=0 define sequence experiment set flush_keyboard yes set description "The main sequence of the experiment" run instructions always run define_lists always run experimental_loop always run end_of_experiment 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 feedback feedback set reset_variables yes set duration keypress set description "Provides feedback to the participant" draw textline center=1 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="Your average response time was [avg_rt]ms

Your accuracy was [acc]%

Press any key to continue" x=0 y=0 z_index=0 define inline_script get_words set description "Executes Python code" set _run "" ___prepare__ while True: # Get the next word from the shuffled list: var.word_singular = list_singular.pop() var.word_plural = list_plural.pop() # Check whether the plural is not the plural of the singular word: # (I assumed that the stem is the plural minus the last letter (i.e., the 's'): stem = var.word_plural[:-1] if stem != var.word_singular: break __end__ define sketchpad instructions set start_response_interval no set duration keypress set description "A sketchpad containing the instructions for the participant" 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 any key to begin!" x=0 y=0 z_index=0 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 reset_feedback reset_feedback set description "Resets the feedback variables, such as 'avg_rt' and 'acc'" define sketchpad sketchpad set start_response_interval no set duration 0 set description "Displays stimuli" draw fixdot color=white show_if=always style=default x=0 y=0 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="[word_singular]" x="[location_singular]" y=0 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="[word_plural]" x="[location_plural]" y=0 z_index=0 define sequence trial_sequence set flush_keyboard yes set description "A single trial" run get_words always run sketchpad always run keyboard_response always run logger always