@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,121 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI graphicOrderInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from graphicOrderInteraction elements (order items on image)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI graphic order interaction extractor
|
|
8
|
-
* Handles graphicOrderInteraction elements (ordering hotspots on an image)
|
|
9
|
-
*/
|
|
10
|
-
export const standardGraphicOrderExtractor = {
|
|
11
|
-
id: 'qti:graphic-order-interaction',
|
|
12
|
-
name: 'QTI Standard Graphic Order Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['graphicOrderInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI graphicOrderInteraction (order items on image)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All graphicOrderInteraction elements are standard
|
|
18
|
-
return element.rawTagName === 'graphicOrderInteraction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract image data from object element
|
|
23
|
-
const objectElements = utils.getChildrenByTag(element, 'object');
|
|
24
|
-
let imageData = null;
|
|
25
|
-
if (objectElements.length > 0) {
|
|
26
|
-
const objectElement = objectElements[0];
|
|
27
|
-
const type = utils.getAttribute(objectElement, 'type', '');
|
|
28
|
-
const data = utils.getAttribute(objectElement, 'data', '');
|
|
29
|
-
const width = utils.getAttribute(objectElement, 'width', '500');
|
|
30
|
-
const height = utils.getAttribute(objectElement, 'height', '300');
|
|
31
|
-
if (type.startsWith('image/svg')) {
|
|
32
|
-
// Extract inline SVG content - get full content including <svg> tag
|
|
33
|
-
const content = utils.getHtmlContent(objectElement);
|
|
34
|
-
imageData = {
|
|
35
|
-
type: 'svg',
|
|
36
|
-
content,
|
|
37
|
-
width,
|
|
38
|
-
height,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
// External image reference
|
|
43
|
-
imageData = {
|
|
44
|
-
type: 'image',
|
|
45
|
-
src: data,
|
|
46
|
-
width,
|
|
47
|
-
height,
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// Extract hotspotChoice children
|
|
52
|
-
const hotspotElements = utils.getChildrenByTag(element, 'hotspotChoice');
|
|
53
|
-
const hotspotChoices = hotspotElements.map((hotspot) => {
|
|
54
|
-
const classes = utils.getClasses(hotspot);
|
|
55
|
-
const identifier = utils.getAttribute(hotspot, 'identifier', '');
|
|
56
|
-
const shape = utils.getAttribute(hotspot, 'shape', 'rect');
|
|
57
|
-
const coords = utils.getAttribute(hotspot, 'coords', '0,0,50,50');
|
|
58
|
-
const fixed = utils.getBooleanAttribute(hotspot, 'fixed');
|
|
59
|
-
// Get text content as label, use identifier as fallback
|
|
60
|
-
const textContent = utils.getTextContent(hotspot).trim();
|
|
61
|
-
const label = textContent || identifier;
|
|
62
|
-
return {
|
|
63
|
-
identifier,
|
|
64
|
-
label,
|
|
65
|
-
shape,
|
|
66
|
-
coords,
|
|
67
|
-
...(fixed ? { fixed } : {}),
|
|
68
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
69
|
-
};
|
|
70
|
-
});
|
|
71
|
-
// Extract prompt (optional)
|
|
72
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
73
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
74
|
-
return {
|
|
75
|
-
imageData,
|
|
76
|
-
hotspotChoices,
|
|
77
|
-
prompt,
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
validate(data) {
|
|
81
|
-
const errors = [];
|
|
82
|
-
const warnings = [];
|
|
83
|
-
// Validate image data
|
|
84
|
-
if (!data.imageData) {
|
|
85
|
-
warnings.push('graphicOrderInteraction has no image data');
|
|
86
|
-
}
|
|
87
|
-
else if (data.imageData.type === 'image' && !data.imageData.src) {
|
|
88
|
-
errors.push('graphicOrderInteraction must have an image URL');
|
|
89
|
-
}
|
|
90
|
-
else if (data.imageData.type === 'svg' && !data.imageData.content) {
|
|
91
|
-
errors.push('graphicOrderInteraction must have SVG content');
|
|
92
|
-
}
|
|
93
|
-
// Validate hotspot choices exist
|
|
94
|
-
if (!data.hotspotChoices || data.hotspotChoices.length < 2) {
|
|
95
|
-
errors.push('graphicOrderInteraction must have at least 2 hotspots');
|
|
96
|
-
}
|
|
97
|
-
// Validate hotspot choice identifiers and coords
|
|
98
|
-
if (data.hotspotChoices) {
|
|
99
|
-
const identifiers = new Set();
|
|
100
|
-
for (const hotspot of data.hotspotChoices) {
|
|
101
|
-
if (!hotspot.identifier) {
|
|
102
|
-
errors.push('All hotspot choices must have an identifier');
|
|
103
|
-
}
|
|
104
|
-
else if (identifiers.has(hotspot.identifier)) {
|
|
105
|
-
errors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
identifiers.add(hotspot.identifier);
|
|
109
|
-
}
|
|
110
|
-
if (!hotspot.coords) {
|
|
111
|
-
errors.push(`Hotspot ${hotspot.identifier} must have coords`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return {
|
|
116
|
-
valid: errors.length === 0,
|
|
117
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
118
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
119
|
-
};
|
|
120
|
-
},
|
|
121
|
-
};
|
|
1
|
+
export * from '../../interactions/graphic-order/extractor.js';
|
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI hotspotInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from hotspotInteraction elements (clickable areas on image)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Image data for hotspot interaction
|
|
9
|
-
*/
|
|
10
|
-
export interface ImageData {
|
|
11
|
-
type: 'image' | 'svg';
|
|
12
|
-
src?: string;
|
|
13
|
-
content?: string;
|
|
14
|
-
width?: string;
|
|
15
|
-
height?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Hotspot data extracted from hotspotInteraction elements
|
|
19
|
-
*/
|
|
20
|
-
export interface HotspotData {
|
|
21
|
-
imageData: ImageData | null;
|
|
22
|
-
hotspotChoices: Array<{
|
|
23
|
-
identifier: string;
|
|
24
|
-
shape: 'circle' | 'rect' | 'poly' | 'ellipse' | 'default';
|
|
25
|
-
coords: string;
|
|
26
|
-
hotspotLabel?: string;
|
|
27
|
-
classes?: string[];
|
|
28
|
-
}>;
|
|
29
|
-
maxChoices: number;
|
|
30
|
-
minChoices?: number;
|
|
31
|
-
prompt: string | null;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Standard QTI hotspot interaction extractor
|
|
35
|
-
* Handles hotspotInteraction elements (clickable areas on an image)
|
|
36
|
-
*/
|
|
37
|
-
export declare const standardHotspotExtractor: ElementExtractor<HotspotData>;
|
|
1
|
+
export * from '../../interactions/hotspot/extractor.js';
|
|
38
2
|
//# sourceMappingURL=hotspotExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hotspotExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/hotspotExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hotspotExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/hotspotExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC"}
|
|
@@ -1,140 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI hotspotInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from hotspotInteraction elements (clickable areas on image)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI hotspot interaction extractor
|
|
8
|
-
* Handles hotspotInteraction elements (clickable areas on an image)
|
|
9
|
-
*/
|
|
10
|
-
export const standardHotspotExtractor = {
|
|
11
|
-
id: 'qti:hotspot-interaction',
|
|
12
|
-
name: 'QTI Standard Hotspot Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['hotspotInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI hotspotInteraction (clickable areas on image)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All hotspotInteraction elements are standard
|
|
18
|
-
return element.rawTagName === 'hotspotInteraction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract image data from object element
|
|
23
|
-
const objectElements = utils.getChildrenByTag(element, 'object');
|
|
24
|
-
let imageData = null;
|
|
25
|
-
if (objectElements.length > 0) {
|
|
26
|
-
const objectElement = objectElements[0];
|
|
27
|
-
const type = utils.getAttribute(objectElement, 'type', '');
|
|
28
|
-
const data = utils.getAttribute(objectElement, 'data', '');
|
|
29
|
-
const width = utils.getAttribute(objectElement, 'width', 'auto');
|
|
30
|
-
const height = utils.getAttribute(objectElement, 'height', 'auto');
|
|
31
|
-
if (type.startsWith('image/svg')) {
|
|
32
|
-
// Extract inline SVG content - keep the full <svg>...</svg> markup.
|
|
33
|
-
// (Using the innerHTML of the <svg> element would drop the wrapper tag and render as plain text.)
|
|
34
|
-
const content = utils.getHtmlContent(objectElement);
|
|
35
|
-
imageData = {
|
|
36
|
-
type: 'svg',
|
|
37
|
-
content,
|
|
38
|
-
width,
|
|
39
|
-
height,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
// External image reference
|
|
44
|
-
imageData = {
|
|
45
|
-
type: 'image',
|
|
46
|
-
src: data,
|
|
47
|
-
width,
|
|
48
|
-
height,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// Extract hotspotChoice children
|
|
53
|
-
const hotspotElements = utils.getChildrenByTag(element, 'hotspotChoice');
|
|
54
|
-
const hotspotChoices = hotspotElements.map((hotspot) => {
|
|
55
|
-
const classes = utils.getClasses(hotspot);
|
|
56
|
-
const shape = utils.getAttribute(hotspot, 'shape', 'rect');
|
|
57
|
-
const coords = utils.getAttribute(hotspot, 'coords', '');
|
|
58
|
-
const hotspotLabel = utils.getAttribute(hotspot, 'hotspotLabel', '');
|
|
59
|
-
return {
|
|
60
|
-
identifier: utils.getAttribute(hotspot, 'identifier', ''),
|
|
61
|
-
shape: shape,
|
|
62
|
-
coords,
|
|
63
|
-
...(hotspotLabel ? { hotspotLabel } : {}),
|
|
64
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
// Extract attributes
|
|
68
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
|
|
69
|
-
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
70
|
-
// Extract prompt (optional)
|
|
71
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
72
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
73
|
-
return {
|
|
74
|
-
imageData,
|
|
75
|
-
hotspotChoices,
|
|
76
|
-
maxChoices,
|
|
77
|
-
...(minChoices > 0 ? { minChoices } : {}),
|
|
78
|
-
prompt,
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
validate(data) {
|
|
82
|
-
const errors = [];
|
|
83
|
-
const warnings = [];
|
|
84
|
-
// Validate image data
|
|
85
|
-
if (!data.imageData) {
|
|
86
|
-
warnings.push('hotspotInteraction has no image data');
|
|
87
|
-
}
|
|
88
|
-
else if (data.imageData.type === 'image' && !data.imageData.src) {
|
|
89
|
-
errors.push('hotspotInteraction must have an image URL');
|
|
90
|
-
}
|
|
91
|
-
else if (data.imageData.type === 'svg' && !data.imageData.content) {
|
|
92
|
-
errors.push('hotspotInteraction must have SVG content');
|
|
93
|
-
}
|
|
94
|
-
// Validate hotspots exist
|
|
95
|
-
if (!data.hotspotChoices || data.hotspotChoices.length === 0) {
|
|
96
|
-
errors.push('hotspotInteraction must have at least one hotspot');
|
|
97
|
-
}
|
|
98
|
-
// Validate hotspot identifiers and coords
|
|
99
|
-
if (data.hotspotChoices && data.hotspotChoices.length > 0) {
|
|
100
|
-
const identifiers = new Set();
|
|
101
|
-
for (const hotspot of data.hotspotChoices) {
|
|
102
|
-
if (!hotspot.identifier) {
|
|
103
|
-
errors.push('All hotspots must have an identifier');
|
|
104
|
-
}
|
|
105
|
-
else if (identifiers.has(hotspot.identifier)) {
|
|
106
|
-
errors.push(`Duplicate hotspot identifier: ${hotspot.identifier}`);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
identifiers.add(hotspot.identifier);
|
|
110
|
-
}
|
|
111
|
-
if (!hotspot.coords) {
|
|
112
|
-
errors.push(`Hotspot ${hotspot.identifier} must have coords`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
// Warn if maxChoices exceeds hotspot count
|
|
116
|
-
if (data.maxChoices > data.hotspotChoices.length) {
|
|
117
|
-
warnings.push(`maxChoices (${data.maxChoices}) exceeds the number of hotspots (${data.hotspotChoices.length})`);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// Validate maxChoices
|
|
121
|
-
if (data.maxChoices < 0) {
|
|
122
|
-
errors.push('maxChoices must be non-negative');
|
|
123
|
-
}
|
|
124
|
-
// Validate minChoices
|
|
125
|
-
if (data.minChoices !== undefined && data.minChoices < 0) {
|
|
126
|
-
errors.push('minChoices must be non-negative');
|
|
127
|
-
}
|
|
128
|
-
// Validate minChoices <= maxChoices
|
|
129
|
-
if (data.minChoices !== undefined &&
|
|
130
|
-
data.maxChoices > 0 &&
|
|
131
|
-
data.minChoices > data.maxChoices) {
|
|
132
|
-
errors.push('minChoices cannot exceed maxChoices');
|
|
133
|
-
}
|
|
134
|
-
return {
|
|
135
|
-
valid: errors.length === 0,
|
|
136
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
137
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
138
|
-
};
|
|
139
|
-
},
|
|
140
|
-
};
|
|
1
|
+
export * from '../../interactions/hotspot/extractor.js';
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI hottextInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from hottextInteraction elements (select text spans)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Hottext data extracted from hottextInteraction elements
|
|
9
|
-
*/
|
|
10
|
-
export interface HottextData {
|
|
11
|
-
hottextChoices: Array<{
|
|
12
|
-
identifier: string;
|
|
13
|
-
text: string;
|
|
14
|
-
classes?: string[];
|
|
15
|
-
}>;
|
|
16
|
-
contentHtml: string;
|
|
17
|
-
maxChoices: number;
|
|
18
|
-
minChoices?: number;
|
|
19
|
-
prompt: string | null;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Standard QTI hottext interaction extractor
|
|
23
|
-
* Handles hottextInteraction elements (selectable text spans)
|
|
24
|
-
*/
|
|
25
|
-
export declare const standardHottextExtractor: ElementExtractor<HottextData>;
|
|
1
|
+
export * from '../../interactions/hottext/extractor.js';
|
|
26
2
|
//# sourceMappingURL=hottextExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hottextExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/hottextExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hottextExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/hottextExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC"}
|
|
@@ -1,120 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI hottextInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from hottextInteraction elements (select text spans)
|
|
5
|
-
*/
|
|
6
|
-
import { sanitizeHtml } from '../../core/sanitizer.js';
|
|
7
|
-
/**
|
|
8
|
-
* Standard QTI hottext interaction extractor
|
|
9
|
-
* Handles hottextInteraction elements (selectable text spans)
|
|
10
|
-
*/
|
|
11
|
-
export const standardHottextExtractor = {
|
|
12
|
-
id: 'qti:hottext-interaction',
|
|
13
|
-
name: 'QTI Standard Hottext Interaction',
|
|
14
|
-
priority: 10,
|
|
15
|
-
elementTypes: ['hottextInteraction'],
|
|
16
|
-
description: 'Extracts standard QTI hottextInteraction (select text spans)',
|
|
17
|
-
canHandle(element, _context) {
|
|
18
|
-
// All hottextInteraction elements are standard
|
|
19
|
-
return element.rawTagName === 'hottextInteraction';
|
|
20
|
-
},
|
|
21
|
-
extract(element, context) {
|
|
22
|
-
const { utils } = context;
|
|
23
|
-
// Extract hottext children (selectable text spans) - recursively search entire tree
|
|
24
|
-
const findHottextElements = (el) => {
|
|
25
|
-
const results = [];
|
|
26
|
-
if (el.rawTagName === 'hottext') {
|
|
27
|
-
results.push(el);
|
|
28
|
-
}
|
|
29
|
-
if (el.childNodes) {
|
|
30
|
-
for (const child of el.childNodes) {
|
|
31
|
-
if (typeof child !== 'string') {
|
|
32
|
-
results.push(...findHottextElements(child));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return results;
|
|
37
|
-
};
|
|
38
|
-
const hottextElements = findHottextElements(element);
|
|
39
|
-
const hottextChoices = hottextElements.map((hottext) => {
|
|
40
|
-
const classes = utils.getClasses(hottext);
|
|
41
|
-
return {
|
|
42
|
-
identifier: utils.getAttribute(hottext, 'identifier', ''),
|
|
43
|
-
text: utils.getTextContent(hottext),
|
|
44
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
// Extract attributes
|
|
48
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
|
|
49
|
-
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
50
|
-
// Extract prompt (optional)
|
|
51
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
52
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
53
|
-
// Extract content HTML (all content except prompt)
|
|
54
|
-
let contentHtml = '';
|
|
55
|
-
for (const child of element.childNodes) {
|
|
56
|
-
// Skip prompt elements
|
|
57
|
-
if (typeof child !== 'string' && child.rawTagName !== 'prompt') {
|
|
58
|
-
contentHtml += child.outerHTML || child.toString();
|
|
59
|
-
}
|
|
60
|
-
else if (typeof child === 'string') {
|
|
61
|
-
contentHtml += child;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
// Sanitize extracted HTML before rendering via {@html} in the component.
|
|
65
|
-
contentHtml = sanitizeHtml(contentHtml, { security: context.config.security });
|
|
66
|
-
return {
|
|
67
|
-
hottextChoices,
|
|
68
|
-
contentHtml,
|
|
69
|
-
maxChoices,
|
|
70
|
-
...(minChoices > 0 ? { minChoices } : {}),
|
|
71
|
-
prompt,
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
validate(data) {
|
|
75
|
-
const errors = [];
|
|
76
|
-
const warnings = [];
|
|
77
|
-
// Validate hottextChoices exist
|
|
78
|
-
if (!data.hottextChoices || data.hottextChoices.length === 0) {
|
|
79
|
-
errors.push('hottextInteraction must have at least one hottext');
|
|
80
|
-
}
|
|
81
|
-
// Validate hottext identifiers
|
|
82
|
-
if (data.hottextChoices) {
|
|
83
|
-
const identifiers = new Set();
|
|
84
|
-
for (const hottext of data.hottextChoices) {
|
|
85
|
-
if (!hottext.identifier) {
|
|
86
|
-
errors.push('All hottext elements must have an identifier');
|
|
87
|
-
}
|
|
88
|
-
else if (identifiers.has(hottext.identifier)) {
|
|
89
|
-
errors.push(`Duplicate hottext identifier: ${hottext.identifier}`);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
identifiers.add(hottext.identifier);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
// Validate maxChoices
|
|
97
|
-
if (data.maxChoices < 0) {
|
|
98
|
-
errors.push('maxChoices must be non-negative');
|
|
99
|
-
}
|
|
100
|
-
// Warn if maxChoices exceeds hottext count
|
|
101
|
-
if (data.hottextChoices && data.maxChoices > data.hottextChoices.length) {
|
|
102
|
-
warnings.push(`maxChoices (${data.maxChoices}) exceeds the number of hottext choices (${data.hottextChoices.length})`);
|
|
103
|
-
}
|
|
104
|
-
// Validate minChoices
|
|
105
|
-
if (data.minChoices !== undefined && data.minChoices < 0) {
|
|
106
|
-
errors.push('minChoices must be non-negative');
|
|
107
|
-
}
|
|
108
|
-
// Validate minChoices <= maxChoices
|
|
109
|
-
if (data.minChoices !== undefined &&
|
|
110
|
-
data.maxChoices > 0 &&
|
|
111
|
-
data.minChoices > data.maxChoices) {
|
|
112
|
-
errors.push('minChoices cannot exceed maxChoices');
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
valid: errors.length === 0,
|
|
116
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
117
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
};
|
|
1
|
+
export * from '../../interactions/hottext/extractor.js';
|
|
@@ -1,62 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Compatibility barrel for standard QTI extractors.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* New code should import from `../../interactions/index.js` or the specific
|
|
5
|
+
* `../../interactions/<interaction>/index.js` module. This path remains for
|
|
6
|
+
* existing tests and public consumers.
|
|
5
7
|
*/
|
|
6
|
-
|
|
7
|
-
export type { AssociateData } from './associateExtractor.js';
|
|
8
|
-
export { standardAssociateExtractor } from './associateExtractor.js';
|
|
9
|
-
export type { ChoiceData } from './choiceExtractor.js';
|
|
10
|
-
export { standardChoiceExtractor } from './choiceExtractor.js';
|
|
11
|
-
export type { CustomData } from './customExtractor.js';
|
|
12
|
-
export { standardCustomExtractor } from './customExtractor.js';
|
|
13
|
-
export type { DrawingData } from './drawingExtractor.js';
|
|
14
|
-
export { standardDrawingExtractor } from './drawingExtractor.js';
|
|
15
|
-
export type { EndAttemptData } from './endAttemptExtractor.js';
|
|
16
|
-
export { standardEndAttemptExtractor } from './endAttemptExtractor.js';
|
|
17
|
-
export type { ExtendedTextData } from './extendedTextExtractor.js';
|
|
18
|
-
export { standardExtendedTextExtractor } from './extendedTextExtractor.js';
|
|
19
|
-
export type { GapMatchData } from './gapMatchExtractor.js';
|
|
20
|
-
export { standardGapMatchExtractor } from './gapMatchExtractor.js';
|
|
21
|
-
export type { GraphicAssociateData } from './graphicAssociateExtractor.js';
|
|
22
|
-
export { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
|
|
23
|
-
export type { GraphicGapMatchData } from './graphicGapMatchExtractor.js';
|
|
24
|
-
export { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
|
|
25
|
-
export type { GraphicOrderData } from './graphicOrderExtractor.js';
|
|
26
|
-
export { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
|
|
27
|
-
export type { HotspotData } from './hotspotExtractor.js';
|
|
28
|
-
export { standardHotspotExtractor } from './hotspotExtractor.js';
|
|
29
|
-
export type { HottextData } from './hottextExtractor.js';
|
|
30
|
-
export { standardHottextExtractor } from './hottextExtractor.js';
|
|
31
|
-
export type { InlineChoiceData } from './inlineChoiceExtractor.js';
|
|
32
|
-
export { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
|
|
33
|
-
export type { MatchData } from './matchExtractor.js';
|
|
34
|
-
export { standardMatchExtractor } from './matchExtractor.js';
|
|
35
|
-
export type { MediaData } from './mediaExtractor.js';
|
|
36
|
-
export { standardMediaExtractor } from './mediaExtractor.js';
|
|
37
|
-
export type { OrderData } from './orderExtractor.js';
|
|
38
|
-
export { standardOrderExtractor } from './orderExtractor.js';
|
|
39
|
-
export type { PositionObjectData } from './positionObjectExtractor.js';
|
|
40
|
-
export { standardPositionObjectExtractor } from './positionObjectExtractor.js';
|
|
41
|
-
export type { SelectPointData } from './selectPointExtractor.js';
|
|
42
|
-
export { standardSelectPointExtractor } from './selectPointExtractor.js';
|
|
43
|
-
export type { SliderData } from './sliderExtractor.js';
|
|
44
|
-
export { standardSliderExtractor } from './sliderExtractor.js';
|
|
45
|
-
export type { TextEntryData } from './textEntryExtractor.js';
|
|
46
|
-
export { standardTextEntryExtractor } from './textEntryExtractor.js';
|
|
47
|
-
export type { UploadData } from './uploadExtractor.js';
|
|
48
|
-
export { standardUploadExtractor } from './uploadExtractor.js';
|
|
49
|
-
/**
|
|
50
|
-
* All standard QTI extractors
|
|
51
|
-
* Register these with ExtractionRegistry to enable standard QTI support
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* import { ALL_STANDARD_EXTRACTORS } from '@pie-qti/item-player';
|
|
55
|
-
*
|
|
56
|
-
* const registry = new ExtractionRegistry();
|
|
57
|
-
* for (const extractor of ALL_STANDARD_EXTRACTORS) {
|
|
58
|
-
* registry.register(extractor);
|
|
59
|
-
* }
|
|
60
|
-
*/
|
|
61
|
-
export declare const ALL_STANDARD_EXTRACTORS: ElementExtractor[];
|
|
8
|
+
export * from '../../interactions/index.js';
|
|
62
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,6BAA6B,CAAC"}
|
|
@@ -1,84 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Compatibility barrel for standard QTI extractors.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* New code should import from `../../interactions/index.js` or the specific
|
|
5
|
+
* `../../interactions/<interaction>/index.js` module. This path remains for
|
|
6
|
+
* existing tests and public consumers.
|
|
5
7
|
*/
|
|
6
|
-
|
|
7
|
-
import { standardAssociateExtractor } from './associateExtractor.js';
|
|
8
|
-
import { standardChoiceExtractor } from './choiceExtractor.js';
|
|
9
|
-
import { standardCustomExtractor } from './customExtractor.js';
|
|
10
|
-
import { standardDrawingExtractor } from './drawingExtractor.js';
|
|
11
|
-
import { standardEndAttemptExtractor } from './endAttemptExtractor.js';
|
|
12
|
-
import { standardExtendedTextExtractor } from './extendedTextExtractor.js';
|
|
13
|
-
import { standardGapMatchExtractor } from './gapMatchExtractor.js';
|
|
14
|
-
import { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
|
|
15
|
-
import { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
|
|
16
|
-
import { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
|
|
17
|
-
import { standardHotspotExtractor } from './hotspotExtractor.js';
|
|
18
|
-
import { standardHottextExtractor } from './hottextExtractor.js';
|
|
19
|
-
import { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
|
|
20
|
-
import { standardMatchExtractor } from './matchExtractor.js';
|
|
21
|
-
import { standardMediaExtractor } from './mediaExtractor.js';
|
|
22
|
-
import { standardOrderExtractor } from './orderExtractor.js';
|
|
23
|
-
import { standardPositionObjectExtractor } from './positionObjectExtractor.js';
|
|
24
|
-
import { standardSelectPointExtractor } from './selectPointExtractor.js';
|
|
25
|
-
import { standardSliderExtractor } from './sliderExtractor.js';
|
|
26
|
-
import { standardTextEntryExtractor } from './textEntryExtractor.js';
|
|
27
|
-
import { standardUploadExtractor } from './uploadExtractor.js';
|
|
28
|
-
export { standardAssociateExtractor } from './associateExtractor.js';
|
|
29
|
-
export { standardChoiceExtractor } from './choiceExtractor.js';
|
|
30
|
-
export { standardCustomExtractor } from './customExtractor.js';
|
|
31
|
-
export { standardDrawingExtractor } from './drawingExtractor.js';
|
|
32
|
-
export { standardEndAttemptExtractor } from './endAttemptExtractor.js';
|
|
33
|
-
export { standardExtendedTextExtractor } from './extendedTextExtractor.js';
|
|
34
|
-
export { standardGapMatchExtractor } from './gapMatchExtractor.js';
|
|
35
|
-
export { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
|
|
36
|
-
export { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
|
|
37
|
-
export { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
|
|
38
|
-
export { standardHotspotExtractor } from './hotspotExtractor.js';
|
|
39
|
-
export { standardHottextExtractor } from './hottextExtractor.js';
|
|
40
|
-
export { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
|
|
41
|
-
export { standardMatchExtractor } from './matchExtractor.js';
|
|
42
|
-
export { standardMediaExtractor } from './mediaExtractor.js';
|
|
43
|
-
export { standardOrderExtractor } from './orderExtractor.js';
|
|
44
|
-
export { standardPositionObjectExtractor } from './positionObjectExtractor.js';
|
|
45
|
-
export { standardSelectPointExtractor } from './selectPointExtractor.js';
|
|
46
|
-
export { standardSliderExtractor } from './sliderExtractor.js';
|
|
47
|
-
export { standardTextEntryExtractor } from './textEntryExtractor.js';
|
|
48
|
-
export { standardUploadExtractor } from './uploadExtractor.js';
|
|
49
|
-
/**
|
|
50
|
-
* All standard QTI extractors
|
|
51
|
-
* Register these with ExtractionRegistry to enable standard QTI support
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* import { ALL_STANDARD_EXTRACTORS } from '@pie-qti/item-player';
|
|
55
|
-
*
|
|
56
|
-
* const registry = new ExtractionRegistry();
|
|
57
|
-
* for (const extractor of ALL_STANDARD_EXTRACTORS) {
|
|
58
|
-
* registry.register(extractor);
|
|
59
|
-
* }
|
|
60
|
-
*/
|
|
61
|
-
export const ALL_STANDARD_EXTRACTORS = [
|
|
62
|
-
// All 21 standard QTI 2.2 interaction extractors (Phase 2 - Complete)
|
|
63
|
-
standardChoiceExtractor,
|
|
64
|
-
standardTextEntryExtractor,
|
|
65
|
-
standardExtendedTextExtractor,
|
|
66
|
-
standardInlineChoiceExtractor,
|
|
67
|
-
standardOrderExtractor,
|
|
68
|
-
standardMatchExtractor,
|
|
69
|
-
standardAssociateExtractor,
|
|
70
|
-
standardGapMatchExtractor,
|
|
71
|
-
standardSliderExtractor,
|
|
72
|
-
standardHotspotExtractor,
|
|
73
|
-
standardGraphicGapMatchExtractor,
|
|
74
|
-
standardUploadExtractor,
|
|
75
|
-
standardDrawingExtractor,
|
|
76
|
-
standardCustomExtractor,
|
|
77
|
-
standardMediaExtractor,
|
|
78
|
-
standardHottextExtractor,
|
|
79
|
-
standardSelectPointExtractor,
|
|
80
|
-
standardGraphicOrderExtractor,
|
|
81
|
-
standardGraphicAssociateExtractor,
|
|
82
|
-
standardPositionObjectExtractor,
|
|
83
|
-
standardEndAttemptExtractor,
|
|
84
|
-
];
|
|
8
|
+
export * from '../../interactions/index.js';
|
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI inlineChoiceInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from inlineChoiceInteraction elements (dropdown in text)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Inline choice data extracted from inlineChoiceInteraction elements
|
|
9
|
-
*/
|
|
10
|
-
export interface InlineChoiceData {
|
|
11
|
-
choices: Array<{
|
|
12
|
-
identifier: string;
|
|
13
|
-
text: string;
|
|
14
|
-
}>;
|
|
15
|
-
shuffle: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Standard QTI inline choice interaction extractor
|
|
19
|
-
* Handles inlineChoiceInteraction elements (dropdown selections within text)
|
|
20
|
-
*/
|
|
21
|
-
export declare const standardInlineChoiceExtractor: ElementExtractor<InlineChoiceData>;
|
|
1
|
+
export * from '../../interactions/inline-choice/extractor.js';
|
|
22
2
|
//# sourceMappingURL=inlineChoiceExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inlineChoiceExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/inlineChoiceExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"inlineChoiceExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/inlineChoiceExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC"}
|