Shared Scripts, Data, Stimuli, Files, and Demos

Whack-a-moleFinalVersion Run Experiment

Whack-a-moleFinalVersion

Rogier

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.

 
// beginvariabelen
main.style("background-color","rgba(255,255,255,0)");
var scoreblock = main.addblock("right",20,20,20),
tijdblock = main.addblock("left",20,20,20),
t1,t2,RT,
totaal = 0,
scoreoefen = 0,
score = 0;

// instructies
text("Waar..."); // Welkom heten van de deelnemer
await(1500);
clear();
text("...is..."); // Welkom heten van de deelnemer
await(2000);
clear();
text("...de MOL?"); // Welkom heten van de deelnemer
await(3000);
clear();
titel = main.addblock("center",10,100,20);
titel.text("Welkom bij 'Waar is de MOL?'. Leuk dat u mee doet!");
logo = main.addblock("center",30,50,50);
preload("unknown.png");
image.await("preloading_completed");
logo.setimage("unknown.png");
await(4000);
main.removeblock(titel);
logo.destroy();
clear();
text("Doet u mee via uw smartphone?");
var ja = main.addblock("left",75,15,15, "grey"),
    nee = main.addblock("right",75,15,15, "grey");
    ja.text("Ja");
    nee.text("Nee");
waitfor
    {
        ja.await('click');
        controle = 1;
    }
or
    {
        nee.await('click');
        controle = 0;
    }
    ja.destroy();
    nee.destroy();
text("Gebruikt u nu Safari (Iphone)?");
var ja = main.addblock("left",75,15,15, "grey"),
    nee = main.addblock("right",75,15,15, "grey");
    ja.text("Ja");
    nee.text("Nee");
waitfor
    {
        ja.await('click');
        iphone = 1;
    }
or
    {
        nee.await('click');
        iphone = 0;
    }
    ja.destroy();
    nee.destroy();
if (controle === 1)
{
    log("smartphone", "smartphonecheck");
    var ok = main.addblock("center","bottom",25,25, "blue");
    text("Bij het klikken op OK gaat u akkoord met deelname aan dit experiment. De gegevens worden gebruikt door studenten van de Universiteit van Amsterdam. Het experiment is volledig anoniem.");
    ok.text("OK").style("font-weight","bold").style("color","white");
    await('click');
    main.removeblock(ok);
    clear();
    largeinput("Wat is uw leeftijd?", "leeftijd");
    radio("Wat is uw geslacht", ['man', 'vrouw', 'anders', 'dat zeg ik liever niet'], "gender");
    radio("Hoe vaardig bent u met uw telefoon? (bijvoorbeeld: typt u snel op whatsapp?)", ['niet zo vaardig', 'gemiddeld', 'heel vaardig'], "vaardigheid");
    ok = main.addblock("center","bottom",25,25, "blue");
    text("U gaat een whack-a-mole spel spelen. Tijdens dit klassieke spel verschijnen er mollen op het scherm. Aan u de taak om  ZO SNEL MOGELIJK op deze mollen te 'slaan'.");
    ok.text("OK").style("font-weight","bold").style("color","white");
    await('click');
    main.removeblock(ok);
    clear();
    ok = main.addblock("center","bottom",25,25, "blue");
    text("U verdient een punt wanneer u op tijd op de mol tikt. Let op: er verschijnen ook onschuldige konijnen. Laat deze met rust alstublieft, anders kost het minpunten.");
    ok.text("OK").style("font-weight","bold").style("color","white");
    await('click');
    main.removeblock(ok);
    clear();
    ok = main.addblock("center","bottom",25,25, "blue");
    text("Er volgen nu 3 oefenrondes. Druk op OK om te beginnen");
    ok.text("OK").style("font-weight","bold").style("color","white");
    await('click');
    ok.destroy();
    clear();

    // safari fix
    if (iphone === 1)
    {
    ok = main.addblock("center","bottom",10,10, "blue");
    text("Staat het gras in het midden van uw scherm? Zo niet, dan kunt u door middel van scrollen het gras in het midden zetten. Druk op de OK-knop als het gras in het midden staat.").style("font-weight","bold").style("color","blue");
    ok.text("OK").style("font-weight","bold").style("color","white");
    var backgroundbox = makebox('empty','wide-white');
                backgroundbox.toback();
                preload("lawn.jpg");
                image.await("preloading_completed");
                var background = backgroundbox.addblock(0,0,100,100);
                background.setimage("lawn.jpg");
                await('click');
                ok.destroy();
                clear();
    }


    // oefentrials
            for (i=0;i<3;i++)
            {
                await(1500);
                scoreblock.text("Oefenscore " + scoreoefen).style("font-weight","bold").style("color","white").style("font-size","75%");
                var backgroundbox = makebox('empty','wide-white');
                backgroundbox.toback();
                preload("lawn.jpg");
                image.await("preloading_completed");
                var background = backgroundbox.addblock(0,0,100,100);
                background.setimage("lawn.jpg");
                var images = ["mole.png","mole.png","mole.png","mole.png","rabbit.png"];
                    shuffle(images);
                    var whichimage = images[0],
                        horizontal = Math.round(Math.random() * 100),
                        vertical = Math.round(Math.random() * 70) + 10,
                        position = main.addblock(horizontal,vertical,10,10);
                        position.preload(whichimage);
                    image.await("preloading_completed");
                    position.setimage(whichimage);
                    if (whichimage === "rabbit.png")
                                    {
                                        konijn = 1;
                                        mol = 0;
                                    }
                                    else
                                    {
                                        mol = 1;
                                        konijn = 0;
                                    }
                        waitfor
                            {
                                await(1200);
                                position.destroy();
                                tijdom = 1;
                                raak = 2;
                            }
                        or
                            {
                                position.await('click');
                                position.hideimage();
                                raak = 1;
                                tijdom = 0;
                                if (whichimage === "rabbit.png")
                                    {
                                        konijn = 1;
                                        mol = 0;
                                    }
                                else
                                    {
                                         mol = 1;
                                         konijn = 0;
                                    }
                            }
                        or
                            {
                                background.await('click');
                                position.hideimage();
                                raak = 0;
                                tijom = 0;
                            }
                        or
                            {
                                main.centerblock.await('click');
                                position.hideimage();
                                raak = 0;
                                tijdom = 0;
                            }    
                    clear();
                    if (raak === 1 && mol === 1 && tijdom === 0) 
                    {
                        b = main.addblock();
                        b.text("Raak!").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        scoreoefen = scoreoefen + 1;
                        scoreblock.text("Score " + scoreoefen).style("font-weight","bold").style("color","white");
                    }
                    else if (raak === 0 && mol === 1 && tijdom === 0)
                    {
                        b = main.addblock();
                        b.text("Mis!").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        scoreblock.text("Score " + scoreoefen).style("font-weight","bold").style("color","white");
                    }
                    else if (mol === 1 && tijdom === 1 && raak === 2)
                    {
                        b = main.addblock();
                        b.text("Sneller!").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        scoreblock.text("Score " + scoreoefen).style("font-weight","bold").style("color","white");
                    }
                    else if (konijn === 1 && tijdom === 1 && raak === 2)
                    {
                        b = main.addblock();
                        b.text("Lief konijn").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        scoreblock.text("Score " + scoreoefen).style("font-weight","bold").style("color","white");
                    }
                    else if (konijn === 1 && raak === 0)
                    {
                        b = main.addblock();
                        b.text("Mis! Maar het was een konijn. Pas op!").style("font-weight","bold").style("color","white");
                        await(3000);
                        b.destroy();
                        scoreblock.text("Score " + scoreoefen).style("font-weight","bold").style("color","white");
                    }
                    else if (konijn === 1 && raak === 1)
                    {
                        b = main.addblock();
                        b.text("Konijn!").style("font-weight","bold").style("color","red").style("font-size","200%");
                        await(500);
                        b.destroy();
                        text("Laat het konijn met rust! Dit kost je punten...").style("font-weight","bold").style("color","white");
                        await(3000);
                        scoreoefen = scoreoefen - 1;
                        scoreblock.text("Score " + scoreoefen).style("font-weight","bold").style("color","white");
                        clear();
                    }
            }
            main.removeblock(scoreblock, true);
            text("Dit waren de oefenrondes. Er volgen nu 20 'echte' rondes! Zet m op! SLA ZO SNEL MOGELIJK!").style("color","white").style("font-weight","bold");
            await(6000);
            clear();
                var backgroundbox = makebox('empty','wide-white');
                backgroundbox.toback();
                preload("lawn.jpg");
                image.await("preloading_completed");
                var background = backgroundbox.addblock(0,0,100,100);
                background.setimage("lawn.jpg");
            
            // echte trials 
            for (i=0;i<20;i++)
            {
                await(1500);
                tijdblock.text("Reactietijd " + RT + " ms").style("font-weight","bold").style("color","white").style("font-size","75%");
                scoreblock.text("Score " + score).style("font-weight","bold").style("color","white").style("font-size","75%");
                var backgroundbox = makebox('empty','wide-white');
                backgroundbox.toback();
                preload("lawn.jpg");
                image.await("preloading_completed");
                var background = backgroundbox.addblock(0,0,100,100);
                background.setimage("lawn.jpg");
                var images = ["mole.png","mole.png","mole.png","mole.png","rabbit.png"];
                    shuffle(images);
                    var whichimage = images[0],
                        horizontal = Math.round(Math.random() * 100),
                        vertical = Math.round(Math.random() * 70) + 10,
                        position = main.addblock(horizontal,vertical,10,10);
                        position.preload(whichimage);
                    image.await("preloading_completed");
                    position.setimage(whichimage);
                    t1 = now();
                    if (whichimage === "rabbit.png")
                                    {
                                        konijn = 1;
                                        mol = 0;
                                    }
                                    else
                                    {
                                        mol = 1;
                                        konijn = 0;
                                    }
                        waitfor
                            {
                                await(1200);
                                position.destroy();
                                tijdom = 1;
                                raak = 2;
                            }
                        or
                            {
                                position.await('click');
                                position.hideimage();
                                raak = 1;
                                tijdom = 0;
                                if (whichimage === "rabbit.png")
                                    {
                                        konijn = 1;
                                        mol = 0;
                                    }
                                else
                                    {
                                         mol = 1;
                                         konijn = 0;
                                    }
                            }
                        or
                            {
                                background.await('click');
                                position.hideimage();
                                raak = 0;
                                tijom = 0;
                            }
                        or
                            {
                                main.centerblock.await('click');
                                position.hideimage();
                                raak = 0;
                                tijdom = 0;
                            }
                            t2 = now();      
                    clear();
                    if (raak === 1 && mol === 1 && tijdom === 0) 
                    {
                        b = main.addblock();
                        b.text("Raak!").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        score = score + 1;
                        scoreblock.text("Score " + score).style("font-weight","bold").style("color","white");
                        RT = t2 - t1;
                        RT = Math.round(RT);
                        log(RT, "reactietijd");
                        totaal = totaal + RT;
                        gemiddelde = Math.round((totaal)/20);
                    }
                    else if (raak === 0 && mol === 1 && tijdom === 0) 
                    {
                        b = main.addblock();
                        b.text("Mis!").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        scoreblock.text("Score " + score).style("font-weight","bold").style("color","white");
                    }
                    else if (mol === 1 && tijdom === 1 && raak === 2)
                    {
                        b = main.addblock();
                        b.text("Sneller!").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        scoreblock.text("Score " + score).style("font-weight","bold").style("color","white");
                        log("1","TeTraag");

                    }
                    else if (konijn === 1 && tijdom === 1 && raak === 2)
                    {
                        b = main.addblock();
                        b.text("Lief konijn").style("font-weight","bold").style("color","white");
                        await(1000);
                        b.destroy();
                        scoreblock.text("Score " + score).style("font-weight","bold").style("color","white");
                    }
                    else if (konijn === 1 && raak === 0)
                    {
                        b = main.addblock();
                        b.text("Mis! Maar het was een konijn. Pas op!").style("font-weight","bold").style("color","white");
                        await(3000);
                        b.destroy();
                        scoreblock.text("Score " + score).style("font-weight","bold").style("color","white");
                    }
                    else if (konijn === 1 && raak === 1)
                    {
                        b = main.addblock();
                        b.text("Konijn!").style("font-weight","bold").style("color","red").style("font-size","200%");
                        await(500);
                        b.destroy();
                        text("Laat het konijn met rust! Dit kost je punten...").style("font-weight","bold").style("color","white");
                        await(3000);
                        score = score - 1;
                        scoreblock.text("Score " + score).style("font-weight","bold").style("color","white");
                        clear();
                    }
            }
    main.removeblock(scoreblock);
    main.removeblock(tijdblock);
    ok = main.addblock("center","bottom",25,25, "blue");
    text("U heeft " + score + " punten gescoord! Goed gedaan. Uw gemiddelde reactietijd was " + gemiddelde + " miliseconden. Klik op OK om het experiment te beƫindigen alstublieft." );
    ok.text("OK").style("font-weight","bold").style("color","white");
    await('click');
    main.removeblock(ok);
    clear();
    log(score, "score");
    log(gemiddelde, "gemiddelde");
}
else
{
    text("U kunt alleen meedoen via uw smartphone. Dit experiment is speciaal daarvoor ontworpen. Open de uitnodigingslink via uw smartphone alstublieft.");
    await("8000");
    log("anders", "smartphonecheck");
}

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.

Related Experiments