← Element library

Matching and ordering

Categorize

Sort items into categories by dragging.

Delivery

Respond, review and evaluate

Authoring

Visual editor available

Print

No print view in this package

The prompt "Classify each shape as 2D (two-dimensional) or 3D (three-dimensional) based on their formulas." above empty "2D Shapes" and "3D Shapes" drop zones and six formula tiles, such as "Circle: A = πr²" and "Cube: V = s³".
Categorize example

Try the interaction

Live example: @pie-element/categorize@14.0.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": {
    "categorize": "@pie-element/categorize@14.0.4"
  },
  "markup": "<categorize id=\"example\"></categorize>",
  "models": [
    {
      "id": "example",
      "element": "categorize",
      "prompt": "<p>Drag each equation to the correct category: True or False.</p>",
      "promptEnabled": true,
      "categories": [
        {
          "id": "0",
          "label": "<strong>True</strong>"
        },
        {
          "id": "1",
          "label": "<strong>False</strong>"
        }
      ],
      "categoriesPerRow": 2,
      "choicesPosition": "above",
      "choicesLabel": "Equations",
      "choices": [
        {
          "id": "0",
          "content": "\\(6+3=9-2\\)",
          "categoryCount": 1,
          "correctResponseCount": 1
        },
        {
          "id": "1",
          "content": "\\(10-4=9-5\\)",
          "categoryCount": 1,
          "correctResponseCount": 1
        },
        {
          "id": "2",
          "content": "\\(17-9=9+17\\)",
          "categoryCount": 1,
          "correctResponseCount": 1
        },
        {
          "id": "3",
          "content": "\\(11+9=10+10\\)",
          "categoryCount": 1,
          "correctResponseCount": 1
        },
        {
          "id": "4",
          "content": "\\(14-4=5+5\\)",
          "categoryCount": 1,
          "correctResponseCount": 1
        },
        {
          "id": "5",
          "content": "\\(7+8=3\\times 5\\)",
          "categoryCount": 1,
          "correctResponseCount": 1
        }
      ],
      "correctResponse": [
        {
          "category": "0",
          "choices": [
            "3",
            "4",
            "5"
          ]
        },
        {
          "category": "1",
          "choices": [
            "0",
            "1",
            "2"
          ]
        }
      ],
      "lockChoiceOrder": true,
      "allowMultiplePlacementsEnabled": "No",
      "maxChoicesPerCategory": 0,
      "allowAlternateEnabled": false,
      "partialScoring": true,
      "minRowHeight": "120px",
      "fontSizeFactor": 1.2
    }
  ]
}

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/categorize@14.0.6. Example version: 14.0.4. Use the schema matching your content. Schema checks cover data structure; controller validation checks authoring rules.

model fields (40)
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`—
allowAlternateEnabledbooleanIndicates if alternate correct answers are allowed—
allowMaxChoicesPerCategorybooleanIndicates if author has the possibility to set maxChoicesPerCategory—
allowMultiplePlacementsEnabledMultiplePlacementsWhether choices may be placed in more than one category; `Set Per Choice` reads each choice's `categoryCount`. When unset, the element allows it exactly when a choice appears in more than one category of the correct response.—
alternatesarrayNot read by the element: alternate responses live in `correctResponse[].alternateResponses`. Default models include it.—
choicesRequiredarrayThe available choices—
categoriesPerRownumberThe number of columns in which to present the categories2
choicesPositionstringIndicates where the choices should be presented in relation to the categories.—["above","below","left","right"]
choicesLabelstringLabel to be displayed for the choices—
lockChoiceOrderbooleanShould the choices be shuffled or not—
promptstringThe question prompt or item stem—
promptEnabledbooleanIndicates if the prompt is enabled—
categoriesRequiredarrayThe categories in which choices may be placed—
correctResponsearrayThe defintion of the correct response to the question—
feedbackCategorizeFeedbackFeedback configuration—
maxChoicesPerCategorynumberIndicates the maximum number of choices from a category—
rationalestringIndicates the value for rationale—
partialScoringbooleanIndicates if partial scoring is enabled—
feedbackEnabledbooleanIndicates if Feedback is enabled—
rationaleEnabledbooleanIndicates if Rationale are enabled—
spellCheckEnabledbooleanIndicates if spellcheck is enabled for the author. Default value is true—
studentInstructionsEnabledbooleanIndicates if Student Instructions are enabled—
teacherInstructionsstringIndicates teacher instructions—
teacherInstructionsEnabledbooleanIndicates if Teacher Instructions are enabled—
notestringIndicates the note for the answer—
toolbarEditorPositionstringIndicates the editor's toolbar position which can be 'bottom' or 'top'"bottom"["bottom","top"]
rubricEnabledbooleanIndicates if Rubric is enabled—
scoringTypestringIndicates scoring type—["auto","rubric"]
languagestringIndicates the language of the component Supported options: en, es, en_US, en-US, es_ES, es-ES, es_MX, es-MX—
maxAnswerChoicesnumberMaximum number of choices—
rowLabelsarrayLabels shown beside each row of categories, one per row—
minRowHeightstringMinimum height of a category row, as a CSS length—
fontSizeFactornumberIndicates font size adjustment factor—
autoplayAudioEnabledbooleanIndicates if the audio for the prompt should autoplay—
autoplayAudioHeldbooleanSet by the player when the host holds autoplay; it outranks `autoplayAudioEnabled`—
completeAudioEnabledbooleanIndicates if the audio should reach the end before the item can be marked as 'complete'—
customAudioButtonCustomAudioButtonIndicates if the audio should be replaced with a custom audio button—
extraCSSRulesExtraCSSRulesHost-supplied CSS scoped to the element—

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.—
CategoryChoice
FieldTypeMeaningDefault / values
idRequiredstringIdentifier for the choice—
contentRequiredstringThe xhtml content for the choice—
categoryCountnumberHow many categories the choice may be placed in: 0 places it in any number of categories, 1 in one. Read when `allowMultiplePlacementsEnabled` is `Set Per Choice`; otherwise the element derives it from that key.—
correctResponseCountnumberHow often the choice appears in the correct response; the authoring view recomputes it on every render, so a stored value is not read—
Category
FieldTypeMeaningDefault / values
idRequiredstringIdentifier for the category—
labelRequiredstringThe label to display with the category.—
choicesarrayNot read by the element: the choices placed in a category come from the session's `answers`—
CategoryCorrectResponse
FieldTypeMeaningDefault / values
categoryRequiredstringThe identifier for the category—
choicesRequiredarrayArray of identifiers for the choices that belong in this category—
alternateResponsesarrayArray of alternatives correct choices—
CategorizeFeedback
FieldTypeMeaningDefault / values
correctFeedbackLevelIndicates the configuration for feedback when answer is correct—
incorrectFeedbackLevelIndicates the configuration for feedback when answer is incorrect—
partialFeedbackLevelIndicates the configuration for feedback when answer is partially correct—
FeedbackLevel
FieldTypeMeaningDefault / values
typeRequiredstringIndicates the feedback type—["default","custom","none"]
defaultstringIndicates the feedback value—
customstringIndicates the feedback custom value—
CustomAudioButton
FieldTypeMeaningDefault / values
playImageRequiredstringimage url for the play state—
pauseImageRequiredstringimage url for the pause state—
ExtraCSSRules
FieldTypeMeaningDefault / values
namesarraySee the named type or the example model.—
rulesstringSee the named type or the example model.—
Open the complete JSON Schema
configuration fields (35)
FieldTypeMeaningDefault / values
baseInputConfigurationEditableHtmlConfigurePropBase editable html input configuration regarding plugins that are enabled/disabled E.g. audio, video, image—
partialScoringConfigurePropPartial Scoring configuration—
rationaleEditableHtmlPluginConfigureRequiredRationale configuration—
spellCheckConfigurePropWithEnabledConfiguration for the author's spellcheck; `enabled` is not read, the model's `spellCheckEnabled` turns it on—
feedbackConfigurePropWithEnabledSettings Panel control for feedback; `enabled` is not read—
lockChoiceOrderConfigurePropSettings Panel control for locking the choice order—
allowMultiplePlacementsConfigurePropSettings Panel control for multiple placements of a choice—
maxPlacementsConfigurePropSettings Panel control for the maximum number of choices per category—
allowAlternateConfigurePropSettings Panel control for alternate correct answers—
categoriesPerRowConfigurePropSettings Panel control for the number of categories per row—
scoringTypeConfigurePropScoring Type configuration—
settingsPanelDisabledbooleanIndicates if the settings panel is not available—
studentInstructionsConfigurePropStudent Instructions configuration—
teacherInstructionsEditableHtmlPluginConfigureRequiredTeacher Instructions configuration—
promptEditableHtmlPluginConfigureRequiredConfiguration for the prompt—
headersEditableHtmlPluginConfigureConfiguration for the headers—
rowLabelsEditableHtmlPluginConfigureConfiguration for the row labels—
toolbarEditorPositionConfigurePropNot read by the authoring surface; the model's `toolbarEditorPosition` sets the position—
minChoicesnumberMinimum number of choices1
maxChoicesnumberMaximum number of choices, shown in the authoring validation message; `validate()` checks the model's `maxAnswerChoices`—
minCategoriesnumberMinimum number of categories1
maxCategoriesnumberMaximum number of categories12
maxLengthPerChoicenumberMaximum length of a choice's text, in characters300
maxLengthPerCategorynumberMaximum length of a category label's text, in characters150
choicesPositionConfigurePropPosition of the choices—
mathMlOptionsConfigureMathMLPropConfiguration for editable-html—
minCategoriesPerRownumberMinimum value of categories per row1
maxImageWidthMaxImageDimensionsMaximum image width for input fields—
maxImageHeightMaxImageDimensionsMaximum image height for input fields—
withRubricConfigurePropRubric configuration - only relevant in environments that use pie-player-components—
languageConfigurePropWithEnabledLanguage configuration—
languageChoicesConfigureLanguageOptionsLanguage choices configuration Only available if language is enabled—
allowMaxAnswerChoicesConfigurePropConfiguration for maximum number of choices—
contentDimensionsContentDimensionsDimensions of the authoring container—
settingsPartialScoringbooleanNot read by this element: `partialScoring.settings` shows the partial scoring control—

Named object types

EditableHtmlConfigureProp
FieldTypeMeaningDefault / values
mathEditableHtmlButtonConfigureSee the named type or the example model.—
audioEditableHtmlButtonConfigureSee the named type or the example model.—
videoEditableHtmlButtonConfigureSee the named type or the example model.—
imageEditableHtmlButtonConfigureSee the named type or the example model.—
customPluginsarrayAn array of objects that determine custom plugins. A custom plugin is an object which determines how the button will look like (icon) and the event name that will be triggered when the button gets pressed (event).—
blockquoteEditableHtmlButtonConfigureSee the named type or the example model.—
h3EditableHtmlButtonConfigureSee the named type or the example model.—
charactersEditableHtmlButtonConfigureSee the named type or the example model.—
boldEditableHtmlButtonConfigureSee the named type or the example model.—
htmlEditableHtmlButtonConfigureSee the named type or the example model.—
italicEditableHtmlButtonConfigureSee the named type or the example model.—
ol_listEditableHtmlButtonConfigureSee the named type or the example model.—
redoEditableHtmlButtonConfigureSee the named type or the example model.—
strikethroughEditableHtmlButtonConfigureSee the named type or the example model.—
subEditableHtmlButtonConfigureSee the named type or the example model.—
supEditableHtmlButtonConfigureSee the named type or the example model.—
tableEditableHtmlButtonConfigureSee the named type or the example model.—
ul_listEditableHtmlButtonConfigureSee the named type or the example model.—
underlineEditableHtmlButtonConfigureSee the named type or the example model.—
undoEditableHtmlButtonConfigureSee the named type or the example model.—
textAlignEditableHtmlButtonConfigureSee the named type or the example model.—
showParagraphsEditableHtmlButtonConfigureSee the named type or the example model.—
separateParagraphsEditableHtmlButtonConfigureSee the named type or the example model.—
pasteFormattingEditableHtmlButtonConfigureSee the named type or the example model.—
superscriptEditableHtmlButtonConfigureSee the named type or the example model.—
subscriptEditableHtmlButtonConfigureSee the named type or the example model.—
languageCharactersEditableHtmlButtonConfigureSee the named type or the example model.—
responseAreaEditableHtmlButtonConfigureSee the named type or the example model.—
EditableHtmlButtonConfigure
FieldTypeMeaningDefault / values
disabledbooleanIndicates if the plugin is disabled or not—
CustomPlugin
FieldTypeMeaningDefault / values
eventRequiredstringThe name of the custom event. It needs to be valid (only letters, numbers and "_" can be used). The event is emitted with the "PIE-" prefix.—
iconAltRequiredstringThe alt for the custom button icon—
iconTypeRequiredstringThe icon type. Currently, only "SVG" is supported.—
iconRequiredstringThe icon string. Currently, only SVG is supported, so it needs to be a valid svg.—
ConfigureProp
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—
EditableHtmlPluginConfigureRequired
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—
inputConfigurationEditableHtmlConfigurePropConfiguration for editable-html—
requiredbooleanIndicates if the item is required and the value cannot be empty—
ConfigurePropWithEnabled
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—
enabledbooleanIndicates the value of the item if it affects config-ui (eg.: if item is a switch and displaying an input on the config-ui depends on the switch value: on/off)—
EditableHtmlPluginConfigure
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—
inputConfigurationEditableHtmlConfigurePropConfiguration for editable-html—
ConfigureMathMLProp
FieldTypeMeaningDefault / values
mmlOutputbooleanIndicates if model should have mathML output instead of latex—
mmlEditingbooleanIndicates if mathML that's already in model should be editable—
MaxImageDimensions
FieldTypeMeaningDefault / values
teacherInstructionsnumberIndicates the max dimension for images in teacher instructions—
promptnumberIndicates the max dimension for images in prompt - this is also the default dimension for all other input fields if it's not specified—
rationalenumberIndicates the max dimension for images in rationale—
choicesnumberIndicates the max dimension for images in choices—
rowLabelnumberIndicates the max dimension for images in row labels—
categoryLabelnumberIndicates the max dimension for images in category labels—
ConfigureLanguageOptions
FieldTypeMeaningDefault / values
labelRequiredstringSee the named type or the example model.—
optionsRequiredarraySee the named type or the example model.—
ConfigureLanguageOptionsProp
FieldTypeMeaningDefault / values
valueRequiredstringValue of the language option—
labelRequiredstringLabel of the language option—
ContentDimensions
FieldTypeMeaningDefault / values
maxHeightstring | numberSee the named type or the example model.—
maxWidthstring | numberSee the named type or the example model.—
minHeightstring | numberSee the named type or the example model.—
minWidthstring | numberSee the named type or the example model.—
Open the complete JSON Schema
session fields (8)
FieldTypeMeaningDefault / values
idstring | numberIdentifier of the session; the correct-response session carries the number 1—
elementstringThe element the session belongs to—
answersarrayThe choices placed in each category—
selectorstringThe input that made the last change; the delivery writes `Mouse`—
audioStartTimenumberWhen auto-played prompt audio started, in epoch milliseconds—
audioEndTimenumberWhen auto-played prompt audio ended, in epoch milliseconds—
waitTimenumberMilliseconds the learner waited for auto-played prompt audio to finish—
shuffledValuesarrayChoice ids in the order they were shuffled for this learner, when choice order is not locked—

Named object types

CategorizeAnswer
FieldTypeMeaningDefault / values
categoryRequiredstringThe identifier for the category—
choicesRequiredarrayIdentifiers of the choices placed in the category—
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