Emotional Stroop Demo
Jaap MurreYou can adapt the script with different words. It is easy to add extra stimuli as well: Simply copy lines and update them. In this for, the experiment cannot be done on mobile phones or tablets; a keyboard is required. If you know how to program, three color buttons can be added. These can then be operated by either a mouse or finger taps.
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 = [
// Emotion words (mix of negative and positive)
{word: 'danger', color: 'green', key: 'g', condition: 'emotion'},
{word: 'cancer', color: 'green', key: 'g', condition: 'emotion'},
{word: 'failure', color: 'red', key: 'r', condition: 'emotion'},
{word: 'love', color: 'blue', key: 'b', condition: 'emotion'},
{word: 'success', color: 'red', key: 'r', condition: 'emotion'},
{word: 'joy', color: 'blue', key: 'b', condition: 'emotion'},
// Neutral words
{word: 'window', color: 'red', key: 'r', condition: 'neutral'},
{word: 'paper', color: 'blue', key: 'b', condition: 'neutral'},
{word: 'bottle', color: 'blue', key: 'b', condition: 'neutral'},
{word: 'garden', color: 'red', key: 'r', condition: 'neutral'},
{word: 'pencil', color: 'green', key: 'g', condition: 'neutral'},
{word: 'chair', color: 'blue', key: 'b', condition: 'neutral'}
];
/*
For the color words you can use any word from the side bar menu
at Scripting -> Colors. E.g., aliceblue, antiquewhite, aqua etc
*/
shuffle(trials); // Randomize trial order
// Here you might also have a condition with just XXXX instead of the word. This gives faster trials.
instruction("Press the first letter of the color in which the word is <b>printed</b>, ignoring the word itself: r, g, or b.");
text("The experiment will start shortly. Get ready!");
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");
total_RT = total_RT + event.RT;
if (event.key === trials[i].key) { // The key pressed is the correct one
total_correct = total_correct + 1;
logtrial(event.RT,"RT " + trials[i].condition,"correct",trials[i].word,trials[i].color);
} else {
logtrial(event.RT,"RT " + trials[i].condition,"incorrect",trials[i].word,trials[i].color);
}
clear();
await(1000);
}
log(total_correct,"Total Correct"); // This is just handy
text("Finished!").style("color","black"); // Switch back to all black font style
await(1000);
// Give some feedback
instruction("You had " + total_correct + " correct, out of " + trials.length
+ ", with an average RT of "
+ (total_RT/trials.length).toFixed(1) + " ms.","OK","Result");
text("Thank you for participating!");
await(2000);
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.