Shared Scripts, Data, Stimuli, Files, and Demos

randomtings Run Experiment

randomtings

Aisha's screen

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.

 
preload("ourmap.jpg");

var coords = [[10,10],[20,40],[20,80],[40,30],[45,60], // block coordinates %
          [60,10],[60,75],[70,50],[80,20],[85,45]];    // [[left,top], ...]
          // Blocks 0 to 9

var stimuli_corsibasics = [
    [[],                 [] ],    
    [[1],                [1] ],
    [[9,7],              [6,3] ],
    [[5,8,0],            [6,9,4] ],    
    [[7,2,8,6],          [6,0,3,9] ],    
    [[4,2,0,3,1],        [7,5,8,3,0] ],    
    [[3,9,2,4,8,7],      [6,1,9,4,7,3] ],    
    [[4,1,7,9,3,0,6],    [6,9,1,7,4,2,8] ],    
    [[3,8,2,9,6,1,7,4],  [5,0,1,3,2,6,4,7] ],    
    [[2,7,0,8,6,3,1,9,4],[7,1,3,9,4,2,5,6,8] ]    
];

function shortalert(message,ms_ok,left,top,width,height,color)
{
    ms_ok = ms_ok || 1000;
    left = left || 30;
    top = top || 20;
    width = width || 40;
    height = height || 20;
    color = color || '#f5f5dc';
    
    var b = addblock(left,top,width,height,color,message);

    if ($.type(ms_ok) === 'number')
    {
        await(ms_ok);
    }
    else
    {
        var b_ok = addblock(left+width-9,top+height-7,7,5,'lightgrey',ms_ok);
        b_ok.style('font-size','70%')
            .style('border','solid #a9a9a9 thin')
            .style('cursor','pointer')
            .style('opacity','0.7');
        b_ok.await('click');
        b_ok.destroy();
    }
    
    b.destroy();
}


function show_flash(e)
{
    var x = addblock(e.event.layerX*100/e.event.target.clientWidth - 2.5,
             e.event.layerY*100/e.event.target.clientHeight - 2.5,
             5,5)
             .style('color','red')
             .icon('star');
    await(250);
    x.destroy();
}

function show_start()
{
    main.style('background-color','beige');
    await(250);
    main.style('background-color','white');
}

function show_blinks(series,blocks,block_color)
{
    var i, b, b_start;    

    for (i = 0; i < series.length; i++)              // 'Play' series
    {
        b = series[i]; // [2,5,...] i = 0 -> b = 2
        blocks[b].style("background-color","black");
        await(500);
        blocks[b].style("background-color",block_color);
        await(500);
    }
    
    show_start();
}

function corsibasics_example()
{
    main.setfontsize(60);

    var blocks = [], i, b, series, e, block,
        block_color = "lightgrey",
        span = 2, errors, attempts = 0, correct = 0,  total_correct = 0, 
        kessels_score; 
    
    instruction('You will see a number of blocks turn black in sequence.'
    + ' Afterwards, you must click the blocks in the same order.'
    + ' You will see different sequences. They get longer each time.','OK', 'Instruction');
    
    instruction('We will start with an example so you can practice.', 'OK', ' ');
    instruction("After each sequence, there will be a short 'flash' of the background. Then you can click the blocks in the same order.", 'OK', ' ');

    for (i = 0; i < coords.length; i++) // Create block layout, use `i` as id
    {
        blocks.push(addblock(coords[i][0],coords[i][1],10,10,block_color,'',i));
    }
    
    await(1000);
    series = [3,6];
    
    show_blinks(series,blocks,block_color);

    errors = 0;
    for (i = 0; i < 2; i++)              // Have subject click series
    {
        e = await("click",4000);                 // Event `e` also contains target node
        if (e.type !== 'timeout')
        {
            b = parseInt(e.event.target.id);    // parseInt turns a string into a number or NaN on strange behavior (drag or click anywhere)

            if (e.event.target.id === 'undefined' || isNaN(b))
            {
                show_flash(e);
                i--;
                continue;
            }

            blocks[b].blink("black",250);       // 250 ms blink to black
            if (series[i] !== b)                // Count errors
            {
                ++errors;
                console.log("Error? ",i,series,series[i],b);
            }
            
            console.log(series[i],b,errors)
        }
        else
        {
            alert("The idea is that you click the blocks that were just shown. Let's start over.");
            await(1000);
            show_blinks(series,blocks,block_color);
            i = -1;
            errors = 0;
            continue;
        }
    }

    await(500);

    
    if (errors > 0)
    {
        alert("Make sure you click the blocks in the same order as shown.");
    }
    else
    {
        shortalert('Correct!',null,null,null,25,15);
    }
    
    await(2000);
    series = [4,2,9];

    show_blinks(series,blocks,block_color);

    errors = 0;
    for (i = 0; i < 3; i++)              // Have subject click series
    {
        e = await("click",2000);                 // Event `e` also contains target node
        if (e.type !== 'timeout')
        {
            b = parseInt(e.event.target.id);    // parseInt turns a string into a number or NaN on strange behavior (drag or click anywhere)

            if (e.event.target.id === 'undefined' || isNaN(b))
            {
                show_flash(e);
                i--;
                continue;
            }

            blocks[b].blink("black",250);       // 250 ms blink to black
            if (series[i] !== b)                // Count errors
            {
                ++errors;
            }
        }
    }

    await(500);
    
    if (e.type === 'timeout')
    {
        alert("The idea is that you click the blocks that were just shown.");
    }
    else if (errors > 0)
    {
        alert("Make sure you click the blocks in the same order as shown.");
    } 
    else if (errors === 0)
    {
        shortalert('Correct!',null,null,null,25,15);
    }
    
    await(2000);

    for (i = 0; i < blocks.length; i++) // Clear the blocks
    {
        blocks[i].destroy();
    }
    blocks = [];
    
    log(total_correct,"total_correct_corsibasics_example"); 
}

function corsibasics()
{
    main.setfontsize(60);

    var blocks = [], i, b, series, e, block,
        block_color = "lightgrey",
        span = 2, errors, attempts = 0, correct = 0,  total_correct = 0, 
        kessels_score; 
    
    for (i = 0; i < coords.length; i++) // Create block layout, use `i` as id
    {
        blocks.push(addblock(coords[i][0],coords[i][1],10,10,block_color,'',i));
        blocks.setimage("ourmap.jpg")
    }
    
    while (true)   // Do 'forever', but really only until `break` is called
    {
        await(2000);
        series = stimuli_corsibasics[span][attempts];
        
        show_blinks(series,blocks,block_color);
 
        errors = 0;
        for (i = 0; i < span; i++)              // Have subject click series
        {
            e = await("click");                 // Event `e` also contains target node
            b = parseInt(e.event.target.id);    // Convert string to number or NaN on strange input

            if (e.event.target.id === 'undefined' || isNaN(b))
            {
                show_flash(e);
                i--;
                continue;
            }

            blocks[b].blink("black",250);       // 250 ms blink to black
            if (series[i] !== b)                // Count errors
            {
                ++errors;
            }
        }   
        
        ++attempts;
        if (errors === 0)
        {
            ++correct;
            ++total_correct
            if (attempts === 2)             // If twice correct, increase span
            {
                ++span;
                attempts = 0;
                correct = 0;
            }
        }
        else if (errors > 0)
        {
            if (attempts === 2)             // If twice incorrect, potentially stop test
            {
                if (correct === 0)
                {
                    --span;
                    kessels_score = span * total_correct; // Kessels et al. (2000)
                    break;                      // Break out of while loop
                }
                else
                {
                    ++span;
                    attempts = 0;
                    correct = 0;
                }
            }
        }
    } 
    
    for (i = 0; i < blocks.length; i++) // Clear the blocks
    {
        blocks[i].destroy();
    }
    blocks = [];
    
    response.span = span;
    
    console.log("Corsi Span: ",span,"  Kessels Score: ",kessels_score);

    log(total_correct,"total_correct_corsibasics"); 
    log(span,"span_corsibasics");
    log(kessels_score,"kessels_score_corsibasics");

}

// trying the map
var centerblock = addblock("center","center",125,90); 
centerblock.setimage("ourmap.jpg");


// Note that data are stored only if you have a paid NeuroTask account
main.setfontsize(60);
instruction("Welcome to the Corsi Block Tapping Task","OK"," ");
corsibasics_example();
instruction("Now for the actual test. You will no longer receive feedback.","OK"," ");
corsibasics();
instruction("Your span is {span} blocks. 

Thank you for participating!","OK"," "); //demographics input("please indicate your age in years","age"); select("What is your gender?",[['male',0],['female',1],["prefer not to say",2]],"gender"); select("What is your ethnicity?",[['African American',0],['Caucasian',1],['Asian',2],['Hispanic',3],['Middle Eastern or North African',4], ['Native Hawaiian or other Pacific Islander',5], ['Mixed Race',6],['Other',7]],"ethnicity"); if (response.ethnicity == 6 || response.ethnicity == 7) { input("Please specify your ethnicity further.", 'ethnicity_specified'); } else { clear(); } //Questionnaire text("Thank you for completing the IAT. Now, the short questionnaire will begin. Please press the space bar when you are ready."); awaitkey("SPACE"); clear(); main.setfontsize(60); scale("To what extent did major events like wars, economic crises, or social changes, affect you and your family line's opportunities and life?", "Doesn't apply at all","Applies a lot","historical_impact"); // marginalization clear(); scale("To what extent did your family line face unfair barriers or policies that made it harder for your generation to get an education, find a job, or have a place to live?", "Doesn't apply at all","Applies a lot","systematic_disadvantages"); // exploitation clear(); scale("To what extent do people in your family talk openly about the challenges and perspectives they experienced throughout their lifetime?", "Doesn't apply at all","Applies a lot","intergenerationl_discourse"); clear(); scale("How much do you feel like your family line or you deal with stereotypes or negative beliefs from others?", "Doesn't apply at all","Applies a lot","social_stigma"); clear(); scale("Do you feel that you've taken on your family's past hardships, and they are affecting you negatively?", "Doesn't apply at all","Applies a lot","resource_access"); //internalised oppression clear(); scale("How much do you sense that your family experiences a feeling of powerlessness when it comes to the circumstances they face in life?", "Doesn't apply at all","Applies a lot","oppression_awareness"); clear(); //Manipulation check for questionnaire scale("Intergenerational oppression is the phenomenon where the challenging experiences endured by previous generations in your family, including surviving wars, societal struggles, and discrimination, can significantly impact your current life opportunities, overall well-being, and how you perceive yourself. Please indicate to what extent you feel this concept applies to you:", "Doesn't apply at all","Applies a lot","oppression_manipulation"); clear(); //Debrief text("This concludes our experiment. Thank you for your time. The goal of this experiment was to investigate whether intergenerational oppression influences implicit self-esteem."); await(5000); clear();

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