Shared Scripts, Data, Stimuli, Files, and Demos

Stroop task prova Run Experiment

Stroop task prova

cami

No comments yet
 




Comments

No comments yet

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, event, total_correct = 0, total_RT = 0;

// The following is an array with objects
// E.g., see https://www.w3schools.com/js/js_arrays.asp for how to use these

    var trials = [
    {word: 'ROSSO', color: 'green', key: 'v'},
    {word: 'BLU', color: 'green', key: 'v'},
    {word: 'VERDE', color: 'red', key: 'r'},
    {word: 'ROSSO', color: 'blue', key: 'b'},
    {word: 'VERDE', color: 'red', key: 'r'},
    {word: 'BLU', color: 'green', key: 'v'},

    {word: 'BLU', color: 'red', key: 'r'},
    {word: 'ROSSO', color: 'blue', key: 'b'},
    {word: 'VERDE', color: 'blue', key: 'b'},
    {word: 'VERDE', color: 'red', key: 'r'},
    {word: 'BLU', color: 'green', key: 'v'},
    {word: 'ROSSO', color: 'blue', key: 'b'}
];

shuffle(trials); // Randomize trial order


// Here you might also have a condition with just XXXX instead of the word. This gives faster trials.

instruction("Premi la prima lettera del colore in cui la parola è stampata, ignorando il significato della parola: R se è rossa, V se è verde, or B se è blu.", "OK", "Istruzioni");

text("La prova inizierà a breve. Tieniti pronto!");
await(2000);


for (i = 0; i < trials.length; i++) {
    text("+").style("color","black");
    await(500);
    clear();
    await(Math.random());
    // Access your trial objects like this:
    text(trials[i].word).style("color",trials[i].color);
    event = await("keypress",3000);
    total_RT = total_RT + event.RT;
    if (event.key === trials[i].key) {
        total_correct = total_correct + 1;
    }
    
    clear();
    await(1000);
}

text("Finito!").style("color","black");
await(1000);

// Give some feedback
instruction("Hai ottenuto " + total_correct + " risposte corrette, su " + trials.length
            + ", con una media RT di " 
            + (total_RT/trials.length).toFixed(1) + " ms." ,"OK","Risultato");
            
text("Grazie per la partecipazione!");
await(2000); 

Data inspection is forthcoming!

In the mean time, authors may download their own data and make it available as an Excel file. Check out the 'Stimuli and Files' tab.

Click on a category to view the stimuli and files

Related Experiments