This 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 similar. 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, HTML font style formatting
This script begins with an instruction to ‘remember the following words’. Then it displays eight words, one at a time, for 2 seconds each, with a 1-second blank screen in between. Last, it displays a text field with a label asking the subject to type the words they remember. The subject’s response is automatically saved to the script’s data.
This script shows the eight words to be remembered using a “for-loop” rather than typing out the steps eight times (like in My 1st Script). This is a more concise and less error-prone way to produce an identical task.
This script is like Script 1, but using images. It begins with an instruction to remember the objects in the following images. Then it displays eight images, one at a time, for 2 seconds each, with a 1-second blank screen in between. Last, it displays a text field with a label asking the subject to type the objects they remember. The subject’s response is automatically saved to the script’s data.
This script shows four pairs of images, one pair at a time. For each pair, the subject has to click (or, if using a touchscreen, press) on the image they like more. The subject isn’t told what the common difference between the photos is, but in each pair, one image uses mostly warm colors (e.g., reds, oranges) and the other uses mostly cool colors (e.g., blues, greens). In this example, the experimenter is actually testing whether subjects tend to prefer warm or cool colors. After each click, the subject’s answer is logged as either “warm” or “cool” in the script’s data section. “Block”s are created and used in order to show images in different locations on the screen at the same time (i.e., to manage screen layout.
This script gives our word recall task a more complex design. It tests whether processing words more deeply leads subjects to remember them better, using a 2-condition, within-subjects design.
First, the subject is told to remember the following words, and also instructed to notice whether they’re written in upper- or lower-case. This elicits structural (shallow) processing. They write the words they remember. Again, the subject is told to remember the following words, but this time is instructed to think about the meaning of the word. This elicits semantic (deep) processing. Again, they write the words they remember. After these two trials, a short text explains the purpose of the experiment, and the subject is shown their score for both conditions.
This script also introduces how to write and use your own functions. First, we demonstrate the concept of putting some script inside a function by putting the for-loop from My 4th Script inside one. Then, we provide the script for and employ another handy function that automatically grades the subject’s answers. It compares the words they type to the original word list and produces a score of how many words they got correct.
Topics introduced: writing functions, multiple conditions, within-subjects design, log(), giving feedback by showing a variable within text.
This script has the basic stages of a psychological experiment, organized using comments. First, it goes over informed consent. If the subject does not consent, they are brought directly to the end. If they consent, they are given instructions for the task. Then, the experimental trials take place (the word memory task from My 1st Script). After this, the subject is asked a few demographic questions in different formats (e.g. Likert scale, drop-down menu). Last, there is a debriefing about the purpose and hypothesis, and the experiment concludes.