Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generated by OpenSesame 0.27.3 (Frisky Freud)
- # Fri Aug 30 12:27:14 2013 (posix)
- # <http://www.cogsci.nl/opensesame>
- set foreground "white"
- set subject_parity "even"
- set description "A template containing a practice and an experimental phase"
- set title "Extended template"
- set compensation "0"
- set coordinates "relative"
- set height "768"
- set mouse_backend "xpyriment"
- set width "1024"
- set sampler_backend "legacy"
- set keyboard_backend "legacy"
- set background "black"
- set subject_nr "0"
- set canvas_backend "xpyriment"
- set start "experiment"
- set synth_backend "legacy"
- define loop block_loop
- set repeat "1"
- set description "A single block of trials"
- set item "trial_sequence"
- set column_order ""
- set cycles "8"
- set order "random"
- run trial_sequence
- define sequence experiment
- set flush_keyboard "yes"
- set description "The main sequence of the experiment"
- run experimental_loop "always"
- define sequence trial_sequence
- set flush_keyboard "yes"
- set description "A single trial"
- run declare_trial_vars "always"
- run show_trial_vars "always"
- run keyboard_response "always"
- run logger "always"
- define loop experimental_loop
- set repeat "1"
- set description "A loop containing one or more experimental blocks"
- set item "block_sequence"
- set column_order "practice"
- set cycles "1"
- set order "random"
- setcycle 0 practice "no"
- run block_sequence
- define keyboard_response keyboard_response
- set description "Collects keyboard responses"
- set timeout "infinite"
- set flush "yes"
- define inline_script declare_lists
- set _run ""
- ___prepare__
- # Your code:
- agency = [1,1,1,1,2,2,2,2]
- val = [1,1,2,2,1,1,2,2]
- names = [1,2,3,4,5,6,7,8]
- import random
- random.shuffle(names)
- # Make lists global such that they are available
- # in future inline_script items as well:
- global agency, val, names
- __end__
- set description "Executes Python code"
- define logger logger
- set description "Logs experimental data"
- define sketchpad show_trial_vars
- set duration "0"
- set description "Displays stimuli"
- draw textline 0 -256 "Agency current trial = [trial_ag]" center=1 color=white font_family="mono" font_size=18 font_italic=no font_bold=no show_if="always"
- draw textline 0 -100 "Valency current trial = [trial_val]" center=1 color=white font_family="mono" font_size=18 font_italic=no font_bold=no show_if="always"
- draw textline 0 100 "Picture current trial = [trial_name]" center=1 color=white font_family="mono" font_size=18 font_italic=no font_bold=no show_if="always"
- define inline_script declare_trial_vars
- set _run ""
- ___prepare__
- # Declare the variables of the current trial,
- # which is equivalent to readng trial
- # variables from the loop item.
- # We use the pop() function to draw one item from
- # the previously-defined lists. 'Popping' means that
- # the item is drawn without replacement.
- # Note that the pop() function starts drawing
- # items from the END of the lists, so we start
- # with agency = 2 and val = 2.
- # Simply re-order the lists in 'declare_lists'
- # to change this.
- trial_ag = agency.pop()
- trial_val = val.pop()
- trial_name = names.pop()
- # Finally, we SET the trial variables
- # for future use in the interface (e.g. a sketchpad
- # item, the logger item, etc. - see 'show_trial_vars'
- # for an example)
- # For more info, see:
- # http://osdoc.cogsci.nl/python-inline-code/experiment-functions/#experiment.set
- exp.set("trial_ag", trial_ag)
- exp.set("trial_val", trial_val)
- exp.set("trial_name", trial_name)
- __end__
- set description "Executes Python code"
- 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 declare_lists "always"
- run block_loop "always"
Advertisement
Add Comment
Please, Sign In to add comment