A-maze

Code
jspsych-maze (plugin)
maze-distractor-generator
maze-demos
Maze (older)

Current tools
Distractor generation (Hugging Face models)
Running A-maze in jsPsych
A-maze for kids
A-maze in other languages

Demos
All demos
Kid-friendly reading
Sentences with RT graph
Sentences without redo
Short vignettes
Natural Stories story

Background
What is A-maze?
Papers using A-maze
An argument for 'redo' mode
Adding a delay to 'redo' mode
Experiment design
Parameter considerations

Older tools
Original distractor generation (Boyce et al. 2020; Boyce & Levy 2023)
Install instructions
Basic use
Parameters
Advanced options
Ibex
Using Ibex for Maze
Hosting an Ibex-Maze server

Running A-maze in jsPsych

jspsych-maze is a plugin for jsPsych 7 that runs the Maze task in a web browser. It replaces the Ibex implementation, which is older.

On each screen the participant sees two words: the next word of the sentence and a distractor. They press e for the left word or i for the right word. The left/right position of the correct word is random unless you set it.

Setup

The plugin is two files, source/src/maze.js and source/src/maze_helper.js. Copy them into your jsPsych project and import the plugin:

import MazePlugin from "./maze.js";

const trial = {
  type: MazePlugin,
  correct: "The cat sat on the mat.",
  distractor: "x-x-x ends lady sum hid pro.",
  prompt: "<p>Press <b>e</b> for the left word, <b>i</b> for the right word.</p>",
};

correct and distractor are space-separated strings with the same number of words. The first distractor is x-x-x, because the first word has no context that could make a distractor bad.

With materials from the distractor generator (--format json), use timeline variables:

import { stimuli } from "./stimuli.js";   // written by distract.py --format json

const maze_trials = {
  timeline: [{
    type: MazePlugin,
    correct: jsPsych.timelineVariable("sent"),
    distractor: jsPsych.timelineVariable("distractor"),
    prompt: "",
    data: { item: jsPsych.timelineVariable("id"), condition: jsPsych.timelineVariable("item_type") },
  }],
  timeline_variables: stimuli,
  randomize_order: true,
};

The easiest way to start a new experiment is to copy one of the demo experiments in jspsych-maze (source/src/*-experiment.js), which you can build and serve with npm run start:<demo>. See the README for setup.

Mistakes: redo mode, delay and guard

With redo: true (the default), a mistake doesn’t end the sentence. The participant sees error_message for delay ms (default 500). Then redo_message appears, and they must pick the correct word to go on. This keeps data from the rest of the sentence and makes multi-sentence items possible. See An argument for ‘redo’ mode and Adding a delay for why.

After the delay there is a further error_guard (default 150 ms) before keys work again, so that a key still held down from the mistake isn’t counted as the next answer.

With redo: false, the trial ends at the first mistake, as in the traditional Maze task.

Data

Each trial records:

In redo mode, rt is the usual measure. The difference cumrt - rt shows how long recovering from a mistake took.

Customizing

The README has the full parameter table. The most useful options:

Collecting data

The plugin doesn’t save data itself; use whatever your platform provides. The demos include submit.js, which submits data once to Proliferate at the end of the experiment, or when the page is closed early. kid-maze-passages runs on Children Helping Science / Lookit, which saves jsPsych data automatically.