Introduction
The flanker task, also known as the Eriksen flanker task, was designed in the early 1970s by Eriksen and Eriksen. Like most of the paradigms in this library, it is popular and there are many variants of the original.
One variant is the arrow flanker task, which was used as early as in 1988 by Stoffels and van der Model. Note that in the Stoffels and van der Molen study, they used a more complex design than used in this example.
The basic effect is that when you need to respond to stimuli "flanked" by irrelevant stimuli, the irrelevant stimuli can still affect your response. There is a similarity between other paradigms in which this type of interference from an irrelevant stimulus or stimulus feature occurs (like the Stroop task or the Simon task).
In congruent trials, all the arrows point in the same direction. In incongruent conditions, you are being confused by the irrelevant arrows which point in the wrong direction. The flanker effect is the difference between the incongruent and congruent conditions.
About this implementation
The flanker task here is slightly different from the original flanker task from Stoffels and van der Model (1988) for various practical reasons (this version is just a bit easier).
In this task, you need to respond with the A or L key of your keyboard. If you see a left-pointing arrow in the middle of five arrows, you need to press the A key (left on keyboard) and if you see a right-pointing arrow the L key (which is right on the keyboard. I added a reminder of these rules if people make a mistake.
If you use this experiment for a university project, I recommend to use at least 100 trials, rather than the 50 used here in this demonstration.
Run the demo
Data output file
In PsyToolkit, the data output file is simply a textfile. The save line of the PsyToolkit experiment script determines what is being saved in the data output file. Typically, for each experimental trial, you would have exactly one line in your text file, and each number/word on that line gives you the information you need for your data analysis, such as the condition, response speed, and whether an error was made. |
Meaning of the columns in the output datafile. You need this information for your data analysis.
Colum | Meaning |
---|---|
1 |
stimulus text |
2 |
1 = congruent ; 0 = incongruent |
3 |
status (1=correct, 2=error, 3=too slow) |
4 |
the response time (ms) |
PsyToolkit code
Click to expand the PsyToolkit script code (part of zip file below)
fonts
Small arial 18
Large arial 80
## table columns: 1) Stimulus, 2) 1=Congruent, 0=Incongruent, 3) 1: press A, 2: press L
table flankers
"←←←←←" 1 1
"→→→→→" 1 2
"→→←→→" 0 1
"←←→←←" 0 2
part warningSignal
set $counter 0
while $counter < 15
set $counter increase
show rectangle 0 25 10 50 red
show rectangle 0 25 50 10 red
delay 100
clear -1 -2
delay 100
while-end
task flankerArrows
keys a l
font Large
show rectangle 0 25 10 50 # stimulus 1
show rectangle 0 25 50 10 # stimulus 2
show text @1 0 -50 255 255 255 # stimulus 3
readkey @3 2000
clear 1 2 3
if STATUS = CORRECT
show text "correct" 0 25 green
delay 200
clear -1
else
font Small
if STATUS = WRONG
show text "You pressed the wrong key." 0 -150 # stimulus 4
fi
if STATUS = TIMEOUT
show text "You responded to slowly. Respond within 2 seconds." 0 -150 # stimulus 3
fi
show text "If you see ← in the middle, press the A key" 0 -100 # stimulus 3
show text "If you see → in the middle, press the L key" 0 -50 # stimulus 4
part warningSignal
clear 4 5 6
fi
delay 500 # intertrial interval
save @1 @2 STATUS RT
block test
text "You will see 5 arrows, like this → → → → →" 0 -200
text "Only attend the middle one, in this example it is a →" 0 -150
text "If you see ← in the middle, press the A key" 0 -100
text "If you see → in the middle, press the L key" 0 -50
text "You will do this multiple times" 0 0
text "Press space bar to start task" 0 50
wait_for_key
task flankerArrows 50
feedback
text align left
text color yellow
set &RTCon mean c4 ; select c2 == 1 && c3 == 1
set &RTInc mean c4 ; select c2 == 0 && c3 == 1
set &FlankerEffect expression &RTInc - &RTCon
text -200 -100 "Average RT in conditions:"
text -200 -25 &RTCon ; prefix "Compatible: " ; postfix " ms"
text -200 50 &RTInc ; prefix "Incompatible: " ; postfix " ms"
text -200 125 &FlankerEffect ; prefix "Flanker effect: " ; postfix " ms"
text -200 200 "Press space bar to continue"
end
Download
If you have a PsyToolkit account, you can upload the zipfile directly to your PsyToolkit account. Watch a video on how to do that. If you want to upload the zipfile into your PsyToolkit account, make sure the file is not automatically uncompressed (some browsers, especially Mac Safari, by default uncompress zip files). Read here how to easily deal with this. |
Further reading
-
Eriksen, B. A. & Eriksen, C. W. (1974). Effects of noise letters upon identification of a target letter in a non-search task. Perception and Psychophysics, 16, 143-149.
-
Stoffels, E.J., van der Molen, M.W. (1988). Effects of visual and auditory noise on visual choice reaction time in a continuous-flow paradigm. Perception & Psychophysics, 44, 7–14. Link to publisher: https://link.springer.com/article/10.3758/BF03207468