Skip to content

Generating Trials from Stimulus Lists

Experiments

Instead of writing one trial row per stimulus, you can point a single row at an uploaded stimulus list. Testable expands that row into one trial per list item, which keeps your stimulus content separate from the trial structure and makes it easy to randomise, sample, and reuse the same set across experiments.

  1. Upload your list file in the Files tab (e.g. stimuli.csv).
  2. In your trial file, set stim to the list name without the extension: stim = stimuli.
  3. Set stimFormat to list.

At runtime Testable reads the file and generates one trial per item:

type,stimFormat,stim,listOptions
test,list,sounds,random

The trial type (image, audio, video, word) is derived from the file extension of the first stimulus picked from the list.

The listOptions column controls how items are drawn from the list:

ValueBehaviour
seqDefault. Items are drawn sequentially, in file order
randomItems are shuffled
sample XRandomly sample X items from the list
repeat XRepeat the entire list X times (use at least 2 to present the list twice)
group XDivide the list into consecutive groups of X rows; further operations act on the groups as units
sample X min YSample X items, guaranteeing at least Y full copies of the list
sample X max YSample X items, with each unique item appearing at most Y times

By default sample picks each item at most once; raise max to allow repeats, or use min to guarantee whole copies of the list.

Separate multiple options with a comma. Operations are applied in order, so the sequence matters:

listOptionsBehaviour
repeat 2, randomDuplicate the list, then randomise all items
random, repeat 2Randomise the list, then repeat that randomised order
group 2, randomDivide into groups of 2, then randomise the groups (pairs stay adjacent and internally ordered)
sample 20, repeat 3Randomly pick 20 items, then repeat that selection 3 times

Multiple lists in one stim column, separated with semicolons:

stimstimFormat
list1; list2list

Lists in separate stim columns:

stim1stim2stimFormat
list1list2list

Both forms behave the same: the stim columns are pooled, and the lists at each position are merged per pick.

When using multiple lists, separate the options for each list with semicolons in listOptions, in the same order as the list names:

stimlistOptionsBehaviour
list1randomlist1 is randomised
list1; list2randomBoth lists are independently randomised
list1; list2random; seqlist1 is randomised, list2 stays sequential
list1; list2random, repeat 2; repeat 2, randomlist1 is randomised then repeated; list2 is repeated then randomised

A list with no options of its own inherits the previous list’s options (that is why a single random shuffles both lists above). An explicitly empty group (;;) resets to seq.

When results are saved from experiments using stimulus lists:

  • stim_actual stores the actual stimulus filenames drawn from the list.
  • rowNo uses a special notation to track list items and repetitions:
rowNoMeaning
3-3Generated from trial file row 3; 3rd item from the first list was shown
5-2-4Generated from trial file row 5; 2nd item from list 1 and 4th from list 2
5-2-4_2Same trial shown a second time (e.g. via repeat)

Each row in the list CSV represents one trial; column headers map directly to trial file columns. For example:

stim,stim2,condition
images/cat.jpg,images/dog.jpg,control
images/bird.jpg,images/fish.jpg,experimental

This generates two trials, each with two stimuli and a condition label. The column headers must exactly match the column names used in your trial file.