There are lots of situations where you’ll want to randomize the order of your trials so that you can avoid potential order-of-presentation effects. This can easily be accomplished by setting the order
property of your block to randomized_trials
. But in blocks where you have multiple trial templates, it might be important to keep the trials across templates paired together, even if you want those yoked pairs to be presented in a random (but paired) order. This tutorial will show you how FindingFive can easily yoke trials across trial templates that are realized within a block, even if you want the yoked trials to be presented in a random order.
To demonstrate how to randomly order yoked trials in FindingFive, we’ll build a toy version of a simple associative priming lexical decision task. In this task, people are faster to say that a target stimulus (like the word nurse) is a real word when that stimulus is primed with a semantically-related word (like doctor) as compared to being primed with an unrelated word (like bread) (e.g., Meyer & Schvaneveldt, 1971). In our toy version, each trial will present a prime word for a short period of time before a target word appears. Then we’ll collect a yes/no two alternative forced choice response — and the response time of that choice — about whether the target is a word (e.g., nurse) or not (e.g., nrsue).
In the code snippet below, we create a trial template (primes_template
) whose stimuli consist of some prime words (p1, p2, p3, and p4) that we want to yoke to some target words that are defined in another trial template (targets_template
). Some of the primes will be semantically related to certain targets, and some won’t be. But crucially, we’ll want to control the pairing of primes to targets. (This means we want to control the randomization at the block level, not the trial template level. Therefore, we will not set the trial template stimulus_pattern
to random.)
"primes_template": {
"type": "basic",
"stimuli": ["p1", "p2", "p3", "p4"]
},
"targets_template": {
"type": "AFC",
"stimuli": ["t1", "t2", "t3", "t4"],
"responses": ["lexical_decision"]
}
If we wanted to present the prime-target yoked pairs in the exact order we listed them as stimuli in our trial templates (i.e., if we wanted the trial order to be p1-t1, p2-t2, p3-t3, p4-t4 for all participants), we would set the order
of our block to be alternate
.
"target_prime_lexical_decision_block": {
"trial_templates": ["primes_template", "targets_template"],
"pattern": {"order": "alternate", "repeat": 1} // the property "repeat" sets how many times the block will cycle through all trial templates in this block
}
As long as the trial templates in the block have the same number of trials (4 in the current example), we can pair the trials together in the order in which they are defined, and have the yoked pairs presented in a random order for each participant.
"target_prime_lexical_decision_block": {
"trial_templates": ["primes_template", "targets_template"],
"pattern": {"order": "alternate_random", "repeat": 1}
}
Using the above definition, one participant might see the ordering p2, t2, p4, t4, p1, t1, p3, t3, while the next participant might see the ordering p1, t1, p2, t2, p3, t3, p4, t4.
The above paring logic is not limited to two trial templates. As long as the templates define the same number of trials in a fixed order, the block can include an arbitrary number of these yoked templates. The alternate_random ordering pattern will always work through the templates left-to-right, selecting one trial from each, and yoke them together; then it will shuffle the relative ordering of the yoked sets of trials.