Task switching
Alternate between two judgement tasks on the same stimuli in a controlled AABB pattern, so switch and repeat trials can be compared.
When to use it
Section titled “When to use it”Use this for task-switching designs, where the cost of switching between two judgement rules is the measure: the same stimulus class is judged by rule A on some trials and rule B on others, and reaction times on switch trials (the rule just changed) are compared with repeat trials (same rule as before). The catch is the sequence: a plain shuffle gives you random, unbalanced switch rates. The pattern ordering spec pins the task sequence to a fixed skeleton, the classic AABB alternating-runs design, so every second trial is a switch, while everything else about the order stays random.
Trial file
Section titled “Trial file”| type | content | stimFormat | stim1 | trialText | trialTextOptions | trialTextPos | task | trialOrder | keyboard | key | button1 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| instructions | Each screen shows a letter and a digit, with the task cue above. LETTER: press F for a vowel and J for a consonant. NUMBER: press F for odd and J for even. | NEXT | |||||||||
| test | word | A7 | LETTER | allTrial | above | letter | 1: shuffle; pattern task letter letter number number | f j | f | ||
| test | word | K4 | LETTER | allTrial | above | letter | 1 | f j | j | ||
| test | word | E3 | NUMBER | allTrial | above | number | 1 | f j | f | ||
| test | word | U8 | NUMBER | allTrial | above | number | 1 | f j | j | ||
| test | word | G5 | LETTER | allTrial | above | letter | 1 | f j | j | ||
| test | word | O2 | LETTER | allTrial | above | letter | 1 | f j | f | ||
| test | word | T9 | NUMBER | allTrial | above | number | 1 | f j | f | ||
| test | word | I6 | NUMBER | allTrial | above | number | 1 | f j | j |
type,content,stimFormat,stim1,trialText,trialTextOptions,trialTextPos,task,trialOrder,keyboard,key,button1 instructions,"Each screen shows a letter and a digit, with the task cue above. LETTER: press F for a vowel and J for a consonant. NUMBER: press F for odd and J for even.",,,,,,,,,,NEXT test,,word,A7,LETTER,allTrial,above,letter,1: shuffle; pattern task letter letter number number,f j,f, test,,word,K4,LETTER,allTrial,above,letter,1,f j,j, test,,word,E3,NUMBER,allTrial,above,number,1,f j,f, test,,word,U8,NUMBER,allTrial,above,number,1,f j,j, test,,word,G5,LETTER,allTrial,above,letter,1,f j,j, test,,word,O2,LETTER,allTrial,above,letter,1,f j,f, test,,word,T9,NUMBER,allTrial,above,number,1,f j,f, test,,word,I6,NUMBER,allTrial,above,number,1,f j,j,
How it works
Section titled “How it works”Every stimulus is bivalent, a letter-digit pair like A7, so it affords both tasks and only the cue tells the participant which rule applies. The cue is drawn by trialText: the task name shows for the whole trial (trialTextOptions = allTrial) above the stimulus (trialTextPos = above). key carries the correct answer under that trial’s rule, so accuracy is scored per rule with no extra machinery.
The task column tags each row with its rule, and the program on the first row, 1: shuffle; pattern task letter letter number number, is what shapes the sequence. shuffle randomises the tagged rows as one group, and pattern then tiles the group so that the task values follow the skeleton letter, letter, number, number repeatedly: the classic alternating-runs design, where trials in an odd position within a pair are switch trials and even positions are repeats. Which specific stimulus lands in each slot still varies across participants.
At analysis time, the trial’s position in the pattern tells you switch versus repeat; the task column in the results tells you the rule. An unsatisfiable pattern (say, unequal counts of letter and number rows) halts the session with an error rather than running a broken sequence, so keep the two tasks’ row counts matched to the skeleton.
Variations
Section titled “Variations”- Random switches instead of a fixed pattern: write
1: shuffle; maxRun 2 taskfor at most two same-task trials in a row, or1: shuffle; alternate taskfor strict ABAB alternation. - Preparation interval: show the cue alone before the stimulus by giving the cue its own screen (
stim1the cue word,stim2the pair,presTime = 500,ISI = 0) instead oftrialText. - Score switch costs against a deadline: add
responseWindow = 2500so slow switch trials time out instead of stretching unbounded.