My 8th Script: Advanced Experiment Demo Experiment Run Experiment

My 8th Script: Advanced Experiment

howto_user

This is a complex word recall experiment that combines concepts from all seven previous scripts.

My 8th Script is a word recall experiment with 2 conditions and a between-subjects design. Subjects are given an ID number when they begin and assigned to condition 1 or 2 based on whether their ID is odd or even. In both conditions, subjects have to memorize 12 words, then type the words they can recall. During recall, they are shown a “cue word” for each word in the list (a word that is loosely-related and might help them remember, such as “crust” as a hint for “cake”). These word pairings were taken from real experimental materials, so that the level of relatedness was valid and consistent. The difference between condition 1 and 2 is that condition 2 is also shown the cue words during memorization, paired with the word they are related to. The goal is to see whether the cues become more useful when they are present during memorization too, as suggested by the Encoding Specificity Principle.

The script uses the same two functions as Script 6 (one containing the for-loop and one that scores subjects’ answers). It uses a block (like in Script 7) to show cue words at the bottom of the screen during recall. It incorporates the experimental elements (e.g., consent, demographic questions) seen in Script 3. Throughout the script, text is styled (in bold, underline, italics, size, color, and paragraphs) using HTML formatting.

Topics introduced: assigning subject IDs, between-subjects design, randomly assigning subjects to a condition

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.

// WORD LOOP FUNCTION (from Script 6)
function showmywords(vocab)
{
    for (i = 0; i<vocab.length; i = i + 1)
    {
        text(vocab[i]);
        await(2000);
        clear();
        await(1000);
    }
}

// AUTO-SCORE FUNCTION (from Script 6)
// Ignore the contents; this function is very complex. Just enjoy that it works!
function autoscorewords(answerkey, subjectsanswer, criterion)
{
    var correct = 0;
    criterion = criterion || 0.25; // typos up to 25% different are okay (e.g., parc instead of park, walsh instead of wash)
    r = subjectsanswer.split(/[^A-Za-z]+/);
    for(j = 0; j < answerkey.length; j = j + 1)
    {
        for(k = 0; k < r.length; k = k + 1) 
            {
            if(distance(answerkey[j].toUpperCase(),r[k].toUpperCase()) <= criterion*answerkey[j].length) {
                correct = correct + 1;
                break;
            }
        }
    }
    return correct;
}

// Now, the body of the experiment:

var target_words = ["CAKE","WORK","LIGHT","SMOOTH","SMOKE","BEING","ROUND","TREE","QUEEN","HAND","STUPID","SLEEP"],
    target_words_with_cues = ["CAKE<p>(crust)</p>","WORK<p>(adult)</p>","LIGHT<p>(head)</p>","SMOOTH<p>(butter)</p>","SMOKE<p>(drink)</p>","BEING<p>(exist)</p>","ROUND<p>(cabbage)</p>","TREE<p>(mountain)</p>","QUEEN<p>(lady)</p>","HAND<p>(tool)</p>","STUPID<p>(think)</p>","SLEEP<p>(deep)</p>"],
    blockforcuehints = main.addblock(10,80,80,10);
    // ^ In lines 57 & 69, we create a nice layout by showing text in this block

main.setfontsize(50);

// 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") // If they consent...
{

    // 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: target words are UNCUED during encoding
        instruction("This is a memory task. You will be shown 12 words, then asked to recall them. When you are responding, there will be loosely-related cue words shown on the screen too, which may jog your memory.");
        showmywords(target_words);
        blockforcuehints.text("<u>Cue words</u>: crust, adult, head, butter, drink, exist, cabbage, mountain, lady, tool, think, deep.");
        var uncued_typed = largeinput("Please type the words you can remember (not case-sensitive):","uncued_recalled");
        var uncued_returned = autoscorewords(target_words, uncued_typed);
        log(uncued_returned, "uncued_score");
        main.removeblock(blockforcuehints);
    }
    
    else // *odd* IDs are assigned to:
    {
        // Condition 2: target words are CUED during encoding
        instruction("This is a memory task. You will be shown 12 words to remember. Underneath each to-be-remembered word, there will be a loosely-related cue word inside brackets. You do not need to remember these cues. <b>You will only be asked to recall the top words.</b> When you are responding, the cue words will be shown on the screen too, which may jog your memory.");
        showmywords(target_words_with_cues);
        blockforcuehints.text("<u>Cue words</u>: crust, adult, head, butter, drink, exist, cabbage, mountain, lady, tool, think, deep.");
        var cued_typed = largeinput("Please type the words you can remember (not case-sensitive):","cued_recalled");
        var cued_returned = autoscorewords(target_words, cued_typed);
        log(cued_returned, "cued_score");
        main.removeblock(blockforcuehints);
    }
    
    // DEMOGRAPHIC QUESTIONS
    radio("What is your gender?",[["Female"],["Male"],["Other"],["Prefer not to say"]],"gender");
    select("What is your age?",range(0,100),"age");
    scale("On a scale of 1 to 5, how focused were you during this task?","Not at all focused","Very focused","focus_level");
    text("You selected {gender}, {age} years, and {focus_level} out of 5 for your level of focus.");
    await(3000);
    
    // DEBRIEF & CONCLUSION
    text("This experiment is based on the <i>Encoding Specificity Principle</i>, which says that the context in which a memory is made affects how easy it is to recall. We are investigating how the usefulness of cues changes in different contexts. We hypothesize that cues will be more helpful to recall when they are present during memorization (i.e., are part of the context in which the memory was made) than when they are not.<p><span style=color:grey;font-size:75%>Press space to continue.<span></p>");
    awaitkey("SPACE");
    clear();
    text("The experiment is now over. Thank you!");
    await(3000);
    clear();
}
else // If they do not consent...
{
    text("Experiment ended.");
    await(2000);
    clear();
}

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.

This experiment has no files of this type
This experiment has no files of this type
This experiment has no files of this type
This experiment has no YouTube links
This experiment has no files of this type