@pie-qti/item-player 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -18
- package/dist/catalog/applyGlossaryTriggers.d.ts +15 -0
- package/dist/catalog/applyGlossaryTriggers.d.ts.map +1 -0
- package/dist/catalog/applyGlossaryTriggers.js +193 -0
- package/dist/catalog/catalogExtractor.d.ts +18 -0
- package/dist/catalog/catalogExtractor.d.ts.map +1 -0
- package/dist/catalog/catalogExtractor.js +114 -0
- package/dist/catalog/catalogLookup.d.ts +18 -0
- package/dist/catalog/catalogLookup.d.ts.map +1 -0
- package/dist/catalog/catalogLookup.js +44 -0
- package/dist/catalog/glossaryAction.d.ts +17 -0
- package/dist/catalog/glossaryAction.d.ts.map +1 -0
- package/dist/catalog/glossaryAction.js +21 -0
- package/dist/catalog/types.d.ts +26 -0
- package/dist/catalog/types.d.ts.map +1 -0
- package/dist/catalog/types.js +6 -0
- package/dist/core/ComponentRegistry.d.ts +14 -4
- package/dist/core/ComponentRegistry.d.ts.map +1 -1
- package/dist/core/ComponentRegistry.js +25 -4
- package/dist/core/ItemRenderer.d.ts.map +1 -1
- package/dist/core/ItemRenderer.js +8 -18
- package/dist/core/Player.d.ts +53 -1
- package/dist/core/Player.d.ts.map +1 -1
- package/dist/core/Player.js +195 -142
- package/dist/core/rolePolicy.d.ts +16 -0
- package/dist/core/rolePolicy.d.ts.map +1 -0
- package/dist/core/rolePolicy.js +15 -0
- package/dist/core/urlPolicy.d.ts.map +1 -1
- package/dist/core/urlPolicy.js +5 -2
- package/dist/document/AssessmentItemDocument.d.ts +42 -0
- package/dist/document/AssessmentItemDocument.d.ts.map +1 -0
- package/dist/document/AssessmentItemDocument.js +116 -0
- package/dist/element.d.ts +22 -0
- package/dist/element.js +5548 -0
- package/dist/element.js.map +1 -0
- package/dist/extraction/ExtractionRegistry.d.ts.map +1 -1
- package/dist/extraction/ExtractionRegistry.js +3 -1
- package/dist/extraction/extractors/associateExtractor.d.ts +1 -27
- package/dist/extraction/extractors/associateExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/associateExtractor.js +1 -94
- package/dist/extraction/extractors/choiceExtractor.d.ts +1 -24
- package/dist/extraction/extractors/choiceExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/choiceExtractor.js +1 -83
- package/dist/extraction/extractors/customExtractor.d.ts +1 -19
- package/dist/extraction/extractors/customExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/customExtractor.js +1 -51
- package/dist/extraction/extractors/drawingExtractor.d.ts +1 -29
- package/dist/extraction/extractors/drawingExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/drawingExtractor.js +1 -78
- package/dist/extraction/extractors/endAttemptExtractor.d.ts +1 -19
- package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/endAttemptExtractor.js +1 -53
- package/dist/extraction/extractors/extendedTextExtractor.d.ts +1 -20
- package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/extendedTextExtractor.js +1 -57
- package/dist/extraction/extractors/gapMatchExtractor.d.ts +1 -27
- package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/gapMatchExtractor.js +1 -142
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +1 -39
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/graphicAssociateExtractor.js +1 -140
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +1 -41
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/graphicGapMatchExtractor.js +1 -144
- package/dist/extraction/extractors/graphicOrderExtractor.d.ts +1 -36
- package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/graphicOrderExtractor.js +1 -121
- package/dist/extraction/extractors/hotspotExtractor.d.ts +1 -37
- package/dist/extraction/extractors/hotspotExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/hotspotExtractor.js +1 -140
- package/dist/extraction/extractors/hottextExtractor.d.ts +1 -25
- package/dist/extraction/extractors/hottextExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/hottextExtractor.js +1 -120
- package/dist/extraction/extractors/index.d.ts +5 -58
- package/dist/extraction/extractors/index.d.ts.map +1 -1
- package/dist/extraction/extractors/index.js +5 -81
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +1 -21
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/inlineChoiceExtractor.js +1 -67
- package/dist/extraction/extractors/matchExtractor.d.ts +1 -31
- package/dist/extraction/extractors/matchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/matchExtractor.js +1 -134
- package/dist/extraction/extractors/mediaExtractor.d.ts +1 -32
- package/dist/extraction/extractors/mediaExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/mediaExtractor.js +1 -125
- package/dist/extraction/extractors/orderExtractor.d.ts +1 -25
- package/dist/extraction/extractors/orderExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/orderExtractor.js +1 -86
- package/dist/extraction/extractors/portableCustomExtractor.d.ts +2 -0
- package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/portableCustomExtractor.js +1 -0
- package/dist/extraction/extractors/positionObjectExtractor.d.ts +1 -58
- package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/positionObjectExtractor.js +1 -191
- package/dist/extraction/extractors/selectPointExtractor.d.ts +1 -30
- package/dist/extraction/extractors/selectPointExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/selectPointExtractor.js +1 -109
- package/dist/extraction/extractors/sliderExtractor.d.ts +1 -23
- package/dist/extraction/extractors/sliderExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/sliderExtractor.js +1 -73
- package/dist/extraction/extractors/textEntryExtractor.d.ts +1 -19
- package/dist/extraction/extractors/textEntryExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/textEntryExtractor.js +1 -48
- package/dist/extraction/extractors/uploadExtractor.d.ts +1 -19
- package/dist/extraction/extractors/uploadExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/uploadExtractor.js +1 -52
- package/dist/extraction/index.d.ts +1 -1
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +2 -2
- package/dist/extraction/interactionExtractionPipeline.d.ts +13 -0
- package/dist/extraction/interactionExtractionPipeline.d.ts.map +1 -0
- package/dist/extraction/interactionExtractionPipeline.js +39 -0
- package/dist/extraction/interactionSecurity.d.ts +4 -0
- package/dist/extraction/interactionSecurity.d.ts.map +1 -0
- package/dist/extraction/interactionSecurity.js +48 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -4
- package/dist/interactions/associate/extractor.d.ts +29 -0
- package/dist/interactions/associate/extractor.d.ts.map +1 -0
- package/dist/interactions/associate/extractor.js +97 -0
- package/dist/interactions/associate/index.d.ts +3 -0
- package/dist/interactions/associate/index.d.ts.map +1 -0
- package/dist/interactions/associate/index.js +1 -0
- package/dist/interactions/associate/types.d.ts +2 -0
- package/dist/interactions/associate/types.d.ts.map +1 -0
- package/dist/interactions/associate/types.js +1 -0
- package/dist/interactions/choice/extractor.d.ts +27 -0
- package/dist/interactions/choice/extractor.d.ts.map +1 -0
- package/dist/interactions/choice/extractor.js +93 -0
- package/dist/interactions/choice/index.d.ts +3 -0
- package/dist/interactions/choice/index.d.ts.map +1 -0
- package/dist/interactions/choice/index.js +1 -0
- package/dist/interactions/choice/types.d.ts +2 -0
- package/dist/interactions/choice/types.d.ts.map +1 -0
- package/dist/interactions/choice/types.js +1 -0
- package/dist/interactions/custom/extractor.d.ts +20 -0
- package/dist/interactions/custom/extractor.d.ts.map +1 -0
- package/dist/interactions/custom/extractor.js +51 -0
- package/dist/interactions/custom/index.d.ts +3 -0
- package/dist/interactions/custom/index.d.ts.map +1 -0
- package/dist/interactions/custom/index.js +1 -0
- package/dist/interactions/custom/types.d.ts +2 -0
- package/dist/interactions/custom/types.d.ts.map +1 -0
- package/dist/interactions/custom/types.js +1 -0
- package/dist/interactions/drawing/extractor.d.ts +30 -0
- package/dist/interactions/drawing/extractor.d.ts.map +1 -0
- package/dist/interactions/drawing/extractor.js +78 -0
- package/dist/interactions/drawing/index.d.ts +3 -0
- package/dist/interactions/drawing/index.d.ts.map +1 -0
- package/dist/interactions/drawing/index.js +1 -0
- package/dist/interactions/drawing/types.d.ts +2 -0
- package/dist/interactions/drawing/types.d.ts.map +1 -0
- package/dist/interactions/drawing/types.js +1 -0
- package/dist/interactions/end-attempt/extractor.d.ts +20 -0
- package/dist/interactions/end-attempt/extractor.d.ts.map +1 -0
- package/dist/interactions/end-attempt/extractor.js +53 -0
- package/dist/interactions/end-attempt/index.d.ts +3 -0
- package/dist/interactions/end-attempt/index.d.ts.map +1 -0
- package/dist/interactions/end-attempt/index.js +1 -0
- package/dist/interactions/end-attempt/types.d.ts +2 -0
- package/dist/interactions/end-attempt/types.d.ts.map +1 -0
- package/dist/interactions/end-attempt/types.js +1 -0
- package/dist/interactions/extended-text/extractor.d.ts +21 -0
- package/dist/interactions/extended-text/extractor.d.ts.map +1 -0
- package/dist/interactions/extended-text/extractor.js +63 -0
- package/dist/interactions/extended-text/index.d.ts +3 -0
- package/dist/interactions/extended-text/index.d.ts.map +1 -0
- package/dist/interactions/extended-text/index.js +1 -0
- package/dist/interactions/extended-text/types.d.ts +2 -0
- package/dist/interactions/extended-text/types.d.ts.map +1 -0
- package/dist/interactions/extended-text/types.js +1 -0
- package/dist/interactions/gap-match/extractor.d.ts +29 -0
- package/dist/interactions/gap-match/extractor.d.ts.map +1 -0
- package/dist/interactions/gap-match/extractor.js +155 -0
- package/dist/interactions/gap-match/index.d.ts +3 -0
- package/dist/interactions/gap-match/index.d.ts.map +1 -0
- package/dist/interactions/gap-match/index.js +1 -0
- package/dist/interactions/gap-match/types.d.ts +2 -0
- package/dist/interactions/gap-match/types.d.ts.map +1 -0
- package/dist/interactions/gap-match/types.js +1 -0
- package/dist/interactions/graphic-associate/extractor.d.ts +41 -0
- package/dist/interactions/graphic-associate/extractor.d.ts.map +1 -0
- package/dist/interactions/graphic-associate/extractor.js +143 -0
- package/dist/interactions/graphic-associate/index.d.ts +3 -0
- package/dist/interactions/graphic-associate/index.d.ts.map +1 -0
- package/dist/interactions/graphic-associate/index.js +1 -0
- package/dist/interactions/graphic-associate/types.d.ts +2 -0
- package/dist/interactions/graphic-associate/types.d.ts.map +1 -0
- package/dist/interactions/graphic-associate/types.js +1 -0
- package/dist/interactions/graphic-gap-match/extractor.d.ts +53 -0
- package/dist/interactions/graphic-gap-match/extractor.d.ts.map +1 -0
- package/dist/interactions/graphic-gap-match/extractor.js +205 -0
- package/dist/interactions/graphic-gap-match/index.d.ts +3 -0
- package/dist/interactions/graphic-gap-match/index.d.ts.map +1 -0
- package/dist/interactions/graphic-gap-match/index.js +1 -0
- package/dist/interactions/graphic-gap-match/types.d.ts +2 -0
- package/dist/interactions/graphic-gap-match/types.d.ts.map +1 -0
- package/dist/interactions/graphic-gap-match/types.js +1 -0
- package/dist/interactions/graphic-order/extractor.d.ts +37 -0
- package/dist/interactions/graphic-order/extractor.d.ts.map +1 -0
- package/dist/interactions/graphic-order/extractor.js +121 -0
- package/dist/interactions/graphic-order/index.d.ts +3 -0
- package/dist/interactions/graphic-order/index.d.ts.map +1 -0
- package/dist/interactions/graphic-order/index.js +1 -0
- package/dist/interactions/graphic-order/types.d.ts +2 -0
- package/dist/interactions/graphic-order/types.d.ts.map +1 -0
- package/dist/interactions/graphic-order/types.js +1 -0
- package/dist/interactions/hotspot/extractor.d.ts +38 -0
- package/dist/interactions/hotspot/extractor.d.ts.map +1 -0
- package/dist/interactions/hotspot/extractor.js +159 -0
- package/dist/interactions/hotspot/index.d.ts +3 -0
- package/dist/interactions/hotspot/index.d.ts.map +1 -0
- package/dist/interactions/hotspot/index.js +1 -0
- package/dist/interactions/hotspot/types.d.ts +2 -0
- package/dist/interactions/hotspot/types.d.ts.map +1 -0
- package/dist/interactions/hotspot/types.js +1 -0
- package/dist/interactions/hottext/extractor.d.ts +26 -0
- package/dist/interactions/hottext/extractor.d.ts.map +1 -0
- package/dist/interactions/hottext/extractor.js +128 -0
- package/dist/interactions/hottext/index.d.ts +3 -0
- package/dist/interactions/hottext/index.d.ts.map +1 -0
- package/dist/interactions/hottext/index.js +1 -0
- package/dist/interactions/hottext/types.d.ts +2 -0
- package/dist/interactions/hottext/types.d.ts.map +1 -0
- package/dist/interactions/hottext/types.js +1 -0
- package/dist/interactions/index.d.ts +33 -0
- package/dist/interactions/index.d.ts.map +1 -0
- package/dist/interactions/index.js +30 -0
- package/dist/interactions/inline/index.d.ts +2 -0
- package/dist/interactions/inline/index.d.ts.map +1 -0
- package/dist/interactions/inline/index.js +1 -0
- package/dist/interactions/inline/render-plan.d.ts +19 -0
- package/dist/interactions/inline/render-plan.d.ts.map +1 -0
- package/dist/interactions/inline/render-plan.js +59 -0
- package/dist/interactions/inline-choice/extractor.d.ts +25 -0
- package/dist/interactions/inline-choice/extractor.d.ts.map +1 -0
- package/dist/interactions/inline-choice/extractor.js +80 -0
- package/dist/interactions/inline-choice/index.d.ts +3 -0
- package/dist/interactions/inline-choice/index.d.ts.map +1 -0
- package/dist/interactions/inline-choice/index.js +1 -0
- package/dist/interactions/inline-choice/types.d.ts +2 -0
- package/dist/interactions/inline-choice/types.d.ts.map +1 -0
- package/dist/interactions/inline-choice/types.js +1 -0
- package/dist/interactions/match/extractor.d.ts +37 -0
- package/dist/interactions/match/extractor.d.ts.map +1 -0
- package/dist/interactions/match/extractor.js +160 -0
- package/dist/interactions/match/index.d.ts +3 -0
- package/dist/interactions/match/index.d.ts.map +1 -0
- package/dist/interactions/match/index.js +1 -0
- package/dist/interactions/match/types.d.ts +2 -0
- package/dist/interactions/match/types.d.ts.map +1 -0
- package/dist/interactions/match/types.js +1 -0
- package/dist/interactions/media/extractor.d.ts +33 -0
- package/dist/interactions/media/extractor.d.ts.map +1 -0
- package/dist/interactions/media/extractor.js +125 -0
- package/dist/interactions/media/index.d.ts +3 -0
- package/dist/interactions/media/index.d.ts.map +1 -0
- package/dist/interactions/media/index.js +1 -0
- package/dist/interactions/media/types.d.ts +2 -0
- package/dist/interactions/media/types.d.ts.map +1 -0
- package/dist/interactions/media/types.js +1 -0
- package/dist/interactions/modules.d.ts +105 -0
- package/dist/interactions/modules.d.ts.map +1 -0
- package/dist/interactions/modules.js +86 -0
- package/dist/interactions/order/extractor.d.ts +28 -0
- package/dist/interactions/order/extractor.d.ts.map +1 -0
- package/dist/interactions/order/extractor.js +90 -0
- package/dist/interactions/order/index.d.ts +3 -0
- package/dist/interactions/order/index.d.ts.map +1 -0
- package/dist/interactions/order/index.js +1 -0
- package/dist/interactions/order/types.d.ts +2 -0
- package/dist/interactions/order/types.d.ts.map +1 -0
- package/dist/interactions/order/types.js +1 -0
- package/dist/interactions/portable-custom/extractor.d.ts +14 -0
- package/dist/interactions/portable-custom/extractor.d.ts.map +1 -0
- package/dist/interactions/portable-custom/extractor.js +96 -0
- package/dist/interactions/portable-custom/index.d.ts +3 -0
- package/dist/interactions/portable-custom/index.d.ts.map +1 -0
- package/dist/interactions/portable-custom/index.js +1 -0
- package/dist/interactions/portable-custom/types.d.ts +2 -0
- package/dist/interactions/portable-custom/types.d.ts.map +1 -0
- package/dist/interactions/portable-custom/types.js +1 -0
- package/dist/interactions/position-object/extractor.d.ts +59 -0
- package/dist/interactions/position-object/extractor.d.ts.map +1 -0
- package/dist/interactions/position-object/extractor.js +191 -0
- package/dist/interactions/position-object/index.d.ts +3 -0
- package/dist/interactions/position-object/index.d.ts.map +1 -0
- package/dist/interactions/position-object/index.js +1 -0
- package/dist/interactions/position-object/types.d.ts +2 -0
- package/dist/interactions/position-object/types.d.ts.map +1 -0
- package/dist/interactions/position-object/types.js +1 -0
- package/dist/interactions/select-point/extractor.d.ts +31 -0
- package/dist/interactions/select-point/extractor.d.ts.map +1 -0
- package/dist/interactions/select-point/extractor.js +109 -0
- package/dist/interactions/select-point/index.d.ts +3 -0
- package/dist/interactions/select-point/index.d.ts.map +1 -0
- package/dist/interactions/select-point/index.js +1 -0
- package/dist/interactions/select-point/types.d.ts +2 -0
- package/dist/interactions/select-point/types.d.ts.map +1 -0
- package/dist/interactions/select-point/types.js +1 -0
- package/dist/interactions/shared/index.d.ts +2 -0
- package/dist/interactions/shared/index.d.ts.map +1 -0
- package/dist/interactions/shared/index.js +1 -0
- package/dist/interactions/shared/types.d.ts +412 -0
- package/dist/interactions/shared/types.d.ts.map +1 -0
- package/dist/interactions/shared/types.js +7 -0
- package/dist/interactions/slider/extractor.d.ts +24 -0
- package/dist/interactions/slider/extractor.d.ts.map +1 -0
- package/dist/interactions/slider/extractor.js +73 -0
- package/dist/interactions/slider/index.d.ts +3 -0
- package/dist/interactions/slider/index.d.ts.map +1 -0
- package/dist/interactions/slider/index.js +1 -0
- package/dist/interactions/slider/types.d.ts +2 -0
- package/dist/interactions/slider/types.d.ts.map +1 -0
- package/dist/interactions/slider/types.js +1 -0
- package/dist/interactions/text-entry/extractor.d.ts +21 -0
- package/dist/interactions/text-entry/extractor.d.ts.map +1 -0
- package/dist/interactions/text-entry/extractor.js +54 -0
- package/dist/interactions/text-entry/index.d.ts +3 -0
- package/dist/interactions/text-entry/index.d.ts.map +1 -0
- package/dist/interactions/text-entry/index.js +1 -0
- package/dist/interactions/text-entry/types.d.ts +2 -0
- package/dist/interactions/text-entry/types.d.ts.map +1 -0
- package/dist/interactions/text-entry/types.js +1 -0
- package/dist/interactions/upload/extractor.d.ts +20 -0
- package/dist/interactions/upload/extractor.d.ts.map +1 -0
- package/dist/interactions/upload/extractor.js +59 -0
- package/dist/interactions/upload/index.d.ts +3 -0
- package/dist/interactions/upload/index.d.ts.map +1 -0
- package/dist/interactions/upload/index.js +1 -0
- package/dist/interactions/upload/types.d.ts +2 -0
- package/dist/interactions/upload/types.d.ts.map +1 -0
- package/dist/interactions/upload/types.js +1 -0
- package/dist/pci/PciHost.d.ts +53 -0
- package/dist/pci/PciHost.d.ts.map +1 -0
- package/dist/pci/PciHost.js +116 -0
- package/dist/pci/types.d.ts +57 -0
- package/dist/pci/types.d.ts.map +1 -0
- package/dist/pci/types.js +19 -0
- package/dist/pnp/applyPnp.d.ts +9 -0
- package/dist/pnp/applyPnp.d.ts.map +1 -0
- package/dist/pnp/applyPnp.js +19 -0
- package/dist/pnp/parsePnpXml.d.ts +9 -0
- package/dist/pnp/parsePnpXml.d.ts.map +1 -0
- package/dist/pnp/parsePnpXml.js +101 -0
- package/dist/pnp/types.d.ts +40 -0
- package/dist/pnp/types.d.ts.map +1 -0
- package/dist/pnp/types.js +1 -0
- package/dist/types/index.d.ts +22 -8
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/interactions.d.ts +4 -319
- package/dist/types/interactions.d.ts.map +1 -1
- package/dist/types/interactions.js +3 -3
- package/dist/web-components/QTIInteractionBase.d.ts +5 -5
- package/dist/web-components/QTIInteractionBase.d.ts.map +1 -1
- package/dist/web-components/QTIInteractionElement.d.ts +11 -8
- package/dist/web-components/QTIInteractionElement.d.ts.map +1 -1
- package/dist/web-components/index.d.ts +1 -1
- package/dist/web-components/index.d.ts.map +1 -1
- package/package.json +19 -9
- package/src/__tests__/catalog.test.ts +267 -0
- package/src/__tests__/fixtures/pci/echo-pci.js +49 -0
- package/src/__tests__/glossaryTriggers.test.ts +411 -0
- package/src/__tests__/pci.test.ts +353 -0
- package/src/__tests__/pnp.test.ts +250 -0
- package/src/__tests__/qti3-extraction.test.ts +5 -5
- package/src/catalog/applyGlossaryTriggers.ts +232 -0
- package/src/catalog/catalogExtractor.ts +130 -0
- package/src/catalog/catalogLookup.ts +53 -0
- package/src/catalog/glossaryAction.ts +28 -0
- package/src/catalog/types.ts +37 -0
- package/src/components/ItemBody.svelte +105 -135
- package/src/components/ItemPlayer.svelte +15 -7
- package/src/components/ModalFeedbackDisplay.svelte +15 -5
- package/src/components/index.ts +3 -0
- package/src/core/ComponentRegistry.ts +36 -7
- package/src/core/Player.ts +212 -157
- package/src/core/rolePolicy.ts +34 -0
- package/src/core/urlPolicy.ts +5 -2
- package/src/document/AssessmentItemDocument.ts +178 -0
- package/src/element.ts +128 -0
- package/src/extraction/ExtractionRegistry.ts +5 -1
- package/src/extraction/extractors/associateExtractor.ts +1 -129
- package/src/extraction/extractors/choiceExtractor.ts +1 -110
- package/src/extraction/extractors/conformance-qti3-advanced.test.ts +239 -0
- package/src/extraction/extractors/conformance-qti3-basic.test.ts +82 -0
- package/src/extraction/extractors/conformance.test.ts +208 -0
- package/src/extraction/extractors/customExtractor.ts +1 -72
- package/src/extraction/extractors/drawingExtractor.ts +1 -113
- package/src/extraction/extractors/endAttemptExtractor.ts +1 -74
- package/src/extraction/extractors/extendedTextExtractor.ts +1 -83
- package/src/extraction/extractors/gapMatchExtractor.ts +1 -178
- package/src/extraction/extractors/graphicAssociateExtractor.ts +1 -188
- package/src/extraction/extractors/graphicGapMatchExtractor.ts +1 -185
- package/src/extraction/extractors/graphicOrderExtractor.ts +1 -162
- package/src/extraction/extractors/hotspotExtractor.ts +1 -190
- package/src/extraction/extractors/hottextExtractor.ts +1 -153
- package/src/extraction/extractors/index.ts +5 -107
- package/src/extraction/extractors/inlineChoiceExtractor.ts +1 -88
- package/src/extraction/extractors/matchExtractor.ts +1 -160
- package/src/extraction/extractors/mediaExtractor.ts +1 -168
- package/src/extraction/extractors/orderExtractor.ts +1 -114
- package/src/extraction/extractors/portableCustomExtractor.ts +1 -0
- package/src/extraction/extractors/positionObjectExtractor.ts +1 -243
- package/src/extraction/extractors/selectPointExtractor.ts +1 -143
- package/src/extraction/extractors/sliderExtractor.ts +1 -102
- package/src/extraction/extractors/textEntryExtractor.ts +1 -72
- package/src/extraction/extractors/uploadExtractor.ts +1 -73
- package/src/extraction/index.ts +1 -2
- package/src/extraction/interactionExtractionPipeline.ts +70 -0
- package/src/extraction/interactionSecurity.ts +60 -0
- package/src/index.ts +19 -8
- package/src/interactions/associate/extractor.ts +133 -0
- package/src/interactions/associate/index.ts +2 -0
- package/src/interactions/associate/types.ts +1 -0
- package/src/interactions/choice/extractor.ts +121 -0
- package/src/interactions/choice/index.ts +2 -0
- package/src/interactions/choice/types.ts +1 -0
- package/src/interactions/custom/extractor.ts +72 -0
- package/src/interactions/custom/index.ts +2 -0
- package/src/interactions/custom/types.ts +1 -0
- package/src/interactions/drawing/extractor.ts +113 -0
- package/src/interactions/drawing/index.ts +2 -0
- package/src/interactions/drawing/types.ts +1 -0
- package/src/interactions/end-attempt/extractor.ts +74 -0
- package/src/interactions/end-attempt/index.ts +2 -0
- package/src/interactions/end-attempt/types.ts +1 -0
- package/src/interactions/extended-text/extractor.ts +89 -0
- package/src/interactions/extended-text/index.ts +2 -0
- package/src/interactions/extended-text/types.ts +1 -0
- package/src/interactions/gap-match/extractor.ts +193 -0
- package/src/interactions/gap-match/index.ts +2 -0
- package/src/interactions/gap-match/types.ts +1 -0
- package/src/interactions/graphic-associate/extractor.ts +192 -0
- package/src/interactions/graphic-associate/index.ts +2 -0
- package/src/interactions/graphic-associate/types.ts +1 -0
- package/src/interactions/graphic-gap-match/extractor.ts +257 -0
- package/src/interactions/graphic-gap-match/index.ts +2 -0
- package/src/interactions/graphic-gap-match/types.ts +1 -0
- package/src/interactions/graphic-order/extractor.ts +162 -0
- package/src/interactions/graphic-order/index.ts +2 -0
- package/src/interactions/graphic-order/types.ts +1 -0
- package/src/interactions/hotspot/extractor.ts +208 -0
- package/src/interactions/hotspot/index.ts +2 -0
- package/src/interactions/hotspot/types.ts +1 -0
- package/src/interactions/hottext/extractor.ts +163 -0
- package/src/interactions/hottext/index.ts +2 -0
- package/src/interactions/hottext/types.ts +1 -0
- package/src/interactions/index.ts +52 -0
- package/src/interactions/inline/index.ts +1 -0
- package/src/interactions/inline/render-plan.ts +105 -0
- package/src/interactions/inline-choice/InlineChoice.svelte +57 -0
- package/src/interactions/inline-choice/extractor.ts +105 -0
- package/src/interactions/inline-choice/index.ts +2 -0
- package/src/interactions/inline-choice/types.ts +1 -0
- package/src/interactions/match/extractor.ts +187 -0
- package/src/interactions/match/index.ts +2 -0
- package/src/interactions/match/types.ts +1 -0
- package/src/interactions/media/extractor.ts +168 -0
- package/src/interactions/media/index.ts +2 -0
- package/src/interactions/media/types.ts +1 -0
- package/src/interactions/modules.ts +111 -0
- package/src/interactions/order/extractor.ts +120 -0
- package/src/interactions/order/index.ts +2 -0
- package/src/interactions/order/types.ts +1 -0
- package/src/interactions/portable-custom/extractor.ts +122 -0
- package/src/interactions/portable-custom/index.ts +2 -0
- package/src/interactions/portable-custom/types.ts +1 -0
- package/src/interactions/position-object/extractor.ts +243 -0
- package/src/interactions/position-object/index.ts +2 -0
- package/src/interactions/position-object/types.ts +1 -0
- package/src/interactions/select-point/extractor.ts +143 -0
- package/src/interactions/select-point/index.ts +2 -0
- package/src/interactions/select-point/types.ts +1 -0
- package/src/interactions/shared/index.ts +1 -0
- package/src/interactions/shared/types.ts +429 -0
- package/src/interactions/slider/extractor.ts +102 -0
- package/src/interactions/slider/index.ts +2 -0
- package/src/interactions/slider/types.ts +1 -0
- package/src/interactions/text-entry/InlineTextEntry.svelte +75 -0
- package/src/interactions/text-entry/extractor.ts +79 -0
- package/src/interactions/text-entry/index.ts +2 -0
- package/src/interactions/text-entry/types.ts +1 -0
- package/src/interactions/upload/extractor.ts +81 -0
- package/src/interactions/upload/index.ts +2 -0
- package/src/interactions/upload/types.ts +1 -0
- package/src/pci/PciHost.ts +138 -0
- package/src/pci/types.ts +70 -0
- package/src/pnp/applyPnp.ts +23 -0
- package/src/pnp/parsePnpXml.ts +118 -0
- package/src/pnp/types.ts +33 -0
- package/src/types/index.ts +22 -8
- package/src/types/interactions.ts +4 -350
- package/src/web-components/QTIInteractionBase.ts +6 -5
- package/src/web-components/QTIInteractionElement.ts +15 -8
- package/src/web-components/index.ts +1 -0
- package/src/core/ItemRenderer.ts +0 -367
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { parse as parseHtml } from 'node-html-parser';
|
|
2
|
+
/**
|
|
3
|
+
* Parse a QTI 3.0 <personalNeedsProfile> element (or legacy <pnp> element) into a PnpProfile.
|
|
4
|
+
*
|
|
5
|
+
* Accepts either an XML/HTML string containing the profile element, or a live DOM Element.
|
|
6
|
+
* Unknown child elements are silently ignored for forward-compatibility.
|
|
7
|
+
*/
|
|
8
|
+
export function parsePnpXml(xml) {
|
|
9
|
+
if (typeof xml !== 'string') {
|
|
10
|
+
// Live DOM Element — serialise to string and re-parse via node-html-parser
|
|
11
|
+
return parsePnpXml(xml.outerHTML ?? '');
|
|
12
|
+
}
|
|
13
|
+
const trimmed = xml.trim();
|
|
14
|
+
if (!trimmed)
|
|
15
|
+
return {};
|
|
16
|
+
// Wrap so node-html-parser treats the outer tag as the root
|
|
17
|
+
const doc = parseHtml(`<root>${trimmed}</root>`, { lowerCaseTagName: true });
|
|
18
|
+
const root = doc.querySelector('personalneedsprofile') ?? doc.querySelector('pnp');
|
|
19
|
+
if (!root)
|
|
20
|
+
return {};
|
|
21
|
+
return extractProfile(root);
|
|
22
|
+
}
|
|
23
|
+
function extractProfile(root) {
|
|
24
|
+
const profile = {};
|
|
25
|
+
// <display>
|
|
26
|
+
const displayEl = findChild(root, ['display']);
|
|
27
|
+
if (displayEl) {
|
|
28
|
+
profile.display = {};
|
|
29
|
+
const colorSchemeEl = findChild(displayEl, ['colorscheme', 'color-scheme']);
|
|
30
|
+
if (colorSchemeEl) {
|
|
31
|
+
const val = (colorSchemeEl.getAttribute('value') ?? colorSchemeEl.text ?? '').trim().toLowerCase();
|
|
32
|
+
if (isColorScheme(val))
|
|
33
|
+
profile.display.colorScheme = val;
|
|
34
|
+
}
|
|
35
|
+
const magEl = findChild(displayEl, ['magnification']);
|
|
36
|
+
if (magEl) {
|
|
37
|
+
const val = parseFloat(magEl.getAttribute('value') ?? magEl.text ?? '');
|
|
38
|
+
if (Number.isFinite(val) && val > 0)
|
|
39
|
+
profile.display.magnification = val;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// <content>
|
|
43
|
+
const contentEl = findChild(root, ['content']);
|
|
44
|
+
if (contentEl) {
|
|
45
|
+
profile.content = {};
|
|
46
|
+
const glossaryEl = findChild(contentEl, ['glossaryonscreen', 'glossary-on-screen']);
|
|
47
|
+
if (glossaryEl) {
|
|
48
|
+
profile.content.glossaryOnScreen = parseBool(glossaryEl.getAttribute('enabled') ?? glossaryEl.text ?? 'true');
|
|
49
|
+
}
|
|
50
|
+
const kwEl = findChild(contentEl, ['keywordtranslation', 'keyword-translation']);
|
|
51
|
+
if (kwEl) {
|
|
52
|
+
const active = parseBool(kwEl.getAttribute('active') ?? 'true');
|
|
53
|
+
const languageCode = (kwEl.getAttribute('languagecode') ?? kwEl.getAttribute('language-code') ?? kwEl.getAttribute('lang') ?? '').trim();
|
|
54
|
+
if (languageCode)
|
|
55
|
+
profile.content.keywordTranslation = { active, languageCode };
|
|
56
|
+
}
|
|
57
|
+
const etEl = findChild(contentEl, ['extendedtime', 'extended-time']);
|
|
58
|
+
if (etEl) {
|
|
59
|
+
const active = parseBool(etEl.getAttribute('active') ?? 'true');
|
|
60
|
+
const rawMultiplier = etEl.getAttribute('multiplier') ?? etEl.text ?? '';
|
|
61
|
+
const multiplier = rawMultiplier.trim().toLowerCase() === 'infinity'
|
|
62
|
+
? Infinity
|
|
63
|
+
: parseFloat(rawMultiplier);
|
|
64
|
+
if (Number.isFinite(multiplier) || multiplier === Infinity) {
|
|
65
|
+
profile.content.extendedTime = { active, multiplier };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// <cognitive>
|
|
70
|
+
const cogEl = findChild(root, ['cognitive']);
|
|
71
|
+
if (cogEl) {
|
|
72
|
+
profile.cognitive = {};
|
|
73
|
+
const elTool = findChild(cogEl, ['eliminationtool', 'elimination-tool']);
|
|
74
|
+
if (elTool) {
|
|
75
|
+
profile.cognitive.eliminationTool = parseBool(elTool.getAttribute('enabled') ?? elTool.getAttribute('active') ?? elTool.text ?? 'true');
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return profile;
|
|
79
|
+
}
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
// Helpers
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
function findChild(parent, names) {
|
|
84
|
+
for (const child of parent.childNodes) {
|
|
85
|
+
if (child.nodeType !== 1)
|
|
86
|
+
continue; // element nodes only
|
|
87
|
+
const el = child;
|
|
88
|
+
const tag = (el.rawTagName ?? '').toLowerCase();
|
|
89
|
+
if (names.includes(tag))
|
|
90
|
+
return el;
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
function parseBool(value) {
|
|
95
|
+
const v = (value ?? '').trim().toLowerCase();
|
|
96
|
+
return v !== 'false' && v !== '0' && v !== 'no';
|
|
97
|
+
}
|
|
98
|
+
const COLOR_SCHEMES = new Set(['default', 'blackwhite', 'whitenav', 'blackcream', 'yellowblue', 'medgray']);
|
|
99
|
+
function isColorScheme(v) {
|
|
100
|
+
return COLOR_SCHEMES.has(v);
|
|
101
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QTI 3.0 §6.2 Personal Needs and Preferences profile.
|
|
3
|
+
* All fields are optional; absent means "use platform default".
|
|
4
|
+
*/
|
|
5
|
+
export interface PnpProfile {
|
|
6
|
+
display?: {
|
|
7
|
+
/**
|
|
8
|
+
* Named color scheme. Maps to the data-qti-colorscheme attribute on the player root.
|
|
9
|
+
* 'default' or undefined → attribute removed (browser/host default).
|
|
10
|
+
*/
|
|
11
|
+
colorScheme?: 'default' | 'blackwhite' | 'whitenav' | 'blackcream' | 'yellowblue' | 'medgray';
|
|
12
|
+
/**
|
|
13
|
+
* CSS zoom factor (1.0 = 100%). Deferred — set by browser zoom or host stylesheet.
|
|
14
|
+
* Stored here for forward-compatibility but not yet applied by the player.
|
|
15
|
+
*/
|
|
16
|
+
magnification?: number;
|
|
17
|
+
};
|
|
18
|
+
content?: {
|
|
19
|
+
/** Show glossary trigger buttons on [data-catalog-idref] terms (G-10). */
|
|
20
|
+
glossaryOnScreen?: boolean;
|
|
21
|
+
/** Show keyword-translation trigger buttons using the given language code. */
|
|
22
|
+
keywordTranslation?: {
|
|
23
|
+
active: boolean;
|
|
24
|
+
languageCode: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Scale assessment time limits. multiplier: 1.5 means 50% extra time.
|
|
28
|
+
* multiplier: Infinity removes the time limit entirely.
|
|
29
|
+
*/
|
|
30
|
+
extendedTime?: {
|
|
31
|
+
active: boolean;
|
|
32
|
+
multiplier: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
cognitive?: {
|
|
36
|
+
/** Render per-choice elimination toggle buttons in choiceInteraction and orderInteraction. */
|
|
37
|
+
eliminationTool?: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pnp/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,UAAU;IAC1B,OAAO,CAAC,EAAE;QACT;;;WAGG;QACH,WAAW,CAAC,EAAE,SAAS,GAAG,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;QAC9F;;;WAGG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,OAAO,CAAC,EAAE;QACT,0EAA0E;QAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,8EAA8E;QAC9E,kBAAkB,CAAC,EAAE;YAAE,MAAM,EAAE,OAAO,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC;QAC/D;;;WAGG;QACH,YAAY,CAAC,EAAE;YAAE,MAAM,EAAE,OAAO,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACvD,CAAC;IACF,SAAS,CAAC,EAAE;QACX,8FAA8F;QAC9F,eAAe,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface AreaMapping {
|
|
|
41
41
|
defaultValue?: number;
|
|
42
42
|
lowerBound?: number;
|
|
43
43
|
upperBound?: number;
|
|
44
|
-
entries:
|
|
44
|
+
entries: AreaMapEntry[];
|
|
45
45
|
}
|
|
46
46
|
export interface AreaMapEntry {
|
|
47
47
|
shape: 'circle' | 'rect' | 'poly' | 'ellipse' | 'default';
|
|
@@ -127,13 +127,9 @@ export interface AdaptiveAttemptResult extends ScoringResult {
|
|
|
127
127
|
canContinue: boolean;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
|
-
* QTI
|
|
131
|
-
* -
|
|
132
|
-
*
|
|
133
|
-
* - proctor: Test administrator/invigilator
|
|
134
|
-
* - testConstructor: Test author/developer
|
|
135
|
-
* - tutor: Instructional/learning mode
|
|
136
|
-
* - author: Content author
|
|
130
|
+
* QTI role/view actors used for audience filtering (for example rubric/outcome visibility).
|
|
131
|
+
* Runtime interaction behavior (readonly vs editable, correct-answer visibility) is a player
|
|
132
|
+
* policy layered on top of these roles.
|
|
137
133
|
*/
|
|
138
134
|
export type QTIRole = 'candidate' | 'scorer' | 'proctor' | 'testConstructor' | 'tutor' | 'author';
|
|
139
135
|
export interface RubricBlock {
|
|
@@ -154,6 +150,19 @@ export interface QTIComplianceConfig {
|
|
|
154
150
|
}
|
|
155
151
|
export interface PlayerConfig {
|
|
156
152
|
itemXml?: string;
|
|
153
|
+
/**
|
|
154
|
+
* QTI 3.0 §6.2 Personal Needs and Preferences profile.
|
|
155
|
+
* Color scheme is applied immediately as data-qti-colorscheme on the player root.
|
|
156
|
+
* Use player.updatePnp() to change mid-session without re-parsing the item.
|
|
157
|
+
*/
|
|
158
|
+
pnp?: import('../pnp/types.js').PnpProfile;
|
|
159
|
+
/**
|
|
160
|
+
* Optional shared catalog XML string (QTI 3.0 §6.3).
|
|
161
|
+
* Parsed and merged with any catalog embedded in the item XML.
|
|
162
|
+
* Item-level catalog entries take precedence over shared entries with the same identifier.
|
|
163
|
+
* Deferred: external catalog files from IMS manifest (G-15) are not yet supported.
|
|
164
|
+
*/
|
|
165
|
+
catalogXml?: string;
|
|
157
166
|
sessionState?: ItemSessionState;
|
|
158
167
|
responses?: InteractionResponse;
|
|
159
168
|
role?: QTIRole;
|
|
@@ -192,6 +201,11 @@ export interface PlayerConfig {
|
|
|
192
201
|
class?: string;
|
|
193
202
|
definition?: string;
|
|
194
203
|
}) => QtiValue>;
|
|
204
|
+
/**
|
|
205
|
+
* Optional base URL for resolving relative PCI module paths.
|
|
206
|
+
* Defaults to document.baseURI when running in a browser.
|
|
207
|
+
*/
|
|
208
|
+
pciBaseUrl?: string;
|
|
195
209
|
/**
|
|
196
210
|
* Security-related controls for untrusted QTI rendered into the host DOM.
|
|
197
211
|
* Defaults are conservative for same-DOM embedding.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACX,QAAQ,IAAI,kBAAkB,EAC9B,WAAW,IAAI,qBAAqB,EACpC,QAAQ,EACR,MAAM,yBAAyB,CAAC;AAEjC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAExD,MAAM,WAAW,mBAAmB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,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B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACxC;AAID,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,323 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Compatibility barrel for interaction data types.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Canonical interaction modules live under `../interactions`. This path remains
|
|
5
|
+
* for existing imports from `@pie-qti/item-player` and internal consumers.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
import type { HtmlContent } from './index.js';
|
|
9
|
-
/**
|
|
10
|
-
* Type alias for parsed QTI XML elements
|
|
11
|
-
* Uses node-html-parser's HTMLElement type directly
|
|
12
|
-
*/
|
|
13
|
-
export type QTIElement = HTMLElement;
|
|
14
|
-
export interface BaseInteractionData {
|
|
15
|
-
type: string;
|
|
16
|
-
responseId: string;
|
|
17
|
-
}
|
|
18
|
-
export interface ChoiceInteractionData extends BaseInteractionData {
|
|
19
|
-
type: 'choiceInteraction';
|
|
20
|
-
shuffle: boolean;
|
|
21
|
-
maxChoices: number;
|
|
22
|
-
prompt: string | null;
|
|
23
|
-
choices: Array<{
|
|
24
|
-
identifier: string;
|
|
25
|
-
text: HtmlContent;
|
|
26
|
-
classes?: string[];
|
|
27
|
-
}>;
|
|
28
|
-
/** CSS classes from the choiceInteraction element for custom renderer detection */
|
|
29
|
-
interactionClasses?: string[];
|
|
30
|
-
}
|
|
31
|
-
export interface TextEntryInteractionData extends BaseInteractionData {
|
|
32
|
-
type: 'textEntryInteraction';
|
|
33
|
-
expectedLength: number;
|
|
34
|
-
patternMask: string | null;
|
|
35
|
-
placeholderText: string;
|
|
36
|
-
}
|
|
37
|
-
export interface ExtendedTextInteractionData extends BaseInteractionData {
|
|
38
|
-
type: 'extendedTextInteraction';
|
|
39
|
-
expectedLines: number;
|
|
40
|
-
expectedLength: number;
|
|
41
|
-
placeholderText: string;
|
|
42
|
-
format: string;
|
|
43
|
-
}
|
|
44
|
-
export interface InlineChoiceInteractionData extends BaseInteractionData {
|
|
45
|
-
type: 'inlineChoiceInteraction';
|
|
46
|
-
shuffle: boolean;
|
|
47
|
-
choices: Array<{
|
|
48
|
-
identifier: string;
|
|
49
|
-
text: string;
|
|
50
|
-
}>;
|
|
51
|
-
}
|
|
52
|
-
export interface OrderInteractionData extends BaseInteractionData {
|
|
53
|
-
type: 'orderInteraction';
|
|
54
|
-
shuffle: boolean;
|
|
55
|
-
prompt: string | null;
|
|
56
|
-
choices: Array<{
|
|
57
|
-
identifier: string;
|
|
58
|
-
text: string;
|
|
59
|
-
}>;
|
|
60
|
-
}
|
|
61
|
-
export interface AssociableChoice {
|
|
62
|
-
identifier: string;
|
|
63
|
-
text: string;
|
|
64
|
-
matchMax: number;
|
|
65
|
-
}
|
|
66
|
-
export interface MatchInteractionData extends BaseInteractionData {
|
|
67
|
-
type: 'matchInteraction';
|
|
68
|
-
shuffle: boolean;
|
|
69
|
-
maxAssociations: number;
|
|
70
|
-
prompt: string | null;
|
|
71
|
-
sourceSet: AssociableChoice[];
|
|
72
|
-
targetSet: AssociableChoice[];
|
|
73
|
-
}
|
|
74
|
-
export interface AssociateInteractionData extends BaseInteractionData {
|
|
75
|
-
type: 'associateInteraction';
|
|
76
|
-
shuffle: boolean;
|
|
77
|
-
maxAssociations: number;
|
|
78
|
-
prompt: string | null;
|
|
79
|
-
choices: AssociableChoice[];
|
|
80
|
-
}
|
|
81
|
-
export interface GapMatchInteractionData extends BaseInteractionData {
|
|
82
|
-
type: 'gapMatchInteraction';
|
|
83
|
-
shuffle: boolean;
|
|
84
|
-
prompt: string | null;
|
|
85
|
-
gapTexts: Array<{
|
|
86
|
-
identifier: string;
|
|
87
|
-
text: string;
|
|
88
|
-
matchMax: number;
|
|
89
|
-
}>;
|
|
90
|
-
gaps: Array<{
|
|
91
|
-
identifier: string;
|
|
92
|
-
index: number;
|
|
93
|
-
}>;
|
|
94
|
-
promptText: string;
|
|
95
|
-
}
|
|
96
|
-
export interface SliderInteractionData extends BaseInteractionData {
|
|
97
|
-
type: 'sliderInteraction';
|
|
98
|
-
lowerBound: number;
|
|
99
|
-
upperBound: number;
|
|
100
|
-
step: number;
|
|
101
|
-
orientation: string;
|
|
102
|
-
reverse: boolean;
|
|
103
|
-
prompt: string | null;
|
|
104
|
-
}
|
|
105
|
-
export interface ImageData {
|
|
106
|
-
type: 'svg' | 'image';
|
|
107
|
-
content?: HtmlContent;
|
|
108
|
-
src?: string;
|
|
109
|
-
width: string;
|
|
110
|
-
height: string;
|
|
111
|
-
}
|
|
112
|
-
export interface HotspotChoice {
|
|
113
|
-
identifier: string;
|
|
114
|
-
shape: string;
|
|
115
|
-
coords: string;
|
|
116
|
-
}
|
|
117
|
-
export interface HotspotInteractionData extends BaseInteractionData {
|
|
118
|
-
type: 'hotspotInteraction';
|
|
119
|
-
maxChoices: number;
|
|
120
|
-
prompt: string | null;
|
|
121
|
-
imageData: ImageData | null;
|
|
122
|
-
hotspotChoices: HotspotChoice[];
|
|
123
|
-
}
|
|
124
|
-
export interface AssociableHotspot {
|
|
125
|
-
identifier: string;
|
|
126
|
-
shape: string;
|
|
127
|
-
coords: string;
|
|
128
|
-
matchMax: number;
|
|
129
|
-
}
|
|
130
|
-
export interface GraphicGapMatchInteractionData extends BaseInteractionData {
|
|
131
|
-
type: 'graphicGapMatchInteraction';
|
|
132
|
-
prompt: string | null;
|
|
133
|
-
imageData: ImageData | null;
|
|
134
|
-
gapTexts: Array<{
|
|
135
|
-
identifier: string;
|
|
136
|
-
text: string;
|
|
137
|
-
matchMax: number;
|
|
138
|
-
}>;
|
|
139
|
-
hotspots: AssociableHotspot[];
|
|
140
|
-
}
|
|
141
|
-
export interface UploadInteractionData extends BaseInteractionData {
|
|
142
|
-
type: 'uploadInteraction';
|
|
143
|
-
prompt: string | null;
|
|
144
|
-
/** Allowed MIME types / extensions (vendor-dependent); empty = accept any */
|
|
145
|
-
fileTypes: string[];
|
|
146
|
-
rawAttributes: Record<string, string>;
|
|
147
|
-
}
|
|
148
|
-
export interface DrawingInteractionData extends BaseInteractionData {
|
|
149
|
-
type: 'drawingInteraction';
|
|
150
|
-
prompt: string | null;
|
|
151
|
-
/** Optional background image/SVG to draw on top of */
|
|
152
|
-
imageData: ImageData | null;
|
|
153
|
-
rawAttributes: Record<string, string>;
|
|
154
|
-
}
|
|
155
|
-
export interface CustomInteractionData extends BaseInteractionData {
|
|
156
|
-
type: 'customInteraction';
|
|
157
|
-
prompt: string | null;
|
|
158
|
-
rawAttributes: Record<string, string>;
|
|
159
|
-
/** Outer XML snippet for debugging (best-effort) */
|
|
160
|
-
xml: string;
|
|
161
|
-
}
|
|
162
|
-
export interface MediaElement {
|
|
163
|
-
type: 'audio' | 'video' | 'object';
|
|
164
|
-
src: string;
|
|
165
|
-
mimeType: string;
|
|
166
|
-
width?: number;
|
|
167
|
-
height?: number;
|
|
168
|
-
}
|
|
169
|
-
export interface MediaInteractionData extends BaseInteractionData {
|
|
170
|
-
type: 'mediaInteraction';
|
|
171
|
-
prompt: string | null;
|
|
172
|
-
autostart: boolean;
|
|
173
|
-
minPlays: number;
|
|
174
|
-
maxPlays: number;
|
|
175
|
-
loop: boolean;
|
|
176
|
-
mediaElement: MediaElement;
|
|
177
|
-
/** Whether the renderer should allow <object> embeds for this interaction (default false) */
|
|
178
|
-
allowObjectEmbeds?: boolean;
|
|
179
|
-
}
|
|
180
|
-
export interface HottextChoice {
|
|
181
|
-
identifier: string;
|
|
182
|
-
text: string;
|
|
183
|
-
}
|
|
184
|
-
export interface HottextInteractionData extends BaseInteractionData {
|
|
185
|
-
type: 'hottextInteraction';
|
|
186
|
-
prompt: string | null;
|
|
187
|
-
maxChoices: number;
|
|
188
|
-
contentHtml: HtmlContent;
|
|
189
|
-
hottextChoices: HottextChoice[];
|
|
190
|
-
}
|
|
191
|
-
export interface Point {
|
|
192
|
-
x: number;
|
|
193
|
-
y: number;
|
|
194
|
-
}
|
|
195
|
-
export interface SelectPointInteractionData extends BaseInteractionData {
|
|
196
|
-
type: 'selectPointInteraction';
|
|
197
|
-
prompt: string | null;
|
|
198
|
-
maxChoices: number;
|
|
199
|
-
minChoices: number;
|
|
200
|
-
imageData: ImageData | null;
|
|
201
|
-
}
|
|
202
|
-
export interface GraphicOrderChoice {
|
|
203
|
-
identifier: string;
|
|
204
|
-
shape: string;
|
|
205
|
-
coords: string;
|
|
206
|
-
label: string;
|
|
207
|
-
}
|
|
208
|
-
export interface GraphicOrderInteractionData extends BaseInteractionData {
|
|
209
|
-
type: 'graphicOrderInteraction';
|
|
210
|
-
prompt: string | null;
|
|
211
|
-
imageData: ImageData | null;
|
|
212
|
-
hotspotChoices: GraphicOrderChoice[];
|
|
213
|
-
}
|
|
214
|
-
export interface GraphicAssociateHotspot {
|
|
215
|
-
identifier: string;
|
|
216
|
-
shape: string;
|
|
217
|
-
coords: string;
|
|
218
|
-
matchMax: number;
|
|
219
|
-
label: string;
|
|
220
|
-
}
|
|
221
|
-
export interface GraphicAssociateInteractionData extends BaseInteractionData {
|
|
222
|
-
type: 'graphicAssociateInteraction';
|
|
223
|
-
prompt: string | null;
|
|
224
|
-
maxAssociations: number;
|
|
225
|
-
minAssociations: number;
|
|
226
|
-
imageData: ImageData | null;
|
|
227
|
-
associableHotspots: GraphicAssociateHotspot[];
|
|
228
|
-
}
|
|
229
|
-
export interface PositionObjectStage {
|
|
230
|
-
identifier: string;
|
|
231
|
-
matchMax: number;
|
|
232
|
-
objectData: {
|
|
233
|
-
type: 'image' | 'svg';
|
|
234
|
-
src?: string;
|
|
235
|
-
content?: HtmlContent;
|
|
236
|
-
width?: string;
|
|
237
|
-
height?: string;
|
|
238
|
-
} | null;
|
|
239
|
-
label: string;
|
|
240
|
-
}
|
|
241
|
-
export interface PositionObjectInteractionData extends BaseInteractionData {
|
|
242
|
-
type: 'positionObjectInteraction';
|
|
243
|
-
prompt: string | null;
|
|
244
|
-
maxChoices: number;
|
|
245
|
-
minChoices: number;
|
|
246
|
-
centerPoint: boolean;
|
|
247
|
-
imageData: ImageData | null;
|
|
248
|
-
positionObjectStages: PositionObjectStage[];
|
|
249
|
-
}
|
|
250
|
-
export interface EndAttemptInteractionData extends BaseInteractionData {
|
|
251
|
-
type: 'endAttemptInteraction';
|
|
252
|
-
prompt: string | null;
|
|
253
|
-
title: string;
|
|
254
|
-
/** Whether this interaction counts as an attempt (default: true) */
|
|
255
|
-
countAttempt: boolean;
|
|
256
|
-
}
|
|
257
|
-
export type InteractionData = ChoiceInteractionData | TextEntryInteractionData | ExtendedTextInteractionData | InlineChoiceInteractionData | OrderInteractionData | MatchInteractionData | AssociateInteractionData | GapMatchInteractionData | SliderInteractionData | HotspotInteractionData | GraphicGapMatchInteractionData | UploadInteractionData | DrawingInteractionData | CustomInteractionData | MediaInteractionData | HottextInteractionData | SelectPointInteractionData | GraphicOrderInteractionData | GraphicAssociateInteractionData | PositionObjectInteractionData | EndAttemptInteractionData;
|
|
258
|
-
/**
|
|
259
|
-
* QTI interaction type identifier
|
|
260
|
-
* Extensible string type allows custom interaction types
|
|
261
|
-
*/
|
|
262
|
-
export type InteractionType = string;
|
|
263
|
-
/**
|
|
264
|
-
* Map interaction types to their data structures
|
|
265
|
-
* TypeScript will ensure registrations use the correct data type
|
|
266
|
-
*/
|
|
267
|
-
export interface InteractionDataMap {
|
|
268
|
-
choiceInteraction: ChoiceInteractionData;
|
|
269
|
-
textEntryInteraction: TextEntryInteractionData;
|
|
270
|
-
extendedTextInteraction: ExtendedTextInteractionData;
|
|
271
|
-
inlineChoiceInteraction: InlineChoiceInteractionData;
|
|
272
|
-
orderInteraction: OrderInteractionData;
|
|
273
|
-
matchInteraction: MatchInteractionData;
|
|
274
|
-
associateInteraction: AssociateInteractionData;
|
|
275
|
-
gapMatchInteraction: GapMatchInteractionData;
|
|
276
|
-
sliderInteraction: SliderInteractionData;
|
|
277
|
-
hotspotInteraction: HotspotInteractionData;
|
|
278
|
-
graphicGapMatchInteraction: GraphicGapMatchInteractionData;
|
|
279
|
-
uploadInteraction: UploadInteractionData;
|
|
280
|
-
drawingInteraction: DrawingInteractionData;
|
|
281
|
-
customInteraction: CustomInteractionData;
|
|
282
|
-
mediaInteraction: MediaInteractionData;
|
|
283
|
-
hottextInteraction: HottextInteractionData;
|
|
284
|
-
selectPointInteraction: SelectPointInteractionData;
|
|
285
|
-
graphicOrderInteraction: GraphicOrderInteractionData;
|
|
286
|
-
graphicAssociateInteraction: GraphicAssociateInteractionData;
|
|
287
|
-
positionObjectInteraction: PositionObjectInteractionData;
|
|
288
|
-
endAttemptInteraction: EndAttemptInteractionData;
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Map interaction types to their response value types
|
|
292
|
-
* Ensures getValue/setValue use the correct types
|
|
293
|
-
*/
|
|
294
|
-
export interface InteractionValueMap {
|
|
295
|
-
choiceInteraction: string | string[];
|
|
296
|
-
textEntryInteraction: string;
|
|
297
|
-
extendedTextInteraction: string;
|
|
298
|
-
inlineChoiceInteraction: string;
|
|
299
|
-
orderInteraction: string[];
|
|
300
|
-
matchInteraction: Record<string, string>;
|
|
301
|
-
associateInteraction: Array<[string, string]>;
|
|
302
|
-
gapMatchInteraction: Record<string, string>;
|
|
303
|
-
sliderInteraction: number;
|
|
304
|
-
hotspotInteraction: string[];
|
|
305
|
-
graphicGapMatchInteraction: Record<string, string>;
|
|
306
|
-
uploadInteraction: import('../types/index.js').QTIFileResponse[];
|
|
307
|
-
drawingInteraction: string;
|
|
308
|
-
customInteraction: any;
|
|
309
|
-
mediaInteraction: any;
|
|
310
|
-
hottextInteraction: string[];
|
|
311
|
-
selectPointInteraction: Array<{
|
|
312
|
-
x: number;
|
|
313
|
-
y: number;
|
|
314
|
-
}>;
|
|
315
|
-
graphicOrderInteraction: string[];
|
|
316
|
-
graphicAssociateInteraction: Array<[string, string]>;
|
|
317
|
-
positionObjectInteraction: Record<string, {
|
|
318
|
-
x: number;
|
|
319
|
-
y: number;
|
|
320
|
-
}>;
|
|
321
|
-
endAttemptInteraction: boolean;
|
|
322
|
-
}
|
|
7
|
+
export type * from '../interactions/index.js';
|
|
323
8
|
//# sourceMappingURL=interactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../src/types/interactions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,
|
|
1
|
+
{"version":3,"file":"interactions.d.ts","sourceRoot":"","sources":["../../src/types/interactions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,mBAAmB,0BAA0B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Compatibility barrel for interaction data types.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Canonical interaction modules live under `../interactions`. This path remains
|
|
5
|
+
* for existing imports from `@pie-qti/item-player` and internal consumers.
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { HtmlContent } from '../types/index.js';
|
|
26
26
|
import type { InteractionData } from '../types/interactions.js';
|
|
27
|
-
import { type QTIInteractionElement } from './QTIInteractionElement.js';
|
|
28
|
-
export declare abstract class QTIInteractionBase<TData extends InteractionData = InteractionData> extends HTMLElement implements QTIInteractionElement {
|
|
27
|
+
import { type InteractionResponseValue, type QTIInteractionElement } from './QTIInteractionElement.js';
|
|
28
|
+
export declare abstract class QTIInteractionBase<TData extends InteractionData = InteractionData> extends HTMLElement implements QTIInteractionElement<TData> {
|
|
29
29
|
private _interaction;
|
|
30
30
|
private _response;
|
|
31
31
|
private _disabled;
|
|
@@ -44,8 +44,8 @@ export declare abstract class QTIInteractionBase<TData extends InteractionData =
|
|
|
44
44
|
* Current response value (type depends on interaction type)
|
|
45
45
|
* May be null if no response has been provided yet
|
|
46
46
|
*/
|
|
47
|
-
get response():
|
|
48
|
-
set response(value:
|
|
47
|
+
get response(): InteractionResponseValue<TData> | null;
|
|
48
|
+
set response(value: InteractionResponseValue<TData> | null);
|
|
49
49
|
/**
|
|
50
50
|
* Whether the interaction is in read-only/disabled mode
|
|
51
51
|
*/
|
|
@@ -89,7 +89,7 @@ export declare abstract class QTIInteractionBase<TData extends InteractionData =
|
|
|
89
89
|
* Emit a qti-change event when the user response changes
|
|
90
90
|
* @param value - The new response value
|
|
91
91
|
*/
|
|
92
|
-
protected emitChange(value:
|
|
92
|
+
protected emitChange(value: InteractionResponseValue<TData> | null): void;
|
|
93
93
|
/**
|
|
94
94
|
* Emit a qti-ready event when component is initialized
|
|
95
95
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QTIInteractionBase.d.ts","sourceRoot":"","sources":["../../src/web-components/QTIInteractionBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,
|
|
1
|
+
{"version":3,"file":"QTIInteractionBase.d.ts","sourceRoot":"","sources":["../../src/web-components/QTIInteractionBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GA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