Flanker Task Demo Experiment

### Flanker Task

Jaap Murre

This is a fairly complete demo of the Eriksen Flanker Task, which takes about 2.5 min. It is suitable for use in lectures, where the audience can take the test on a laptop (keyboard) or mobile phone (touch screen). Feedback is given, including a T-Test significance level of how much faster congruent were compared with incongruent trials.

The Eriksen Flanker Task is a classic response inhibition task.

If you are a registered user and signed in, you can here copy this script and its stimuli to your own account, where you can edit it and change it in any way you want.

It is absolutely free to register (no credit card info asked!). You can then instantly copy this experiment with one click and edit it, change its accompanying texts, its landing page, stimuli, etc. Invite your colleagues, friends, or students to check out your experiment. There is no limit on how many people can do your experiment, even with a free account.

The catch? There is no catch! Just keep in mind that with a free account, you cannot collect data. For teaching that is usually not a problem. For research, prepaid data collection (unlimited subjects) starts as low as €10.00 for a 10-day period.

```var i, t, e, fixation = '+', stimuli = ["<<<<<",">>>>>",">><>>","<<><<"],
// The following is a simple way to do counter-balancing:
trials = shuffle([0,0,0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3]),
correct_congruent = 0, correct_incongruent = 0,
rt_correct_congruent = 0, rt_correct_incongruent = 0,
alpha, rtcc = [], rtci = [], // arrays to save RTs
left = addblock(30,90,10,7,"lightgrey","<","left"),
right = addblock(60,90,10,7,"lightgrey",">","right"), exit;

main.setfontsize(60); // Makes the base font size a bit smaller: 60%
instruction('Watch the middle character of the five characters presented.'
+ 'If it is a < character, tap on the "< Button". '
+ 'You may also click the button with the mouse or press the Left Arrow Key on the keyboard. '
+ 'If it is a > character, tap or click the "> Button", or press the Right Arrow Key.');
instruction('The middle character is surrounded by similar characters, which you must ignore.'
+ 'When you see >><>> or <<<<< tap the "< Button" (or <- Arrow Key).  '
+ 'With <<><< or >>>>> click the "> Button" (or -> Arrow Key).'
+ 'Please, try to respond as fast as possible (within 2 seconds)'
+ ' The experiment starts when you press OK');
text("Get ready!");
await(1000);

for (i = 0; i < trials.length; i++) {
clear();
await(1500);
t = trials[i];
text(stimuli[t],300);
waitfor { // TODO: replace by await_or
e = await('click',2000); // Wait for either a mouse click on the button...
} or {
e = awaitkey('LEFT_ARROW,RIGHT_ARROW'); // ... or a keyboard key: <- or ->
}

if (e.type === 'timeout')
{
alert("Please, try to click or tap faster");
continue;
}

if (!e.event.target.id || e.event.target.id === 'undefined')
{
alert("Please, click or tap on the < or > buttons");
continue;
}

if ((e.key && e.key === keys.LEFT_ARROW) ||
(e.event.target.id && e.event.target.id === 'left')) {
if (t === 0) {
++correct_congruent;
rt_correct_congruent += e.RT;
rtcc.push(e.RT);
}
else if (t === 2) {
++correct_incongruent;
rt_correct_incongruent += e.RT;
rtci.push(e.RT);
}
}
else if ((e.key && e.key === keys.RIGHT_ARROW) ||
(e.event.target.id && e.event.target.id === 'right')) {
if (t === 1) {
++correct_congruent;
rt_correct_congruent += e.RT;
rtcc.push(e.RT);
}
else if (t === 3) {
++correct_incongruent;
rt_correct_incongruent += e.RT;
rtci.push(e.RT);
}
}
}

alpha = stat.ttest(rtcc,rtci);
text('Your average reaction time for congruent stimuli was '
+ (rt_correct_congruent/correct_congruent).toFixed(0) // toFixed(0) rounds to 0 decimals
+ ' ms and for incongruent stimuli '
+ (rt_correct_incongruent/correct_incongruent).toFixed(0)
+ ' ms'
+ 'On a one-tailed T-Test, this gives alpha = ' + alpha + ', which is statistically '
+ (alpha < 0.05 ? 'significant.' : 'not significant.') + ""
+ 'Press the Exit to leave the experiment');

exit = addblock(44,90,12,7,"lightgrey","Exit");
exit.await('click');
exit.destroy();```

#### Image Files

This experiment has no files of this type

#### Sound Files

This experiment has no files of this type

#### Video Files

This experiment has no files of this type

#### YouTube Links

This experiment has no YouTube links

#### Text Files

This experiment has no files of this type