Skip to content

<oelt-mcq>

A scored question with one correct answer (mode="single", radios) or several (mode="multiple", checkboxes). It progressively enhances your markup into a native <fieldset> and reports one result on submit — the score reaches the LMS through your declared completion/score rules, with no hand-wired plumbing. Interaction type: choice.

<oelt-mcq id="q1" mode="single" key="b">
<p slot="prompt">Which statement is true?</p>
<oelt-option value="a">OELT wires each LMS by hand.</oelt-option>
<oelt-option value="b">OELT maps one model to four targets.</oelt-option>
<oelt-option value="c">OELT requires a build step.</oelt-option>
<p slot="correct">Correct — one model, four targets.</p>
<p slot="incorrect">Not quite — review the Key idea page.</p>
</oelt-mcq>

The element id must equal the manifest interaction id. Each answer is an <oelt-option value="…">.

AttributeDescription
idRequired. Interaction id; matches the manifest.
modesingle (default, radios) or multiple (checkboxes).
keyThe correct value(s), space-separated. Required unless manual-grade.
shuffleRandomize option order on load.
submit-labelSubmit button label (default Check answer).
retryAllow re-answering after feedback; re-emits on each submit.
manual-gradeNo key — emits result: "completed" for ungraded polls/surveys.

Slots: prompt (becomes the <legend>), correct / incorrect (feedback).

KeyAction
Tab / Shift+TabMove between the group and the submit button.
(single) Move and select within the radio group.
Space(multiple) Toggle the focused checkbox.
EnterSubmit.
  • The <fieldset>/<legend> associates the prompt with the group; radios announce “n of m”, checkboxes announce checked state.
  • On submit, focus moves to an aria-live="polite" feedback region so the result is announced.
  • Correctness is carried in text (a visually-hidden “Correct”/“Incorrect” prefix), never by color alone.

Emits oelt-interaction on submit:

  • single: result is passed if the chosen value equals key, else failed; score is 1 or 0; response is the chosen value.
  • multiple: passed only if the selected set equals the key set exactly; score is the proportion correct (0–1); response is the selected values.
  • manual-grade: result: "completed", no score.