← Element library

Choice and text

MC Populated Blank

Fill a sentence blank by picking a choice.

Delivery

Respond, review and evaluate

Authoring

Visual editor available

Print

Print view available

A short passage titled "The Dog" ("The brown dog ran to the park. I gave it a stick. The dog sat down.") above the question "Pick a word that describes the dog." with a blank line and three radio-button choices: brown, ran and gave.
MC Populated Blank example

Try the interaction

Live example: @pie-element/mc-populated-blank@0.3.4 · players 1.0.0-beta.5.

Open all examples for this element →

Use it in an item

Map the tag to an exact package version and match the model ID to the markup. The item player loads the views. You can use any frontend framework.

{
  "elements": {
    "mc-populated-blank": "@pie-element/mc-populated-blank@0.3.4"
  },
  "markup": "<mc-populated-blank id=\"example\"></mc-populated-blank>",
  "models": [
    {
      "id": "example",
      "element": "mc-populated-blank",
      "prompt": "<div><p class=\"iat-align-center\"><strong>The Dog</strong></p><p>The brown dog ran to the park. I gave it a stick. The dog sat down.</p></div>",
      "template": "<span>Pick a word that describes the dog.</span> {{blank}}",
      "choiceMode": "text",
      "choices": [
        {
          "id": "choice-A",
          "labelHtml": "<div><p><span class=\"iat-text-large\">brown</span></p></div>"
        },
        {
          "id": "choice-B",
          "labelHtml": "<div><p><span class=\"iat-text-large\">ran</span></p></div>"
        },
        {
          "id": "choice-C",
          "labelHtml": "<div><p><span class=\"iat-text-large\">gave</span></p></div>"
        }
      ],
      "correctChoiceId": "choice-A",
      "hasAudio": false,
      "interactionMode": "populate_blank",
      "layoutProfile": "inline_sentence",
      "customType": "sel_r1-g_plusggg",
      "choiceLayout": "horizontal",
      "locale": "en_US"
    }
  ]
}

Embed an item · Embed authoring · Print integration

Responses and scoring

The controller defines scoring for this element. Browser scoring returns one outcome per element. Your application combines those outcomes into an item score and handles trusted server scoring.

Scoring, partial credit and rubrics →

Model, configuration and session reference

The model holds content, configuration controls the editor, and the session holds the response. Fields below come from generated JSON Schemas.

Schema version: @pie-element/mc-populated-blank@0.3.6. Example version: 0.3.4. Use the schema matching your content. Schema checks cover data structure; controller validation checks authoring rules.

model fields (34)
FieldTypeMeaningDefault / values
idRequiredstringIdentifier to identify the Pie Element in html markup, Must be unique within a pie item config.—
elementRequiredstringThe html Element tag name: the key in the item config's `elements` map, e.g. "multiple-choice"—
accessibilityCatalogsarrayQTI-aligned accessibility catalogs whose cards dock to content nodes by `data-catalog-idref`—
promptstringThe question prompt or item stem—
promptEnabledbooleanDetermines if prompt should show—
interactionModeMcpbInteractionModeHow the learner answers"populate_blank"
layoutProfilestringSelects the arrangement: `inline_sentence`, `audio_blank_only`, `token_sequence` or `stimulus_image_blank`; unset is block flow in DOM order. Lands on the root as `layout-<layoutProfile>`.—
choiceLayoutstringThe choices' direction, `horizontal` or `vertical`. Unset, choices are horizontal when the template is only `{{blank}}` or `interactionMode` is `audio_mc_only`, and vertical otherwise.—
layoutProfilePresetsobjectLayout limits keyed by `layoutProfile`, merged over the bundled preset of that name. Delivery applies the current profile's preset over `layoutLimits`.—
layoutLimitsobjectNumeric visual constraints, each a positive number; a key left out takes the CQT-tuned default—
audioButtonSkinunionThe listen button's images when `audioButtonSkinsByLocale` has none for the locale—
audioButtonSkinsByLocaleobjectThe listen button's images keyed by lower-case `locale`, its two-letter language, or `default`, tried in that order—
sentenceHtmlstringA sentence or stimulus (HTML) rendered between the audio and the template—
templatestringThe sentence (HTML); with `populate_blank` it holds exactly one `{{blank}}`—
choiceModeMcpbChoiceModeWhether the choices are text or images"text"
choicesarrayThe choice options for the question—
choiceGroupLabelstringThe choice group's accessible name when the item has no prompt to label it.—
correctChoiceIdstringThe `id` of the correct choice—
hasAudiobooleanIndicates if the item plays `audioUrl`—
autoplayAudioEnabledbooleanIndicates if the audio plays when the item loads—
autoplayAudioHeldbooleanSet by the player when the host holds autoplay; it outranks `autoplayAudioEnabled`—
completeAudioEnabledbooleanKeeps the item incomplete until the audio has played to the end—
audioUrlstringThe audio prompt's URL; required when `hasAudio` is set—
audioTranscriptstringTranscript text for the audio prompt. Not rendered by delivery: on `pie-section-player` the toolkit renders it from the item's accessibility catalog, gated by the learner's profile (PIE-902). It stays on the model for the print view, which has no toolkit, and renders it unconditionally until print resolves catalogs itself (PIE-904), and as the source the pie-api-aws import writes the card from.—
useFeatureButtonAudioboolean`true` plays the audio from the listen button, `false` from native audio controls. Unset, the `audio_blank_only`, `stimulus_image_blank` and `token_sequence` layouts use the listen button.—
localestringPicks the audio button skin; also the learner-facing strings' language when `language` is unset.—
languagestringThe learner-facing strings' language, as `@pie-lib/translator` reads it (`en_US`, `es_ES`, …).—
lockChoiceOrderboolean`false` shuffles the choices for a student; unset or `true` keeps the authored order.—
shufflebooleanThe older spelling of `lockChoiceOrder: false`, read only when `lockChoiceOrder` is unset. Deprecated: Use `lockChoiceOrder`.—
teacherInstructionsstringIndicates teacher instructions—
teacherInstructionsEnabledboolean`false` hides `teacherInstructions`; unset shows them, as in multiple-choice.—
printAnswerKeyboolean`false` leaves the answer key out of an instructor's printout; a student's never has it.—
customTypestringThe CQT `custom_type` whose bundled variant stylesheet applies, e.g. `sel_r1-_plusggg`—
sourceobjectProvenance metadata from the content import; the element does not read it.—

Named object types

AccessibilityCatalog
FieldTypeMeaningDefault / values
identifierRequiredstringSee the named type or the example model.—
cardsRequiredarraySee the named type or the example model.—
CatalogCard
FieldTypeMeaningDefault / values
catalogRequiredstringSee the named type or the example model.—
languagestringSee the named type or the example model.—
contentstringSee the named type or the example model.—
payloadCatalogCardPayloadSee the named type or the example model.—
SignLanguageCardPayload
FieldTypeMeaningDefault / values
signLangstringLanguage tag for the signed translation — BCP 47, which admits ISO 639-3 subtags for languages with no 639-1/2 code. "ase" is ASL, matching QTI 3 `xml:lang`. This is the language of the *adaptation*, not the item's base content language (AfA/PNP's `languageOfAdaptation`). The distinction is load bearing: a Spanish item's signed alternate is LSM, not ASL, so `signLang` must never be inferred from the item or assessment content language. Optional, and redundant on almost every card. The card's `language` states the same code and is the only field pie-players resolves a card on — resolution runs before anything knows the card is a signing card, so it can only key on the generic field — and the player falls back to it when this is absent. Author it only where the two differ: a card tagged with the item's content language (`language: 'en-US'`, `signLang: 'ase'`) so resolution reaches it by the default-language rung. The pie-api-aws importer emits `language` alone.—
mediaRequiredMediaAssetRefSee the named type or the example model.—
fragmentMediaFragmentRangeSee the named type or the example model.—
MediaAssetRef
FieldTypeMeaningDefault / values
versionRequirednumberSee the named type or the example model.—
idRequiredstringSee the named type or the example model.—
kindRequiredMediaKindSee the named type or the example model.—
sourcesRequiredarraySee the named type or the example model.—
posterstringSee the named type or the example model.—
thumbnailstringSee the named type or the example model.—
durationSecondsnumberSee the named type or the example model.—
tracksarraySee the named type or the example model.—
transcriptTranscriptRefSee the named type or the example model.—
labelstringSee the named type or the example model.—
descriptionstringSee the named type or the example model.—
langstringLanguage of the asset itself, as authored metadata. Sign-language cards leave it unset: the card's `language` already states the adaptation language, and a second copy is a second thing to keep in agreement.—
MediaSource
FieldTypeMeaningDefault / values
srcRequiredstringSee the named type or the example model.—
typestringMIME type, e.g. "video/mp4".—
widthnumberSee the named type or the example model.—
heightnumberSee the named type or the example model.—
bitratenumberSee the named type or the example model.—
TextTrackRef
FieldTypeMeaningDefault / values
srcRequiredstringSee the named type or the example model.—
kindRequiredstringSee the named type or the example model.—["captions","subtitles","descriptions","chapters","metadata"]
langRequiredstringSee the named type or the example model.—
labelRequiredstringSee the named type or the example model.—
defaultbooleanSee the named type or the example model.—
TranscriptRef
FieldTypeMeaningDefault / values
srcstringSee the named type or the example model.—
htmlstringSee the named type or the example model.—
plainTextstringSee the named type or the example model.—
langstringSee the named type or the example model.—
MediaFragmentRange
FieldTypeMeaningDefault / values
startSecondsRequirednumberSee the named type or the example model.—
endSecondsnumberSee the named type or the example model.—
SpokenAudioCardPayload
FieldTypeMeaningDefault / values
mediaRequiredMediaAssetRefSee the named type or the example model.—
fragmentMediaFragmentRangeSee the named type or the example model.—
McpbAudioButtonSkin
FieldTypeMeaningDefault / values
silentUrlRequiredstringImage URL for the button while the audio is not playing—
playingUrlRequiredstringImage URL for the button while the audio plays—
McpbChoice
FieldTypeMeaningDefault / values
idRequiredstringIdentifier of the choice, unique within the item; the session stores the picked one—
labelHtmlstringThe choice's content (HTML), shown when `choiceMode` is `text`—
imageUrlstringThe choice's image (URL), shown when `choiceMode` is `image`—
imageAltstringText alternative for `imageUrl`—
Open the complete JSON Schema
configuration fields (4)
FieldTypeMeaningDefault / values
promptMcpbFieldConfigureConfiguration for the prompt; `settings` and `label` are not read—
teacherInstructionsMcpbFieldConfigureConfiguration for the teacher instructions; `settings` and `label` are not read—
minAnswerChoicesnumberThe fewest choices `validate()` accepts2
maxAnswerChoicesnumberThe most choices `validate()` accepts; unset allows any number—

Named object types

McpbFieldConfigure
FieldTypeMeaningDefault / values
settingsbooleanIndicates if the item has to be displayed in the Settings Panel—
labelstringIndicates the label for the item that has to be displayed in the Settings Panel—
requiredbooleanIndicates if the item is required and the value cannot be empty—
Open the complete JSON Schema
session fields (9)
FieldTypeMeaningDefault / values
idstringIdentifier of the session—
elementstringThe element the session belongs to—
valuearrayThe picked choice id in a one-entry array, as multiple-choice stores it.—
choiceIdstringWhere older sessions hold the pick; read, never written. Deprecated: Sessions hold the pick in `value`.—
audioStartTimenumberWhen the first playback of the audio started (epoch milliseconds)—
audioEndTimenumberWhen the first playback of the audio ended (epoch milliseconds)—
waitTimenumberMilliseconds from `audioStartTime` to `audioEndTime`—
shuffledValuesarrayThe choice ids in the order a student saw them when `lockChoiceOrder` is `false`—
dataobjectWhere some sessions hold `shuffledValues`; read in preference to the root key—
Open the complete JSON Schema

How to use the schemas →

Accessibility and content requirements

PIE targets WCAG 2.2 AA. Provide clear prompts and media alternatives, and test the question with a keyboard and assistive technology. Manual testing is still incomplete; see the coverage notes below.

Accessibility and evidence · Element evidence and manual checks(opens in new tab)

Element package source(opens in new tab) · Example source(opens in new tab) · Snapshot cb30a68f