Meeting 2 reference: Repeated structure and trustworthy data
What you should be able to do
Eight-item Stroop pilot with correct condition labels, scoring, and safe summaries. Explain the logic and verify at least one normal and one edge case, using the actual saved data.
Concepts in context
A repeated procedure has a timeline, a list of timeline_variables,
and an order rule. One item supplies values for one pass through the
procedure. randomize_order: true changes order without
repairing the design. Sampling a subset and repeating the item set are
separate operations; use them only when the design requires them.
In v8, jsPsych.timelineVariable("name") creates a
placeholder for a direct parameter or data field. Inside your own
function, call jsPsych.evaluateTimelineVariable("name") to
get the current value immediately. Interpolating the placeholder into
HTML can yield [object Object]. The item procedure must be
active when you evaluate a variable.
Score in on_finish, after response data exists. Keyboard scoring guards null then calls compareKeys; button tasks compare numerical indices instead. The correct response comes from the item/design. Check it against the actual stimulus independently; a faulty answer key can make every downstream calculation look consistent but wrong.
Our accuracy denominator includes all task rows in the target block, including omissions. The RT mean includes correct responses with finite RT. Other research designs may specify different summaries, but must state them explicitly. A summary’s stimulus function runs when the end screen is reached, so it uses completed data. The supplied helper returns null for an undefined estimate and formats it as N/A.
Do not average instruction/fixation times with task RT. Do not silently drop errors from accuracy’s denominator. Use JSON to preserve types and parse CSV deliberately. A pilot contrast is descriptive; it does not justify population claims or selecting exclusions to obtain an expected effect.
What to check in your implementation
Workshop: eight Stroop rows, four per condition, each ink once in each condition. Synthetic key: 50% accuracy overall/by condition, two omissions, mean correct RT 800 ms overall, 600 congruent, 1000 incongruent. Assignment 2 deliberately expands to 16 balanced items.
Use the live exercises and workshop sheet as the practical sequence. Compare with the released reference solution after an attempt. The debugging guide provides a symptom-to-check table. Try one editable example and its practice check before the full task.
Questions to answer without copying the code
- Why does [object Object] appear in a stimulus?
- Does randomize_order guarantee equal conditions?
- What is the RT mean with zero correct answers?
Check your reasoning by running a small example; the instructor guide contains the expected explanations.
Reading (about 15 minutes)
Read timeline variables and random orders and the filtering/aggregation portions of data handling. Use the v8 migration notes when comparing older tutorials.
Preparation for the next checkpoint
Explain the two timeline-variable methods and the accuracy/RT denominators. See assessment and deadlines.