Shared Scripts, Data, Stimuli, Files, and Demos

Experiment_Britt Run Experiment

Experiment_Britt

britthooijmans

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 thehangover = ["the_hangover.jpeg", "th2.jpeg", "th3.jpeg", "th4.jpeg", "th5.jpeg"];
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,"lightpink","Yes"),
    trials = shuffle([1,1,1,1,1, 1,1,1,1,1, 1,1,1,1,1, 2,2,2,2,2]);
var endphoto = ["ep.jpeg"];


preload("the_hangover.jpeg");
preload("th2.jpeg");
preload("th3.jpeg");
preload("th4.jpeg");
preload("th5.jpeg");
preload("ep.jpeg");

image.await("preloading_completed");

// welcome intstructions
instruction("Welcome to this 3 minute taking impulse control experiment measured with a Go/NoGo task. Your score will be visible in the end.");

// CONSENT
radio("Participation in this experiment is entirely voluntary and you may withdraw at any time. Would you like to proceed?",
  [["Yes"], ["No"]], "consent");

if (response.consent === "Yes") 
{
  
    // Give each subject an ID number (increase the number by 1 for each new subject)
    var subject_id = increase("Subject ID", "script");
    log(subject_id,"subject_ID");
    
    // Assign subjects to a condition based on whether their ID is divisble by 2.
    if (subject_id%2 === 0) // *even* IDs are assigned to:
    {
    // Condition 1: Pictures + Go-NoGo
   // Instructions for Condition 1
        instruction("Please pay attention to the 5 pictures shown");
    // for loop for the 5 pics
        for (i = 0; i < thehangover.length; i = i + 1)
        {
        setimage(thehangover[i]);
        await(2000);
        clear();
        await(1000);
        }

         // Go/noGo 
    instruction("Click the yes button(below) or tap spacebar when the G of Go is shown but do NOTHING when the N of No is shown. Be as accurate and fast as possible.");

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


                for (i = 0; i < trials.length; i++) 
                {
                await(500 + random(500));
                stimulus = trials[i] === 1 ? 'G' : 'N'; // 75:25 chance of P or R
                r = randint(0,3); 
                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 === 'G')
                {
                ++hits;
                }
    
                if (e.type !== 'timeout' && stimulus === 'N')
                {
               ++false_alarms;
                }
    

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

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

                    log(hits,"hits");
                    log(false_alarms,"false_alarms");
                    var dprime = stat.dprime("hits","false_alarms").toFixed(2);
                    log(dprime, "dprime");

text('You had ' + hits + ' (out of 15) correct and ' + false_alarms + ' false alarms ("Yes" on R).

' + 'This gives a d-prime measure of ' + stat.dprime(hits,false_alarms).toFixed(2) + '

Use the "Exit Button" to leave the experiment and enter a small debriefing'); yes.text("Exit"); yes.await('click'); yes.destroy(); clear(); } else { // Participants in Condition 2 console.log("Participant is in Condition 2"); // Condition 2: Go-NoGo // code for Condition 2 instruction("Click the yes button(below) or tap spacebar when the G of Go is shown but do NOTHING when the N of No is shown. Be as accurate and fast as possible."); for (i = 0; i < coords.length; i++) { // block with and height is 19% blocks.push(addblock(coords[i][0],coords[i][1],19,19,'lightpink').text('*',300)); // * of size 300% } for (i = 0; i < trials.length; i++) { await(500 + random(500)); stimulus = trials[i] === 1 ? 'G' : 'N'; // 75:25 chance G N r = randint(0,3); blocks[r].text(stimulus,200); waitfor { e = awaitkey(' ',1000); // Wait for space not longer than 1500 ms } or { e = yes.await('click',1000); } if (e.type !== 'timeout' && stimulus === 'G') { ++hits; } if (e.type !== 'timeout' && stimulus === 'N') { ++false_alarms; } await(300); blocks[r].text('*',300); } for (i = 0; i < blocks.length; i++) // Remove the blocks { blocks[i].destroy(); } log(hits,"hits"); log(false_alarms,"false_alarms"); var dprime = stat.dprime("hits","false_alarms").toFixed(2); log(dprime, "dprime"); text('You had ' + hits + ' (out of 15) correct and ' + false_alarms + ' false alarms ("Yes" on R).

' + 'This gives a d-prime measure of ' + stat.dprime(hits,false_alarms).toFixed(2) + '

Use the "Exit Button" to exit the experiment and enter a small debriefing '); yes.text("Exit"); yes.await('click'); yes.destroy(); clear(); } // Demographic questions for Condition 2 radio("What is your gender?",[["Female"],["Male"],["Other"],["Prefer not to say"]],"gender"); // Radio: Your answer options appear in a drop-down menu radio("Are you diagnosed with a disorder that influences attention or impulsivity?",[["Yes"], ["No"],["Prefer not to say"]], "disorder"); select("What is your age?",range(0,100),"age"); // Select: Your number range (0-99) appears in a drop-down menu text("You selected {gender}, {age} years, and {disorder} attention/impulsivity disorder."); // Variables in curly brackets are replaced with subject's answer for that variable await(3000); scale("On a scale of 1 to 5, how challenging did you find this task?","Very Easy","Very Hard","difficulty"); // Scale: Shows a Likert-scale (1 labeled very easy and 5 labeled very hard) // Debriefing instruction("The goal of this Go/no-Go experiment is to measure the level of impluse control, which is hypothesized to be lower in condition 1 where the participants were exposed to impulsive behavior before the task."); // end picture for (i = 0; i < endphoto.length; i = i + 1) { setimage(endphoto[i]); await(2000); hideimage(); await(1000); } // end text text("The experiment has ended."); await(2000); text("Thank you for participating!"); // You can include any code that should be executed for all conditions here. } else { // Handle participants who do not consent console.log("Participant did not consent"); // Provide a message for participants who do not consent text("You did not consent to participate. Thank you anyways."); }

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

You can download the files shown here by clicking on the file names or image. Note that you cannot link directly to the images, sounds, videos, etc. shown here from other web pages; the link will go stale in about one hour and will no longer work after that.

You can download the files shown here by clicking on the file names or image. Note that you cannot link directly to the images, sounds, videos, etc. shown here from other web pages; the link will go stale in about one hour and will no longer work after that.

You can download the files shown here by clicking on the file names or image. Note that you cannot link directly to the images, sounds, videos, etc. shown here from other web pages; the link will go stale in about one hour and will no longer work after that.

This experiment has no video links

You can download the files shown here by clicking on the file names or image. Note that you cannot link directly to the images, sounds, videos, etc. shown here from other web pages; the link will go stale in about one hour and will no longer work after that.

Related Experiments