Text Entry Interaction
Text entry interactions collect short free-text answers inline within a sentence or prompt.
Install
pnpm add @citolab/prose-qtiThe text entry interaction is exposed as a subpath export from @citolab/prose-qti, so you import it from @citolab/prose-qti/components/text-entry and register the custom elements with @citolab/prose-qti/components/text-entry/register.
Usage
Use the register side effect once, then call the insert command from your editor integration:
import '@citolab/prose-qti/components/text-entry/register';import { insertTextEntryInteraction } from '@citolab/prose-qti/components/text-entry';
insertTextEntryInteraction(view.state, view.dispatch);This package integrates with @qti-components/text-entry-interaction.
What it does
- Inserts a
qti-text-entry-interactioninline node. - Supports short typed responses inside running text.
- Exposes common QTI attributes such as expected length and case sensitivity through the editor’s attribute workflows.
In the editor
Inserts inline at the cursor position, rendering as a short input field inside a sentence. Edit attributes (expected length, case sensitivity, accepted answers) via the attributes panel.