Go/No-Go Task Demo Experiment Run Experiment

Go/No-Go Task

Jaap Murre

This is a fairly typical implementation of the Go/No-Go 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 d-prime based on Hits and False Alarms).


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, coords = [[30,30],[51,30],[30,51],[51,51]], // [[top%,left%],[top,left]...]
    blocks = [], r, stimululus, e, hits = 0, false_alarms = 0,
    yes = addblock(44,90,12,7,"lightgrey","Yes"),
    trials = shuffle([1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 2,2,2,2,2]);

instruction("Tap or click the <b>Yes Button</b> or space bar as soon as you see a P but never when you see an R.")

for (i = 0; i < coords.length; i++) { // block with and height is 19%
    blocks.push(addblock(coords[i][0],coords[i][1],19,19,'lightgrey').text('*',300)); // * of size 300%
}


for (i = 0; i < trials.length; i++) 
{
    await(500 + random(500));
    stimulus = trials[i] === 1 ? 'P' : 'R'; // 75:25 chance of P or R
    r = randint(0,3); // Which block?

    blocks[r].text(stimulus,200);
    
    waitfor {
        e = awaitkey(' ',1000); // Wait for space but no longer than 1500 ms
    } or {
        e = yes.await('click',1000);
    }
    
    if (e.type !== 'timeout' && stimulus === 'P')
    {
        ++hits;
    }
    
    if (e.type !== 'timeout' && stimulus === 'R')
    {
        ++false_alarms;
    }
    

    await(300);
    blocks[r].text('*',300);
}

for (i = 0; i < blocks.length; i++) // Remove ('destroy') all blocks
{
    blocks[i].destroy();
}

text('You had ' + hits + ' (out of 15) correct and ' + false_alarms + ' false alarms ("Yes" on R).<br /><br />'
   + 'This gives a d-prime measure of ' + stat.dprime(hits,false_alarms).toFixed(2)
   + '<br /><br />Use the "Exit Button" to leave the experiment');

yes.text("Exit");
yes.await('click');
yes.destroy();
clear();

You can download the files as follows: Click on the file (link) and then right-click and choose Save as... from the menu. Some media files (e.g., sound) will have a download button for this purpose.

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