Skip to content

Match Interaction

Match interactions let candidates associate items from one set with items from another.

Install

Terminal window
pnpm add @citolab/prose-qti

The match interaction is exposed as a subpath export from @citolab/prose-qti, so you import it from @citolab/prose-qti/components/match and register the custom elements with @citolab/prose-qti/components/match/register.

Usage

Use the register side effect once, then call the insert command from your editor integration:

import '@citolab/prose-qti/components/match/register';
import { insertMatchInteraction } from '@citolab/prose-qti/components/match';
insertMatchInteraction(view.state, view.dispatch, view);

This package integrates with @qti-components/match-interaction.

What it does

  • Inserts a qti-match-interaction structure with matchable sets.
  • Supports authoring row and column labels directly in the editor.
  • Keeps matching semantics and QTI serialization tied to structured interaction nodes.

In the editor

Edit row and column labels directly in the table cells.