Flanker Task Tutorial This tutorial will show you how to create a

Flanker Task Tutorial
This tutorial will show you how to create a Flanker Task (arrows) experiment using Opensesame . It
will introduce you to some of the items that are available to use, and it does not involve any
programming just drag and drop, and some text entry.
Below is an image of Opensesame, naming the areas of interest.
Main Toolbar Items
New experiment
Open
Save
Run experiment, full window
Run experiment, in a window
Test run experiment, does not save the results
Close all tabs apart from select one
Enables and Disables One tab mode, only one tab will be shown at a time.
Shows or Hides the File Pool
Shows or Hides the Variable Inspector, shows variables used in experiment
Shows or Hides the Debug Window
Displays Help offline
Displays Help online
Item Toolbar.
This contains all the items that can be added to an experiment.
Overview.
This displays all the items that have been added. Items that are in a loop are indented.
Tab Area.
This area allows the editing of the item selected in the Overview.
File Pool
It is used to add files to the experiment. These files are embedded in the experiment so when the
experiment is saved these files are saved as well.
Debug Window
Is used to display error messages, this can aid in diagnosing problems.
The tutorial has been broken up into step, these are as follows:
Step 1:
The experiment design, what is required?
Step 2:
Create a new experiment.
Step 3:
Add items
Step 4:
Rename the items
Step 5:
Add instruction and thank you text
Step 6:
Setup loop
Step 7:
Setup keyboard
Step 8:
Setup feedback
Step 9:
Setup logger
Step 10:
Setup all sketchpads
Save the task at the end of each step.
Step 1: The experiment design, what is required?
The Flanker Task what is required?
For the Flanker Task you will need images of left and right arrows and a square which is the same
size. The size of these images will depend on your screen size and where the positions of these
images are on the screen.
Instructions on screen? For this tutorial yes.
How many presentations of the stimuli are there? In this tutorial we are just going to run through
the six stimuli once.
How many stimuli are there? Well there are 2 incongruent, 2 congruent and 2 neutral stimuli
presentations. The task involves displaying the stimuli in a random order (could be sequential if so
desired)
What is the participant required to do, how do they interact with the task? They have to either press
a left key (Z) when the centre arrow is pointing left or a right key(M) when the centre arrow is
pointing right.
Do we want to provide feedback? In this version yes, so that will mean a correct and an incorrect
feedback.
What data do we want to save? What type of stimuli is presented(incongruent etc), what key is
pressed and was the selection correct.
End screen? Yes, just to say thank you
Each of the answers above relates to an item from the toolbar:
1 text display (instructions)
1 loop with sequence (why sequence? As there is more than one item to loop)
6 sketchpads (one displayed at a time)
1 keyboard response
2 sketchpads (one of which is displayed depending on result)
1 logger
1 text display (end screen)
Step 2: Create a new experiment.
Open Opensesame, in New (Tab area) double click on Default template.
Change the description(Tab area) from New experiment to Flanker Task.
Whilst on the General Properties tab, change the resolution to match your screen resolution. Leave
everything else as it is.
Let’s tidy up the new experiment, in overview there are two items that are not required, these are
directly below ‘experiment’. To remove any item, right click on an item and select delete from the
menu. When you delete an item, it goes into the Unused items, which means that the item is still
available for use in this experiment and as a consequence adds to the file size. If you do not intend
to use again then click on Unused Items and then click on Permanently delete unused items. Do this
for the two items already in there.
Step 3: Add items
Now you are going to add the required items to the experiment, in the order listed at the end of step
1. There are two ways to add new items to the experiment, one is to drag the required item from
the Toolbar to the required place in the Overview, if the item is visible in the Overview then click on
the double arrow at the bottom of the Toolbar. The other way is to click on the sequence
in
overview, where the item is needed and use the Append new item, selected the required item from
the drop box and click on the plus button. If the item is in the wrong location place the mouse cursor
over the four little squares to the left of the item, left click and drag the item to its new location.
Now, using one of the methods describe above add:
1: text display
2: loop, this will bring up a dialog asking if you want to create a loop with a new or existing
item. The requirement is to run multiple items in a loop so a sequence is needed. Make sure
that sequence is shown and click on create. This will add a loop and a sequence to the
Overview.
3: sketchpads (x 6) to the sequence
4: keyboard response
5: sketchpads (x2)
6: logger
Note; you could use a feedback item instead of sketchpad (at 5 above). The difference is that
sketchpads content is created prior to the start of each loop and therefore cannot be changed
during that loop, this helps to improve the timing accuracy of stimuli presentation. Whilst the
feedback item’s content is created prior to being displayed and therefore is able to display things
that are dependent on the user’s interaction in that particular loop. This is what you should see in
overview
Now the final item to add is a text_display. In overview click on experiment, add a text display to the
end of the experiment.
Step 4: Rename the items
Rename the items so that they are meaningful. This can be achieved by right clicking the required
item in overview and selecting Rename or by selecting the item in overview and then changing the
name in the Tab area.
Step 5: Add instruction and thank you text
Add the text messages to text_display. In overview click on the required text_display, in the Tab area
change the font size to 40 and add the text into the Text window. The instructions should include a
message at the end to say “ press any key to continue”. Leave all other settings as they are.
Step 6: Setup loop
What information do we put in the loop? The procedure needs to know which stimulus is to be
present on each loop, which response is correct and what type of stimulus was presented.
So add three variables, arrow, correct_key and type, using the ‘Add variable’ button.
Note, variable names cannot contain spaces.
Change number of cycles to 6.
Enter the details shown here.
Click on sequence (in overview), and change the ‘Run if’ statements to match this image.
These conditions will mean that the arrow1 is only shown when arrow is equal to 1 etc. And that
either correct or incorrect will be shown depending on the key pressed by the user. The variable
correct is the result of a comparison by the keyboard item between the key that is pressed and the
‘correct response’, which is set up in step 7.
The square brackets around the text indicates that the variable is an experiment variable i.e. arrow is
used in loop to indicate which stimulus is to be presented. Where ever you have a sequence you will
have the Run if option.
Step 7: Setup keyboard
Add [correct_key] (comes from the loop item) to Correct response and z;m to the allowed
responses. Leave Timeout as infinite, as it waits for user’s response.
Step 8: Setup feedback
Change duration for correct to 500.
Add green text to feedback. Click on the text tool (Ab) Change color to green. Change Font size to 60.
Click on black screen, enter CORRECT in the New textline dialog. Enter the script editor by clicking
Edit script icon.
Top right of Tab area.
The following colours can be selected just by entering them in text: red, green, blue, black white,
brown, yellow, orange, purple, pink, cyan, magenta and gray.
For other colours use the colour palette tool
Line 4, change the first two numbers both to zero, these are the screen coordinates of the text, with
zero being at the screen centre (right and up are positive)
Copy all this text, by highlighting and then pressing Ctrl+C.
Click on apply and close
Select incorrect (in overview), enter the script editor, highlight the existing text and paste over the
copied text (Ctrl+V). In line 4 change CORRECT to INCORRECT and color from green to red. Click on
apply and close.
Step 9: Setup logger
Unselect all the tick boxes. You will need to select the tick boxes for the variables correct and
response_time_keyboard (under source item keyboard), and also the variables arrow and type
(under source item loop).
Step 10: Setting up the sketch pads.
Click on the folder icon
at the top of the screen or use the view menu and select, Show file
pool. Click on the plus button, and add the three image files.
Starting with arrow1, left congruent. Set duration to zero (0).
You will need to add 5 left arrows to this sketchpad. Click on the image tool
, then click on the
black screen, the Select file dialog will open, select the left arrow image. Enter the script editor,
copy all of line 3 (up to and including “always”).
Paste this four times on the lines below, you may need to press return to get a new line.
Now change the coordinates of the images, as currently they are all in the same place. For this
example the first coordinate for each of the lines will -512, -256, 0 , 256 and 512 respectively, whilst
the second will all be zero.
Copy all this text. Apply and close. Save
Select arrow2, open the script editor. Paste the copied text over all the existing text. Now arrow2 is
an exact copy of arrow1 but arrow2 is meant to be left incongruent. Change the name of the images
from left to right for the first and last two lines. The middle line (at 0 0) stays left.
Select arrow3, open the script editor. Paste the copied text over all the existing text. Now arrow3 is
an exact copy of arrow1 but arrow 3 is meant to be left neutral. Change the name of the images
from left to square for the first and last two lines. The middle line (at 0 0) stays left.
Now that arrow1 to 3 are setup, arrow4 to 6 are almost identical apart from the centre arrow
pointing right instead of left. Using the same method as above, copy the text from the script editor
from arrow1 to arrow 4, arrow2 to arrow5 and arrow3 to arrow6.
Now in arrow4 arrow5 and arrow 6, change the middle image from left to right.
That is it. Now you are ready to run .
Subject number dialog will appear
for testing leave it as it is. Click OK
Next you will be asked to choose where to save the data file.
On completion of this test the Finished dialog will appear.
Click No, if a file is added to the file pool then it will increase the file size of the experiment.