Skip to content

randomBlock

Experiments Surveys & forms

Groups consecutive trials into blocks and shuffles the order of the blocks while keeping each block’s trials together. Simultaneously it bounds the random column’s within-block shuffling. Use it when whole sections of the trial file (e.g. condition blocks) should appear in a random order across participants.

Put the same block number on every row of a block: consecutive rows sharing a value form one block, and the blocks appear in a random order while each block’s trials stay together.

  • One block identifier per row; a value change between neighbouring rows starts a new block.
  • Nesting uses space-separated identifiers, with the leftmost identifier as the outermost level: 1 1, 1 2, 2 1… Inner blocks only shuffle among blocks that share the same outer identifiers.
  • Rows with fewer levels than the deepest row are padded with 0 on the right.
  • Block randomization is automatic: it runs whenever the column contains any non-empty value; there is no separate on/off flag.
ValueEffect
empty cellThe trial stays in place and acts as a fixed separator: blocks before and after it shuffle only within their own segment
0 (explicit, at a level)Same as an empty cell at that level: fixed anchor / segment boundary
numeric identifier (1, 2…)Consecutive rows with the same value form a block; adjacent distinct blocks in the same segment shuffle their order
space-separated identifiers (1 2)Nested levels, left = outer
non-numeric identifier (A, B)Block splitting on value change works, but the fixed-separator behavior of 0/empty cells does not function next to letter identifiers. Prefer numeric identifiers
  • When the column is absent, or every cell is left blank, no block shuffling happens.
  • An empty cell behaves like 0: the row does not participate, stays put, and splits the segments around it.
  • random: the full randomBlock value (all levels together) bounds random’s within-block shuffle runs. Trials shuffle inside their block first, then the blocks shuffle as units.
  • randomPick: randomBlock is part of the pool grouping for legacy picking (together with type, random and randomPick, plus trialGroup and the timer label when that column exists). After picking, within-block shuffling is re-applied first, then block order is re-shuffled.
  • trialOrder sampling specs (trialOrder values like 1: sample 10): spec pools are split at randomBlock (and type/timer-label) boundaries. Plain block numbers combine fine with specs, but a spec written inside a randomBlock cell is rejected when the trial file is saved.
  • rules / block: distinct columns. block+rules is a separate mechanism applied before randomBlock, and those columns are not saved to results.
  • Advanced randomness: block-order shuffling always uses the local random generator. Unlike random’s trial shuffle, random.org is not used for block ordering, even when the project’s advanced randomness setting is on.

Two blocks in random order, trials inside each block fixed:

typestimFormatstim1randomBlock
test.pnga11
test.pnga21
test.pngb12
test.pngb22

Blocks shuffled and trials shuffled within each block:

typestimFormatstim1randomrandomBlock
test.pnga111
test.pnga211
test.pngb112
test.pngb212

Two-level nesting: inner blocks shuffle within their outer block. The row with the empty cell anchors the break screen in place, and because an empty cell (or 0) splits every level’s segments, it also prevents the two outer blocks from swapping across it. Remove that row if the outer blocks should shuffle as wholes:

typestimFormatstim1randomBlock
test.pnga11 1
test.pnga21 2
instructionsbreak
test.pngb12 1
test.pngb22 2
  • Letter identifiers can be silently corrupted (a label like banana is one example); stick to numeric identifiers.
  • Blocks do not keep their relative order: any two adjacent blocks in the same segment can swap. To pin block order, separate the blocks with a row whose randomBlock cell is empty (or 0), or leave the column empty entirely.
  • Non-contiguous rows with the same identifier are separate blocks (block boundaries are detected by a value change between neighbouring rows).

randomBlock appears in these worked recipes:

  • Nested block shuffle: Randomise the order of whole task sections and of the mini-blocks inside each section, keeping every block’s trials together.
  • Stream, then questions: Present a sequence of stimuli on one self-advancing study trial, then ask two scored questions about it, with each stream and its questions shuffled as one unit.
  • Serial recall: Play a digit sequence hands-free, then collect a typed recall of the whole sequence, scored against the correct order.
  • Attentional blink: Play a rapid serial stream with two embedded targets, then ask about both, with the second target’s report expected to suffer at short lags.