A Sample Experiment
To illustrate the general idea of how to use the ERTS scripting language, let us design a choice reaction time experiment as an example. Subjects must simply press right or left if they find the word ‘left’ or ‘right on the screen. This is kind of the ‘hello world’ examples for psychologists.
First, we have to define two pictures representing the words ‘left’ and right’. We use the shortest possible way to define them which is the picture type ‘N’. For this type, the name of the picture is also the content:
PICTURE Left N
PICTURE Right N
After defining the two visual stimuli, we need to specify where the stimuli should be presented. This is done by defining a screen position in mm coordinates, where the center of the screen is x=0 and y=0 and the upper left corner is the -/- range and the lower right corner the +/+ range.
POSITION Center P
0,0
This command defines one screen location at the center the screen
Now, after having defined the visual stimuli and their screen position, we can proceed and define the event sequence for one trial. This is done by defining a TRIAL and its constituting trial commands:
TRIAL ShowLeft
CS 2000 ; Clear Screen and wait for 2000 ms
SP Left Center 1 500 ; Show Picture "Left" for 500 ms
These trial will clear the screen for 2000ms and then display the word ‘left’ for 500ms on the first location within the position definition ‘Center’ which is (0/0).
Since we want to display two different words, we will replace the name of the picture by a question mark, which turns the picture name into a variable argument which we will specify later at the block level:
TRIAL ShowWord
CS 2000 ; Clear Screen and wait for 2000 ms
SP ? Center 1 500 ; Show a variable Picture for 500 ms
A trial with variable arguments is called a Trial Schema since it represents a schema which we can repeat and fill with different values.
As the next step, we want to design a block consisting of trials that present the word ‘left’ and trials that present the word ‘right. This is done with the BLOCK command which simply lists specifications of which trial schema should be executed and with which values:
BLOCK ChoiceRT 2
1 ShowWord Left ; Run Trial ‘ShowWord’ and set ‘Left’ as the Picture name
1 ShowWord Right ; Run Trial ‘ShowWord’ and set ‘Right’ as the Picture name
This defines a block ‘ChoiceRT’ with 2 trial specification. Each trial specification consists of a weight (in this case 1), the name of the trial schema, and the list of values for the variable arguments ( in this case the picture name of the SP trial command)
As the final step, we must package everything up into a session structure which defines what should happen when executing the entire script. We want to run 5 replications of each trial in random order, so we need an overall number of 10 trials:
SesSION My First Experiment
RUNBLOCK ChoiceRT 10 ; Run Trial ‘ShowWord’ and set ‘Left’ as the Picture name
Taken everything together, the script looks like this:
PICTURE Left N
PICTURE Right N
POSITION Center P
0,0
TRIAL ShowWord
CS 2000 ; Clear Screen and wait for 1000 ms
SP ? Center 1 500 ; Show a variable Picture for 500 ms
BLOCK ChoiceRT 2
1 ShowWord Left ; Run Trial ‘ShowWord’ and set ‘Left’ as the Picture name
1 ShowWord Right ; Run Trial ‘ShowWord’ and set ‘Right’ as the Picture name
SesSION My First Experiment
RUNBLOCK ChoiceRT 10 ; Execute block ‘ChoiceRT’ with 10 trials in random order
Copy/paste this script into the test configuration editor window, save, and click on test-run. You will see 10 times the words ‘left’ or ‘right’ in random order.
The next section will explain how to record a response from the subjects.
Copyright 2021 - BeriSoft Inc.
All rights reserved