---
API: 2.1
OpenSesame: 3.3.7
Platform: posix
---
set width 1024
set uniform_coordinates yes
set title "New experiment"
set subject_parity even
set subject_nr 0
set start Navon
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 "/Users/utente/Downloads"
set disable_garbage_collection yes
set description "The main experiment item"
set coordinates uniform
set compensation 0
set color_backend psycho
set clock_backend psycho
set canvas_backend psycho
set background black
define sequence BlockSequence
set flush_keyboard yes
set description "Runs a number of items in sequence"
run fissazione always
run stimolo always
run key always
run update_counters always
run Feedback "[response_key]=None"
run Feedback_bad "[correct]=0"
run Feedback_good "[correct]=1"
define form_text_display End_of_experiment
set timeout infinite
set spacing 10
set rows "1;4;1"
set only_render no
set ok_text Ok
set margins "50;50;50;50"
set form_title Title
set form_text "Thanks for partecipating!"
set description "A simple text display form"
set cols "1;1;1"
set _theme gray
widget 0 0 3 1 label text="[form_title]"
widget 0 1 3 1 label center=no text="[form_text]"
widget 1 2 1 1 button text="[ok_text]"
define loop Experimental_Loop
set source table
set repeat 3
set order random
set description "Repeatedly runs another item"
set cycles 16
set continuous no
set break_if_on_first yes
set break_if never
setcycle 0 Global H
setcycle 0 Local s
setcycle 0 correct_response b
setcycle 0 Image image1
setcycle 0 png_file "1.png"
setcycle 0 mapping global
setcycle 1 Global H
setcycle 1 Local t
setcycle 1 correct_response b
setcycle 1 Image image2
setcycle 1 png_file "2.png"
setcycle 1 mapping global
setcycle 2 Global L
setcycle 2 Local l
setcycle 2 correct_response n
setcycle 2 Image image3
setcycle 2 png_file "3.png"
setcycle 2 mapping none
setcycle 3 Global L
setcycle 3 Local o
setcycle 3 correct_response b
setcycle 3 Image image4
setcycle 3 png_file "4.png"
setcycle 3 mapping local
setcycle 4 Global L
setcycle 4 Local u
setcycle 4 correct_response n
setcycle 4 Image image5
setcycle 4 png_file "5.png"
setcycle 4 mapping none
setcycle 5 Global O
setcycle 5 Local l
setcycle 5 correct_response b
setcycle 5 Image image6
setcycle 5 png_file "6.png"
setcycle 5 mapping global
setcycle 6 Global O
setcycle 6 Local u
setcycle 6 correct_response b
setcycle 6 Image image7
setcycle 6 png_file "7.png"
setcycle 6 mapping global
setcycle 7 Global S
setcycle 7 Local h
setcycle 7 correct_response b
setcycle 7 Image image8
setcycle 7 png_file "8.png"
setcycle 7 mapping local
setcycle 8 Global S
setcycle 8 Local s
setcycle 8 correct_response n
setcycle 8 Image image9
setcycle 8 png_file "9.png"
setcycle 8 mapping none
setcycle 9 Global S
setcycle 9 Local t
setcycle 9 correct_response n
setcycle 9 Image image10
setcycle 9 png_file "10.png"
setcycle 9 mapping none
setcycle 10 Global T
setcycle 10 Local h
setcycle 10 correct_response b
setcycle 10 Image image11
setcycle 10 png_file "11.png"
setcycle 10 mapping local
setcycle 11 Global T
setcycle 11 Local s
setcycle 11 correct_response n
setcycle 11 Image image12
setcycle 11 png_file "12.png"
setcycle 11 mapping none
setcycle 12 Global T
setcycle 12 Local t
setcycle 12 correct_response n
setcycle 12 Image image13
setcycle 12 png_file "13.png"
setcycle 12 mapping none
setcycle 13 Global U
setcycle 13 Local l
setcycle 13 correct_response n
setcycle 13 Image image14
setcycle 13 png_file "14.png"
setcycle 13 mapping none
setcycle 14 Global U
setcycle 14 Local o
setcycle 14 correct_response b
setcycle 14 Image image15
setcycle 14 png_file "15.png"
setcycle 14 mapping local
setcycle 15 Global U
setcycle 15 Local u
setcycle 15 correct_response n
setcycle 15 Image image16
setcycle 15 png_file "16.png"
setcycle 15 mapping none
run BlockSequence
define feedback Feedback
set reset_variables yes
set duration 750
set description "Provides feedback to the participant"
draw image center=1 file="tooslow.png" scale=2 show_if=always x=0 y=0 z_index=0
define feedback Feedback_bad
set reset_variables yes
set duration 1000
set description "Provides feedback to the participant"
draw image center=1 file="wrong.png" scale=2.000000000000001 show_if=always x=0 y=0 z_index=0
define feedback Feedback_good
set reset_variables yes
set duration 1000
set description "Provides feedback to the participant"
draw image center=1 file="correct.png" scale=2 show_if=always x=0 y=0 z_index=0
define form_text_display Instructions
set timeout infinite
set spacing 10
set rows "1;4;1"
set only_render no
set ok_text Ok
set margins "50;50;50;50"
set form_title Instructios
__form_text__
Welcome in the Navon Task!
In this task you need to press the key B if you see a letter H or O (small or large).
You need to press the key N if you neither see a H nor an O.
You can find for example groups of small s forming a large H, groups of small
o forming a large L, or also groups of t forming a large T.
Remember to press the key B when you see a H or an O (small or large),
and to press the key N when you neither see a H nor an O.
There are many combination of letters, you need to carefully check for H or O.
You get feedback on every trial (correct, wrong or too slow).
Once you get to the end, press the spacebar then click OK.
CLICK OK TO START
__end__
set description "A simple text display form"
set cols "1;1;1"
set _theme gray
widget 0 0 3 1 label text="[form_title]"
widget 0 1 3 1 label center=no text="[form_text]"
widget 1 2 1 1 button text="[ok_text]"
define sequence Navon
set flush_keyboard yes
set description "Runs a number of items in sequence"
run Instructions always
run set_counters always
run Experimental_Loop always
run calculate_average_per_condition always
run new_logger always
run new_feedback always
run End_of_experiment always
define inline_javascript calculate_average_per_condition
set description "Executes JavaScript code (ECMA 5.1)"
___run__
// Number of local trials
// NOTE: change this value if the number of trials
// or the number of repetitions changes:
vars.n_local = 12 // 4 trials * 3 repetitions
vars.n_global = 12 // 4 trials * 3 repetitions
// Calculate the average accuracy in %
vars.avg_correct_local = (vars.count_correct_local / vars.n_local) * 100
vars.avg_correct_global = (vars.count_correct_global / vars.n_global) * 100
// Calculate average RT per condition
// NOTE: for correct trials only
vars.avg_RT_local = vars.cumulative_RT_local / vars.count_correct_local
vars.avg_RT_global = vars.cumulative_RT_global / vars.count_correct_global
__end__
set _prepare ""
define sketchpad fissazione
set duration 1000
set description "Displays stimuli"
define keyboard_response key
set timeout 4000
set flush yes
set event_type keypress
set duration keypress
set description "Collects keyboard responses"
set allowed_responses "b;n"
define feedback new_feedback
set reset_variables yes
set duration keypress
set description "Provides feedback to the participant"
draw textline center=0 color=white font_bold=no font_family=mono font_italic=no font_size=18 html=yes show_if=always text="Correct local: [avg_correct_local]%
Correct global: [avg_correct_global]%
Average response time local: [avg_RT_local]ms
Average response time global:
[avg_RT_global]ms" x=-256 y=-96 z_index=0
define logger new_logger
set description "Logs experimental data"
set auto_log yes
define inline_javascript set_counters
set description "Executes JavaScript code (ECMA 5.1)"
set _run ""
___prepare__
// Initiate counters for the two different categories:
vars.count_correct_global = 0
vars.count_correct_local = 0
vars.cumulative_RT_global = 0
vars.cumulative_RT_local = 0
__end__
define sketchpad stimolo
set timeout 4000
set duration 0
set description "Displays stimuli"
draw image center=1 file="[png_file]" scale=2 show_if=always x=0 y=0 z_index=0
define inline_javascript update_counters
set description "Executes JavaScript code (ECMA 5.1)"
___run__
// If response was correct:
if (vars.correct === 1){
// If mapping is local:
if (vars.mapping === "local"){
// Increment local counter with 1
vars.count_correct_local = vars.count_correct_local + 1
// Update cumulative RT
console.log(vars.response_time)
console.log(vars.cumulative_RT_local)
vars.cumulative_RT_local = vars.cumulative_RT_local + vars.response_time
}
// If mapping is global:
if (vars.mapping === "global"){
// Increment global counter with 1
vars.count_correct_global = vars.count_correct_global + 1
// Update cumulative RT
vars.cumulative_RT_global = vars.cumulative_RT_global + vars.response_time
console.log(vars.response_time)
console.log(vars.cumulative_RT_global)
}
}
__end__
set _prepare ""