N-Back Demo Experiment Run Experiment

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.

// 1-back
var stimuli_1 = "C F B B Q S S C J D D B M Q Q C V V F J M M V Q Q C C D B B J S Q C C J J M F F",
                // 2-back
    stimuli_2 = "M F Q F J C J Q S Q S B D B M S M S D M D F B S V S V D Q B F D J D V S V B F M C",
                // 3-back
    stimuli_3 = "B S V C S D M B F M C F Q V S Q V D M F D V Q D C D J C J F V J S M B S D F S D B";

stimuli_1 = stimuli_1.split(' ');
stimuli_2 = stimuli_2.split(' ');
stimuli_3 = stimuli_3.split(' ');

function nback(stimuli,n)
{
    main.setfontsize(60);
    instruction('Watch the numbers on the screen. If the current number equals the one '
        + (n === 1 ? 'just seen before ' : (n === 2 ? 'seen one before the last one' : 'seen two before the last one'))
        + ' tap or click the "Same" Button or press the space bar. Else, do nothing.

' + ' When you click OK below, the experiment will start immediately.'); await(1000); var i, e, current, last, hits = 0, same_ones = 0, false_alarms = 0, wait_time = 2500, same = addblock(44,90,12,7).button("OK"); for (i = 0; i < stimuli.length; i++) { current = stimuli[i]; text(current,300); waitfor { await(500); clear(); } and { waitfor { e = same.await('click',wait_time); } or { e = awaitkey(' ',wait_time); } clear(); } if (i >= n && current === stimuli[i-n]) { ++same_ones; } if (i >= n && e.type !== 'timeout') { if (current === stimuli[i-n]) { ++hits; } else { ++false_alarms; } } await(1000); } text('You had ' + hits + ' out of ' + same_ones + ' similar ones correct ' + 'and you responded ' + false_alarms + ' times when the digits were in fact different.'); same.button('Exit').await('click'); same.destroy(); } function nback_example(n) { var stimulus_sets = [ ['S','R','R','K','R','X','X'], // n = 1 ['S','K'], ['V','X','X'] ], stimuli = stimulus_sets[n-1]; main.setfontsize(60); instruction('First, we will do a brief example to get used to the task'); instruction('Watch the numbers on the screen. If the current number equals the one ' + (n === 1 ? 'just seen before ' : (n === 2 ? 'seen one before the last one' : 'seen two before the last one')) + ' tap or click the "Same" Button or press the space bar. Else, do nothing.

' + ' When you click OK below, the experiment will start immediately.'); await(1000); var i, e, current, last, hits = 0, same_ones = 0, false_alarms = 0, wait_time = 2500, same = addblock(44,90,12,7).button("OK"); for (i = 0; i < stimuli.length; i++) { current = stimuli[i]; text(current,300); waitfor { await(500); clear(); } and { waitfor { e = same.await('click',wait_time); } or { e = awaitkey(' ',wait_time); } clear(); } if (i >= n && current === stimuli[i-n]) { ++same_ones; if (e.type === 'timeout') { switch (n) { case 1: alert("Here you should have responded because the current letter '" + current + "' equals the previous one"); break; case 2: alert("Here you should have responded because the current letter '" + current + "' equals the letter before the previous one"); break; case 3: alert("Here you should have responded because the current letter '" + current + "' equals the letter two before the previous one"); break; } } } if (i >= n && e.type !== 'timeout') { if (current === stimuli[i-n]) { ++hits; } else { ++false_alarms; switch (n) { case 1: alert("Only respond if the current letter equals the previous one"); break; case 2: alert("Only respond if the current letter equals the one before the previous one"); break; case 3: alert("Only respond if the current letter equals the one two before the previous one"); break; } } } await(1000); } text('You had ' + hits + ' out of ' + same_ones + ' similar ones correct ' + 'and you responded ' + false_alarms + ' times when the digits were in fact different.'); same.button('Exit').await('click'); same.destroy(); } nback_example(2); //nback(stimuli_1,1); //nback(stimuli_2,2); //nback(stimuli_3,3);
This experiment has no files of this type
This experiment has no files of this type
This experiment has no files of this type
This experiment has no YouTube links
This experiment has no files of this type