Skip to content

Extended text interaction

3.2.4 Extended Text Interaction — a block interaction that allows the candidate to enter an extended amount of text.

Also see the attributes shared by every interaction on the overview page. Note that toggleCorrectResponse() is a deliberate no-op here — free text has no single correct answer, so correct-response/show-correct-response have no visible effect.

Example

Explain, in your own words, why QTI 3.0 uses web components.
<qti-extended-text-interaction response-identifier="RESPONSE" expected-length="200" placeholder-text="Write your answer here...">
<qti-prompt>Explain, in your own words, why QTI 3.0 uses web components.</qti-prompt>
</qti-extended-text-interaction>

qti-extended-text-interaction

AttributeTypeNotes
expected-lengthnumberUsed to estimate the rendered <textarea>’s rows (ceil(expectedLength / 50)) when no explicit size class is set.
pattern-maskstringRegex the response must match, validated via ElementInternals.
placeholder-textstringPlaceholder shown when empty.
data-patternmask-messagestring (dataset)Custom validity message when pattern-mask fails.
classstringA qti-height-lines-N class overrides the computed row count directly.

Renders <textarea part="textarea"> with a fixed maxlength="5000" regardless of expected-length.