@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
|
@@ -1,67 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI inlineChoiceInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from inlineChoiceInteraction elements (dropdown in text)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI inline choice interaction extractor
|
|
8
|
-
* Handles inlineChoiceInteraction elements (dropdown selections within text)
|
|
9
|
-
*/
|
|
10
|
-
export const standardInlineChoiceExtractor = {
|
|
11
|
-
id: 'qti:inline-choice-interaction',
|
|
12
|
-
name: 'QTI Standard Inline Choice Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['inlineChoiceInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI inlineChoiceInteraction (dropdown in text)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All inlineChoiceInteraction elements are standard
|
|
18
|
-
return element.rawTagName === 'inlineChoiceInteraction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract choices (inlineChoice children)
|
|
23
|
-
const inlineChoices = utils.getChildrenByTag(element, 'inlineChoice');
|
|
24
|
-
const choices = inlineChoices.map((choice) => ({
|
|
25
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
26
|
-
text: utils.getTextContent(choice),
|
|
27
|
-
}));
|
|
28
|
-
// Extract attributes
|
|
29
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle');
|
|
30
|
-
return {
|
|
31
|
-
choices,
|
|
32
|
-
shuffle,
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
validate(data) {
|
|
36
|
-
const errors = [];
|
|
37
|
-
const warnings = [];
|
|
38
|
-
// Validate choices exist
|
|
39
|
-
if (!data.choices || data.choices.length === 0) {
|
|
40
|
-
errors.push('inlineChoiceInteraction must have at least one choice');
|
|
41
|
-
}
|
|
42
|
-
// Validate choice identifiers
|
|
43
|
-
if (data.choices) {
|
|
44
|
-
const identifiers = new Set();
|
|
45
|
-
for (const choice of data.choices) {
|
|
46
|
-
if (!choice.identifier) {
|
|
47
|
-
errors.push('All choices must have an identifier');
|
|
48
|
-
}
|
|
49
|
-
else if (identifiers.has(choice.identifier)) {
|
|
50
|
-
errors.push(`Duplicate choice identifier: ${choice.identifier}`);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
identifiers.add(choice.identifier);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// Warn if too many choices
|
|
57
|
-
if (data.choices.length >= 10) {
|
|
58
|
-
warnings.push(`inlineChoiceInteraction has ${data.choices.length} choices - consider limiting for better usability`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
valid: errors.length === 0,
|
|
63
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
64
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
};
|
|
1
|
+
export * from '../../interactions/inline-choice/extractor.js';
|
|
@@ -1,32 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI matchInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from matchInteraction elements (matching pairs)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Match data extracted from matchInteraction elements
|
|
9
|
-
*/
|
|
10
|
-
export interface MatchData {
|
|
11
|
-
sourceSet: Array<{
|
|
12
|
-
identifier: string;
|
|
13
|
-
text: string;
|
|
14
|
-
matchMax: number;
|
|
15
|
-
classes?: string[];
|
|
16
|
-
}>;
|
|
17
|
-
targetSet: Array<{
|
|
18
|
-
identifier: string;
|
|
19
|
-
text: string;
|
|
20
|
-
matchMax: number;
|
|
21
|
-
classes?: string[];
|
|
22
|
-
}>;
|
|
23
|
-
shuffle: boolean;
|
|
24
|
-
maxAssociations: number;
|
|
25
|
-
prompt: string | null;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Standard QTI match interaction extractor
|
|
29
|
-
* Handles matchInteraction elements (matching pairs between two sets)
|
|
30
|
-
*/
|
|
31
|
-
export declare const standardMatchExtractor: ElementExtractor<MatchData>;
|
|
1
|
+
export * from '../../interactions/match/extractor.js';
|
|
32
2
|
//# sourceMappingURL=matchExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/matchExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"matchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/matchExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
|
@@ -1,134 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI matchInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from matchInteraction elements (matching pairs)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI match interaction extractor
|
|
8
|
-
* Handles matchInteraction elements (matching pairs between two sets)
|
|
9
|
-
*/
|
|
10
|
-
export const standardMatchExtractor = {
|
|
11
|
-
id: 'qti:match-interaction',
|
|
12
|
-
name: 'QTI Standard Match Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['matchInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI matchInteraction (matching pairs)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All matchInteraction elements are standard (both QTI 2.x and 3.0)
|
|
18
|
-
return element.rawTagName === 'matchInteraction' || element.rawTagName === 'qti-match-interaction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract all simpleAssociableChoice children
|
|
23
|
-
const allChoices = utils.getChildrenByTag(element, 'simpleAssociableChoice');
|
|
24
|
-
// Determine which are source vs target based on matchSet structure
|
|
25
|
-
// In QTI, matchInteraction can have two simpleMatchSet elements
|
|
26
|
-
const matchSets = utils.getChildrenByTag(element, 'simpleMatchSet');
|
|
27
|
-
let sourceSet = [];
|
|
28
|
-
let targetSet = [];
|
|
29
|
-
if (matchSets.length >= 2) {
|
|
30
|
-
// Extract choices from first matchSet (source)
|
|
31
|
-
const sourceMatchSet = matchSets[0];
|
|
32
|
-
const sourceElements = utils.getChildrenByTag(sourceMatchSet, 'simpleAssociableChoice');
|
|
33
|
-
sourceSet = sourceElements.map((choice) => {
|
|
34
|
-
const classes = utils.getClasses(choice);
|
|
35
|
-
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 1);
|
|
36
|
-
return {
|
|
37
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
38
|
-
text: utils.getHtmlContent(choice),
|
|
39
|
-
matchMax,
|
|
40
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
// Extract choices from second matchSet (target)
|
|
44
|
-
const targetMatchSet = matchSets[1];
|
|
45
|
-
const targetElements = utils.getChildrenByTag(targetMatchSet, 'simpleAssociableChoice');
|
|
46
|
-
targetSet = targetElements.map((choice) => {
|
|
47
|
-
const classes = utils.getClasses(choice);
|
|
48
|
-
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 1);
|
|
49
|
-
return {
|
|
50
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
51
|
-
text: utils.getHtmlContent(choice),
|
|
52
|
-
matchMax,
|
|
53
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
// Fallback: treat all choices as both source and target
|
|
59
|
-
const extractedChoices = allChoices.map((choice) => {
|
|
60
|
-
const classes = utils.getClasses(choice);
|
|
61
|
-
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 1);
|
|
62
|
-
return {
|
|
63
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
64
|
-
text: utils.getHtmlContent(choice),
|
|
65
|
-
matchMax,
|
|
66
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
sourceSet = extractedChoices;
|
|
70
|
-
targetSet = extractedChoices;
|
|
71
|
-
}
|
|
72
|
-
// Extract attributes
|
|
73
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle');
|
|
74
|
-
const maxAssociations = utils.getNumberAttribute(element, 'maxAssociations', 1);
|
|
75
|
-
// Extract prompt (optional)
|
|
76
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
77
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
78
|
-
return {
|
|
79
|
-
sourceSet,
|
|
80
|
-
targetSet,
|
|
81
|
-
shuffle,
|
|
82
|
-
maxAssociations,
|
|
83
|
-
prompt,
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
validate(data) {
|
|
87
|
-
const errors = [];
|
|
88
|
-
// Validate source choices exist
|
|
89
|
-
if (!data.sourceSet || data.sourceSet.length === 0) {
|
|
90
|
-
errors.push('matchInteraction must have at least one source choice');
|
|
91
|
-
}
|
|
92
|
-
// Validate target choices exist
|
|
93
|
-
if (!data.targetSet || data.targetSet.length === 0) {
|
|
94
|
-
errors.push('matchInteraction must have at least one target choice');
|
|
95
|
-
}
|
|
96
|
-
// Validate choice identifiers
|
|
97
|
-
if (data.sourceSet) {
|
|
98
|
-
const identifiers = new Set();
|
|
99
|
-
for (const choice of data.sourceSet) {
|
|
100
|
-
if (!choice.identifier) {
|
|
101
|
-
errors.push('All source choices must have an identifier');
|
|
102
|
-
}
|
|
103
|
-
else if (identifiers.has(choice.identifier)) {
|
|
104
|
-
errors.push(`Duplicate source identifier: ${choice.identifier}`);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
identifiers.add(choice.identifier);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (data.targetSet) {
|
|
112
|
-
const identifiers = new Set();
|
|
113
|
-
for (const choice of data.targetSet) {
|
|
114
|
-
if (!choice.identifier) {
|
|
115
|
-
errors.push('All target choices must have an identifier');
|
|
116
|
-
}
|
|
117
|
-
else if (identifiers.has(choice.identifier)) {
|
|
118
|
-
errors.push(`Duplicate target identifier: ${choice.identifier}`);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
identifiers.add(choice.identifier);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// Validate maxAssociations
|
|
126
|
-
if (data.maxAssociations < 0) {
|
|
127
|
-
errors.push('maxAssociations must be non-negative');
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
valid: errors.length === 0,
|
|
131
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
132
|
-
};
|
|
133
|
-
},
|
|
134
|
-
};
|
|
1
|
+
export * from '../../interactions/match/extractor.js';
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI mediaInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from mediaInteraction elements (video/audio playback)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Media element data
|
|
9
|
-
*/
|
|
10
|
-
export interface MediaElement {
|
|
11
|
-
type: 'audio' | 'video' | 'object';
|
|
12
|
-
src: string;
|
|
13
|
-
mimeType: string;
|
|
14
|
-
width?: number;
|
|
15
|
-
height?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Media data extracted from mediaInteraction elements
|
|
19
|
-
*/
|
|
20
|
-
export interface MediaData {
|
|
21
|
-
mediaElement: MediaElement | null;
|
|
22
|
-
autostart: boolean;
|
|
23
|
-
minPlays: number;
|
|
24
|
-
maxPlays: number;
|
|
25
|
-
loop: boolean;
|
|
26
|
-
prompt: string | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Standard QTI media interaction extractor
|
|
30
|
-
* Handles mediaInteraction elements (video/audio playback with interaction)
|
|
31
|
-
*/
|
|
32
|
-
export declare const standardMediaExtractor: ElementExtractor<MediaData>;
|
|
1
|
+
export * from '../../interactions/media/extractor.js';
|
|
33
2
|
//# sourceMappingURL=mediaExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/mediaExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mediaExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/mediaExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
|
@@ -1,125 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI mediaInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from mediaInteraction elements (video/audio playback)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI media interaction extractor
|
|
8
|
-
* Handles mediaInteraction elements (video/audio playback with interaction)
|
|
9
|
-
*/
|
|
10
|
-
export const standardMediaExtractor = {
|
|
11
|
-
id: 'qti:media-interaction',
|
|
12
|
-
name: 'QTI Standard Media Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['mediaInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI mediaInteraction (video/audio playback)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All mediaInteraction elements are standard
|
|
18
|
-
return element.rawTagName === 'mediaInteraction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract attributes
|
|
23
|
-
const autostart = utils.getBooleanAttribute(element, 'autostart', false);
|
|
24
|
-
const minPlays = utils.getNumberAttribute(element, 'minPlays', 0);
|
|
25
|
-
const maxPlays = utils.getNumberAttribute(element, 'maxPlays', 0);
|
|
26
|
-
const loop = utils.getBooleanAttribute(element, 'loop', false);
|
|
27
|
-
// Extract prompt (optional)
|
|
28
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
29
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
30
|
-
// Extract media element (audio, video, or object)
|
|
31
|
-
let mediaElement = null;
|
|
32
|
-
// Check for audio element
|
|
33
|
-
const audioElements = utils.getChildrenByTag(element, 'audio');
|
|
34
|
-
if (audioElements.length > 0) {
|
|
35
|
-
const audioElement = audioElements[0];
|
|
36
|
-
const sourceElements = utils.getChildrenByTag(audioElement, 'source');
|
|
37
|
-
if (sourceElements.length === 0) {
|
|
38
|
-
throw new Error('audio element must contain at least one source element');
|
|
39
|
-
}
|
|
40
|
-
const firstSource = sourceElements[0];
|
|
41
|
-
mediaElement = {
|
|
42
|
-
type: 'audio',
|
|
43
|
-
src: utils.getAttribute(firstSource, 'src', ''),
|
|
44
|
-
mimeType: utils.getAttribute(firstSource, 'type', ''),
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
// Check for video element
|
|
48
|
-
const videoElements = utils.getChildrenByTag(element, 'video');
|
|
49
|
-
if (videoElements.length > 0) {
|
|
50
|
-
const videoElement = videoElements[0];
|
|
51
|
-
const sourceElements = utils.getChildrenByTag(videoElement, 'source');
|
|
52
|
-
if (sourceElements.length === 0) {
|
|
53
|
-
throw new Error('video element must contain at least one source element');
|
|
54
|
-
}
|
|
55
|
-
const firstSource = sourceElements[0];
|
|
56
|
-
const width = utils.getNumberAttribute(videoElement, 'width', 640);
|
|
57
|
-
const height = utils.getNumberAttribute(videoElement, 'height', 480);
|
|
58
|
-
mediaElement = {
|
|
59
|
-
type: 'video',
|
|
60
|
-
src: utils.getAttribute(firstSource, 'src', ''),
|
|
61
|
-
mimeType: utils.getAttribute(firstSource, 'type', ''),
|
|
62
|
-
width,
|
|
63
|
-
height,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
// Check for object element
|
|
67
|
-
const objectElements = utils.getChildrenByTag(element, 'object');
|
|
68
|
-
if (objectElements.length > 0) {
|
|
69
|
-
const objectElement = objectElements[0];
|
|
70
|
-
const data = utils.getAttribute(objectElement, 'data', '');
|
|
71
|
-
if (!data) {
|
|
72
|
-
throw new Error('object element must have data attribute');
|
|
73
|
-
}
|
|
74
|
-
const width = utils.getNumberAttribute(objectElement, 'width', 0);
|
|
75
|
-
const height = utils.getNumberAttribute(objectElement, 'height', 0);
|
|
76
|
-
mediaElement = {
|
|
77
|
-
type: 'object',
|
|
78
|
-
src: data,
|
|
79
|
-
mimeType: utils.getAttribute(objectElement, 'type', ''),
|
|
80
|
-
...(width > 0 ? { width } : {}),
|
|
81
|
-
...(height > 0 ? { height } : {}),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
// Throw error if no media element found
|
|
85
|
-
if (!mediaElement) {
|
|
86
|
-
throw new Error('mediaInteraction must contain audio, video, or object element');
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
mediaElement,
|
|
90
|
-
autostart,
|
|
91
|
-
minPlays,
|
|
92
|
-
maxPlays,
|
|
93
|
-
loop,
|
|
94
|
-
prompt,
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
validate(data) {
|
|
98
|
-
const errors = [];
|
|
99
|
-
const warnings = [];
|
|
100
|
-
// Validate media element exists
|
|
101
|
-
if (!data.mediaElement) {
|
|
102
|
-
errors.push('mediaInteraction must have a mediaElement');
|
|
103
|
-
}
|
|
104
|
-
// Validate play constraints
|
|
105
|
-
if (data.minPlays < 0) {
|
|
106
|
-
errors.push('minPlays must be non-negative');
|
|
107
|
-
}
|
|
108
|
-
if (data.maxPlays < 0) {
|
|
109
|
-
errors.push('maxPlays must be non-negative');
|
|
110
|
-
}
|
|
111
|
-
// Validate minPlays <= maxPlays (when maxPlays > 0, as 0 means unlimited)
|
|
112
|
-
if (data.maxPlays > 0 && data.minPlays > data.maxPlays) {
|
|
113
|
-
errors.push(`maxPlays (${data.maxPlays}) must be greater than or equal to minPlays (${data.minPlays})`);
|
|
114
|
-
}
|
|
115
|
-
// Warn if loop is true with maxPlays
|
|
116
|
-
if (data.loop && data.maxPlays > 0) {
|
|
117
|
-
warnings.push('mediaInteraction has loop=true with maxPlays - loop may be ignored');
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
valid: errors.length === 0,
|
|
121
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
122
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
123
|
-
};
|
|
124
|
-
},
|
|
125
|
-
};
|
|
1
|
+
export * from '../../interactions/media/extractor.js';
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI orderInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from orderInteraction elements (ordering/ranking tasks)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Order data extracted from orderInteraction elements
|
|
9
|
-
*/
|
|
10
|
-
export interface OrderData {
|
|
11
|
-
choices: Array<{
|
|
12
|
-
identifier: string;
|
|
13
|
-
text: string;
|
|
14
|
-
fixed?: boolean;
|
|
15
|
-
classes?: string[];
|
|
16
|
-
}>;
|
|
17
|
-
shuffle: boolean;
|
|
18
|
-
orientation?: string;
|
|
19
|
-
prompt: string | null;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Standard QTI order interaction extractor
|
|
23
|
-
* Handles orderInteraction elements with simpleChoice children
|
|
24
|
-
*/
|
|
25
|
-
export declare const standardOrderExtractor: ElementExtractor<OrderData>;
|
|
1
|
+
export * from '../../interactions/order/extractor.js';
|
|
26
2
|
//# sourceMappingURL=orderExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/orderExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"orderExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/orderExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
|
@@ -1,86 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI orderInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from orderInteraction elements (ordering/ranking tasks)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI order interaction extractor
|
|
8
|
-
* Handles orderInteraction elements with simpleChoice children
|
|
9
|
-
*/
|
|
10
|
-
export const standardOrderExtractor = {
|
|
11
|
-
id: 'qti:order-interaction',
|
|
12
|
-
name: 'QTI Standard Order Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['orderInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI orderInteraction (ordering/ranking tasks)',
|
|
16
|
-
canHandle(element, context) {
|
|
17
|
-
// Standard QTI order interactions have simpleChoice children
|
|
18
|
-
return context.utils.hasChildWithTag(element, 'simpleChoice');
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract choices
|
|
23
|
-
const simpleChoices = utils.getChildrenByTag(element, 'simpleChoice');
|
|
24
|
-
const choices = simpleChoices.map((choice) => {
|
|
25
|
-
const classes = utils.getClasses(choice);
|
|
26
|
-
const fixed = utils.getBooleanAttribute(choice, 'fixed');
|
|
27
|
-
return {
|
|
28
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
29
|
-
text: utils.getHtmlContent(choice),
|
|
30
|
-
...(fixed ? { fixed } : {}),
|
|
31
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
// Extract prompt
|
|
35
|
-
const promptElement = utils.querySelector(element, 'prompt');
|
|
36
|
-
const prompt = promptElement ? utils.getHtmlContent(promptElement) : null;
|
|
37
|
-
// Extract attributes
|
|
38
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle');
|
|
39
|
-
const orientation = utils.getAttribute(element, 'orientation', 'vertical');
|
|
40
|
-
return {
|
|
41
|
-
choices,
|
|
42
|
-
shuffle,
|
|
43
|
-
orientation,
|
|
44
|
-
prompt,
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
validate(data) {
|
|
48
|
-
const errors = [];
|
|
49
|
-
const warnings = [];
|
|
50
|
-
// Validate choices exist
|
|
51
|
-
if (!data.choices || data.choices.length < 2) {
|
|
52
|
-
errors.push('orderInteraction must have at least 2 choices');
|
|
53
|
-
}
|
|
54
|
-
// Warn if too many choices (difficult to order)
|
|
55
|
-
if (data.choices && data.choices.length > 10) {
|
|
56
|
-
warnings.push(`orderInteraction has ${data.choices.length} choices - this may be difficult for users to order`);
|
|
57
|
-
}
|
|
58
|
-
// Validate choice identifiers
|
|
59
|
-
if (data.choices) {
|
|
60
|
-
const identifiers = new Set();
|
|
61
|
-
for (const choice of data.choices) {
|
|
62
|
-
if (!choice.identifier) {
|
|
63
|
-
errors.push('All choices must have an identifier');
|
|
64
|
-
}
|
|
65
|
-
else if (identifiers.has(choice.identifier)) {
|
|
66
|
-
errors.push(`Duplicate choice identifier: ${choice.identifier}`);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
identifiers.add(choice.identifier);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
// Validate orientation (only if provided)
|
|
74
|
-
if (data.orientation) {
|
|
75
|
-
const validOrientations = ['vertical', 'horizontal'];
|
|
76
|
-
if (!validOrientations.includes(data.orientation)) {
|
|
77
|
-
warnings.push(`orientation '${data.orientation}' is not standard (expected: ${validOrientations.join(', ')})`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
valid: errors.length === 0,
|
|
82
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
83
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
};
|
|
1
|
+
export * from '../../interactions/order/extractor.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portableCustomExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/portableCustomExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../interactions/portable-custom/extractor.js';
|
|
@@ -1,59 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI positionObjectInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from positionObjectInteraction elements (drag objects to positions)
|
|
5
|
-
*
|
|
6
|
-
* ⚠️ IMPORTANT: QTI 2.2 positionObjectInteraction Limitations
|
|
7
|
-
*
|
|
8
|
-
* This interaction has severe limitations that make it impractical for most educational scenarios:
|
|
9
|
-
*
|
|
10
|
-
* 1. Response format is baseType="point" - only stores coordinates ["158 168"]
|
|
11
|
-
* 2. NO way to track which specific object was placed where
|
|
12
|
-
* 3. Designed ONLY for placing multiple copies of the SAME object (e.g., airport icons)
|
|
13
|
-
* 4. Cannot support "place labeled objects on map" use cases
|
|
14
|
-
*
|
|
15
|
-
* The official QTI 2.2 spec example shows:
|
|
16
|
-
* - ONE positionObjectStage (container) with background image
|
|
17
|
-
* - ONE positionObjectInteraction with ONE draggable object
|
|
18
|
-
* - maxChoices determines how many times the object can be placed
|
|
19
|
-
* - Scoring uses areaMapping to check if ANY placement hits target zones
|
|
20
|
-
*
|
|
21
|
-
* This extractor supports a NON-STANDARD extension with multiple positionObjectStage
|
|
22
|
-
* elements (each with identifiers), but the response format cannot preserve object identity.
|
|
23
|
-
* For labeled-object placement, use graphicGapMatchInteraction instead.
|
|
24
|
-
*/
|
|
25
|
-
import type { ElementExtractor } from '../types.js';
|
|
26
|
-
/**
|
|
27
|
-
* Image data for position object interaction
|
|
28
|
-
*/
|
|
29
|
-
export interface ImageData {
|
|
30
|
-
type: 'image' | 'svg';
|
|
31
|
-
src?: string;
|
|
32
|
-
content?: string;
|
|
33
|
-
width?: string;
|
|
34
|
-
height?: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Position object data extracted from positionObjectInteraction elements
|
|
38
|
-
*/
|
|
39
|
-
export interface PositionObjectData {
|
|
40
|
-
imageData: ImageData | null;
|
|
41
|
-
positionObjectStages: Array<{
|
|
42
|
-
identifier: string;
|
|
43
|
-
label: string;
|
|
44
|
-
matchMax: number;
|
|
45
|
-
matchMin?: number;
|
|
46
|
-
objectData: ImageData | null;
|
|
47
|
-
classes?: string[];
|
|
48
|
-
}>;
|
|
49
|
-
centerPoint: boolean;
|
|
50
|
-
maxChoices: number;
|
|
51
|
-
minChoices: number;
|
|
52
|
-
prompt: string | null;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Standard QTI position object interaction extractor
|
|
56
|
-
* Handles positionObjectInteraction elements (dragging an object to a position)
|
|
57
|
-
*/
|
|
58
|
-
export declare const standardPositionObjectExtractor: ElementExtractor<PositionObjectData>;
|
|
1
|
+
export * from '../../interactions/position-object/extractor.js';
|
|
59
2
|
//# sourceMappingURL=positionObjectExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positionObjectExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/positionObjectExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"positionObjectExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/positionObjectExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
|