How to Organize Trials Demo Experiment Run Experiment

How to Organize Trials

Jaap Murre


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.

// Method 1 Easy but limited

// var trials = [1,1,1,1,1,2,2,2,2,2];

// trials = shuffle(trials);

// var i;

// for (i = 0; i < trials.length; i++) {
//     if (trials[i] === 1) {
//         // stuff
//     } else {
//         // stuff
//     }
// }


// Method 2 

var trials = [
    {cond:'incongruent',color:'blue',word:'orange',key:'o'},
    {cond:'incongruent',color:'green',word:'red',key:'r'},
    {cond:'congruent',color:'orange',word:'orange',key:'o'},
    {cond:'congruent',color:'red',word:'red',key:'r'}
]

trials = shuffle(trials);

instruction("Press on the key of the first letter of the font color.")

var i, event;

for (i = 0; i < trials.length; i++) {
    await(1000);
    style('color',trials[i].color);
    text(trials[i].word);
    e = awaitkey('o,r');
    logtrial(e.RT,"RT",trials[i].cond,e.key,trials[i].word,trials[i].color,trials[i].key);
    await(500);
    clear();
}
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