Flanker Task
Version: v1 (current)
Overview
The Eriksen Flanker Task is a classic measure of selective attention and cognitive control. Participants see a row of arrows (or other directional stimuli) and must indicate the direction of the center arrow while ignoring the flanking arrows on either side.
On congruent trials, all arrows point the same direction (>>>>>), making responses fast and accurate. On incongruent trials, flankers point the opposite direction (<<><<), creating response conflict and slowing reaction times. The difference between these conditions, known as the flanker effect, quantifies how well participants can focus attention and suppress irrelevant information.
Scientific Background
The flanker task, developed by Eriksen and Eriksen (1974), is a cornerstone paradigm in attention research:
- Eriksen, B.A., & Eriksen, C.W. (1974). Effects of noise letters upon the identification of a target letter in a nonsearch task. Perception & Psychophysics, 16(1), 143-149.
- Kopp, B., Rist, F., & Mattler, U. (1996). N200 in the flanker task as a neurobehavioral tool for investigating executive control. Psychophysiology, 33(3), 282-294.
The task measures:
- Selective attention: Ability to focus on task-relevant information
- Response inhibition: Suppression of incorrect prepotent responses
- Conflict monitoring: Detection and resolution of response competition
The flanker effect typically ranges from 30-80ms in healthy adults, with larger effects indicating greater susceptibility to interference.
Why Researchers Use This Task
- Cognitive control assessment: Simple, robust measure of executive attention
- Developmental studies: Flanker effect decreases from childhood to adulthood
- Clinical applications: Sensitive to ADHD, anxiety, aging, and frontal lobe dysfunction
- Neuroimaging: Reliably activates anterior cingulate cortex (conflict monitoring)
- Training studies: Used to assess improvements in attentional control
- Individual differences: Correlates with other executive function measures
Task Parameters
Response Mode
| Parameter | Type | Default | Description |
|---|---|---|---|
| Flanker Time Based | boolean | True | If True, trials auto-advance; if False, participant responds via button |
Visual Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| Flanker Font Size (px) | number | 72 | Font size for arrow display (8-400) |
Practice Trials
| Parameter | Type | Default | Description |
|---|---|---|---|
| Flanker Practice Enabled | boolean | False | Enable practice trials with visual feedback |
| Flanker Practice Trials | array | [] | Array of practice trial configurations |
Keyboard Shortcuts
Researchers can customize the keyboard bindings used during the task:
| Parameter | Type | Default | Description |
|---|---|---|---|
| Show keyboard hint | boolean | True | Display an on-screen hint showing the configured keys |
| Left key | key | Arrow Left (←) | Key for left-pointing center arrow |
| Left action label | text | "Left" | Label shown in the keyboard hint for the left key |
| Right key | key | Arrow Right (→) | Key for right-pointing center arrow |
| Right action label | text | "Right" | Label shown in the keyboard hint for the right key |
Trial Configuration
Each trial is defined in the Trials spreadsheet with the following columns:
| Column | Description | Example |
|---|---|---|
| center | Center arrow character | >, < |
| flankers | Flanking arrow character | >, < |
| condition | Trial type | Congruent, Incongruent |
| expected_response | Correct answer | Left, Right |
| fixation_ms | Fixation cross duration | 500 |
| stimulus_ms | Arrow display duration | 2000 |
| block | Optional grouping label | Practice, Main, Block 1 |
Example Trials
| center | flankers | condition | expected_response | fixation_ms | stimulus_ms | block |
|--------|----------|--------------|-------------------|-------------|-------------|-------|
| > | > | congruent | right | 500 | 2000 | main |
| < | < | congruent | left | 500 | 2000 | main |
| > | < | incongruent | right | 500 | 2000 | main |
| < | > | incongruent | left | 500 | 2000 | main |
Note: The task automatically builds the 5-arrow display: flankers + flankers + center + flankers + flankers
Participant Experience
Trial Sequence
- Main Instructions: Explains to respond to the center arrow only
- (Optional) Practice Instructions: If practice enabled
- (Optional) Practice Trials: With visual feedback (green checkmark for correct, red X for incorrect)
- (Optional) Trials Instructions: Shown before main trials
- Main Trials: Each trial follows this sequence:
- Fixation cross (
+) appears (if fixation_ms > 0) - Arrow row appears (e.g.,
<<><<) - Participant presses left arrow key or right arrow key
- Trial advances automatically (time-based) or after response (button-based)
- Fixation cross (
Response Methods
Keyboard (recommended):
- Press Left Arrow Key (←) for left-pointing center arrow (default -- configurable by researcher)
- Press Right Arrow Key (→) for right-pointing center arrow (default -- configurable by researcher)
Buttons (if flanker_time_based: false):
- Click "Left" or "Right" button on screen
All keyboard bindings are configurable by the researcher in the study configuration. The keys listed above are the defaults.
Data Output
Markers and Responses
Markers (stimulus_shown):
{
"type": "stimulus_shown",
"ts": "2024-01-01T00:00:01.000Z",
"hr": 1234.56,
"data": {
"trial_index": 1,
"stimulus_id": "flanker_0_1",
"row": "<<><<",
"center": ">",
"flankers": "<",
"condition": "incongruent",
"expected_response": "right",
"block": "main"
}
}
Response Data:
{
"trial_index": 1,
"stimulus_id": "flanker_0_1",
"source": "keyboard",
"raw_key": "ArrowRight",
"row": "<<><<",
"condition": "incongruent",
"expected_response": "right",
"response_value": "right",
"correct": true,
"latency_ms": 623,
"ts": "2024-01-01T00:00:01.623Z",
"hr": 1857.56
}
Summary Artifact
A JSON file (flanker_summary_<taskIndex>.json) with aggregated statistics:
{
"task_kind": "flanker",
"total_trials": 60,
"overall": {
"accuracy": 0.95,
"mean_rt_ms": 542,
"mean_correct_rt_ms": 531
},
"by_condition": {
"congruent": {
"accuracy": 0.98,
"mean_correct_rt_ms": 487
},
"incongruent": {
"accuracy": 0.92,
"mean_correct_rt_ms": 575
}
},
"flanker_effect_ms": 88,
"trials": [ /* per-trial data */ ]
}
Key metrics:
flanker_effect_ms: Difference between incongruent and congruent mean RTs (higher = more interference)accuracy: Overall proportion correctmean_correct_rt_ms: Average RT for correct responses only
Design Recommendations
Trial Design
Balanced design (recommended):
- 30 congruent trials
- 30 incongruent trials
- Randomize order to prevent anticipation
- Equal left/right responses in each condition
Minimum for reliable flanker effect:
- 20 congruent trials
- 20 incongruent trials
Timing Guidelines
| Parameter | Standard | Fast | Slow |
|---|---|---|---|
| Fixation (ms) | 400-600ms | 200ms | 800ms |
| Stimulus (ms) | 1500-2000ms | 1000ms | 3000ms |
Note: Most participants respond within 1000ms. Longer stimulus durations allow more time but may reduce time pressure.
Practice Trials
Include 8-16 practice trials:
- Mix congruent and incongruent (equal numbers)
- Provide feedback so participants learn the task
- Both left and right responses should appear
- Consider starting with all congruent, then introducing incongruent
Arrow Stimuli
Standard arrows (recommended):
- Left:
< - Right:
> - Builds 5-character display automatically
Alternative stimuli: You can use letters (H and S) or other directional characters, but arrows are most intuitive.
Common Issues and Solutions
No Flanker Effect
Problem: Incongruent RT not slower than congruent RT
Possible causes:
- Too few trials (high variability)
- Stimulus duration too long (no time pressure)
- Participants responding too slowly (speed-accuracy tradeoff)
Solutions:
- Increase trials per condition (minimum 20 each)
- Reduce
stimulus_msto 1500ms or less - Emphasize speed in instructions ("Respond as quickly as possible")
High Error Rate (>15%)
Problem: Accuracy below 85%
Possible causes:
- Stimulus duration too short
- Participants not understanding "center arrow only"
- Keyboard confusion (arrow keys not working)
Solutions:
- Increase
stimulus_msto 2500-3000ms - Extend practice with clearer feedback
- Test keyboard functionality before starting
- Add explicit examples in instructions
Keyboard Responses Not Working
Problem: Arrow keys don't register
Solutions:
- Ensure task window has focus (click on task area)
- Check browser compatibility (works best in Chrome/Edge/Firefox)
- Use button-based mode as alternative (
flanker_time_based: false)
Example Study Configurations
Standard Adult Flanker
- 80 trials total (40 congruent, 40 incongruent)
- 500ms fixation, 1500ms stimulus
- Time-based mode with keyboard responses
- Practice: 12 trials with feedback
- Emphasize speed in instructions
Developmental Version (Children)
- Fewer trials (48 total: 24 per condition)
- Longer stimulus duration (2500ms)
- Larger font size (96px)
- Extended practice (20 trials)
- Button-based mode (easier than keyboard)
Clinical Assessment
- Moderate trial count (60 total)
- Longer stimulus duration (2000ms)
- Self-paced (button-based mode)
- Practice trials mandatory
- Multiple blocks with breaks
Within-Subjects Manipulation
Block 1: High congruency (80% congruent, 20% incongruent) Block 2: Low congruency (20% congruent, 80% incongruent)
This tests expectancy effects on the flanker effect.
References
- Eriksen, B.A., & Eriksen, C.W. (1974). Effects of noise letters upon the identification of a target letter in a nonsearch task. Perception & Psychophysics, 16(1), 143-149.
- Kopp, B., Rist, F., & Mattler, U. (1996). N200 in the flanker task as a neurobehavioral tool for investigating executive control. Psychophysiology, 33(3), 282-294.
- Fan, J., McCandliss, B.D., Sommer, T., Raz, A., & Posner, M.I. (2002). Testing the efficiency and independence of attentional networks. Journal of Cognitive Neuroscience, 14(3), 340-347.