---
API: 2
---
set foreground "white"
set subject_parity "even"
set font_size "32"
set description "A template containing a practice and an experimental phase"
set title "Runtime for Android template"
set width "1280"
set font_bold "no"
set coordinates "relative"
set height "800"
set mouse_backend "droid"
set start "experiment"
set compensation "0"
set sampler_backend "legacy"
set keyboard_backend "droid"
set background "black"
set subject_nr "0"
set canvas_backend "droid"
set font_family "mono"
set synth_backend "droid"
set font_italic "no"

define notepad about_this_template
	__note__
	Hi,

	This template already contains the basic structure
	needed for a typical experiment, consisting of a
	practice phase, followed by an experimental phase.

	This template has been finetuned to work with the
	`droid` back-end and be suitable for Android devices.

	For more information, please refer to the website:
	<http://www.cogsci.nl/opensesame>

	Have fun with OpenSesame!

	--

	Sebastiaan
	__end__
	set description "Some pointers to help you gest started!"

define reset_feedback reset_feedback

define form_text_display form_instructions
	set rows "1;4;1"
	set description "A simple text display form"
	set form_text "Tap the 'Ok' button to begin!"
	set cols "1;1;1"
	set form_title "Instructions"
	set ok_text "Ok"
	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 feedback feedback
	set duration "mouseclick"
	set reset_variables "yes"
	set description "Provides feedback to the participant"
	draw textline 0 128 "Your average response time was [avg_rt]ms" center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"
	draw textline 0 0 "Press any key to continue" center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"
	draw textline 0 -128 "Your accuracy was [acc]%" center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"

define sketchpad end_of_experiment
	set duration "mouseclick"
	set description "A sketchpad notifying the participant that the experiment is finished"
	set start_response_interval "no"
	draw textline 0 0 "Tap the screen to exit ..." center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"

define feedback touch_feedback
	set duration "1000"
	set reset_variables "no"
	set description "Provides feedback to the participant"
	draw textline 0.0 96.0 "[cursor_x], [cursor_y]" center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"
	draw textline 0 0 "Cell [response] in [response_time] ms" center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"

define sketchpad end_of_practice
	set duration "mouseclick"
	set description "A sketchpad notifying the participant that the practice phase is finished"
	set start_response_interval "no"
	draw textline 0 0 "Tap the screen to continue ..." center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"

define sketchpad sketchpad
	set duration "0"
	set description "Displays stimuli"
	set start_response_interval "no"
	draw textline 0 0 "Tap the screen!" center=1 color=white font_family="mono" font_size=32 font_italic=no font_bold=no show_if="always"

define loop block_loop
	set repeat "1"
	set description "A single block of trials"
	set item "trial_sequence"
	set column_order ""
	set cycles "1"
	set order "random"
	run trial_sequence

define sequence experiment
	set flush_keyboard "yes"
	set description "The main sequence of the experiment"
	run about_this_template "always"
	run form_instructions "always"
	run practice_loop "always"
	run end_of_practice "always"
	run experimental_loop "always"
	run end_of_experiment "always"

define sequence trial_sequence
	set flush_keyboard "yes"
	set description "A single trial"
	run sketchpad "always"
	run touch_response "always"
	run touch_feedback "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 logger logger
	set description "Logs experimental data"

define touch_response touch_response
	set _nrow "1"
	set _ncol "2"
	set description "A grid-based response item, convenient for touch screens"
	set timeout "infinite"

define loop practice_loop
	set repeat "1"
	set description "A loop containing one or more practice blocks"
	set item "block_sequence"
	set column_order "practice"
	set cycles "1"
	set order "random"
	setcycle 0 practice "yes"
	run block_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"
	run feedback "always"
