@pie-qti/item-player 0.1.5 → 0.1.7
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/dist/catalog/applyGlossaryTriggers.d.ts +2 -1
- package/dist/catalog/applyGlossaryTriggers.d.ts.map +1 -1
- package/dist/catalog/applyGlossaryTriggers.js +145 -30
- package/dist/catalog/glossaryAction.d.ts.map +1 -1
- package/dist/catalog/glossaryAction.js +14 -4
- package/dist/components/utils/stimulusRender.d.ts +17 -0
- package/dist/components/utils/stimulusRender.d.ts.map +1 -0
- package/dist/components/utils/stimulusRender.js +70 -0
- package/dist/components/utils/stylesheetRender.d.ts +4 -0
- package/dist/components/utils/stylesheetRender.d.ts.map +1 -0
- package/dist/components/utils/stylesheetRender.js +57 -0
- package/dist/core/ComponentRegistry.d.ts +5 -4
- package/dist/core/ComponentRegistry.d.ts.map +1 -1
- package/dist/core/ComponentRegistry.js +11 -4
- package/dist/core/ItemRenderer.d.ts.map +1 -1
- package/dist/core/ItemRenderer.js +5 -18
- package/dist/core/Player.d.ts +39 -4
- package/dist/core/Player.d.ts.map +1 -1
- package/dist/core/Player.js +364 -193
- 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.js +3318 -2733
- package/dist/element.js.map +1 -1
- package/dist/extraction/extractors/associateExtractor.d.ts +1 -28
- package/dist/extraction/extractors/associateExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/associateExtractor.js +1 -97
- package/dist/extraction/extractors/choiceExtractor.d.ts +1 -26
- package/dist/extraction/extractors/choiceExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/choiceExtractor.js +1 -93
- 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 -63
- package/dist/extraction/extractors/gapMatchExtractor.d.ts +1 -28
- package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/gapMatchExtractor.js +1 -155
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +1 -40
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/graphicAssociateExtractor.js +1 -143
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +1 -52
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/graphicGapMatchExtractor.js +1 -205
- 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 -159
- 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 -128
- package/dist/extraction/extractors/index.d.ts +5 -59
- package/dist/extraction/extractors/index.d.ts.map +1 -1
- package/dist/extraction/extractors/index.js +5 -85
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +1 -24
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/inlineChoiceExtractor.js +1 -80
- package/dist/extraction/extractors/matchExtractor.d.ts +1 -36
- package/dist/extraction/extractors/matchExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/matchExtractor.js +1 -160
- 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 -27
- package/dist/extraction/extractors/orderExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/orderExtractor.js +1 -90
- package/dist/extraction/extractors/portableCustomExtractor.d.ts +1 -13
- package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/portableCustomExtractor.js +1 -96
- 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 -20
- package/dist/extraction/extractors/textEntryExtractor.d.ts.map +1 -1
- package/dist/extraction/extractors/textEntryExtractor.js +1 -54
- 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 -59
- 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 +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- 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/pnp/applyPnp.d.ts.map +1 -1
- package/dist/pnp/applyPnp.js +9 -2
- package/dist/pnp/parsePnpXml.d.ts.map +1 -1
- package/dist/pnp/parsePnpXml.js +91 -3
- package/dist/pnp/types.d.ts +24 -1
- package/dist/pnp/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +47 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/interactions.d.ts +4 -408
- 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 +6 -6
- package/src/catalog/applyGlossaryTriggers.ts +174 -34
- package/src/catalog/glossaryAction.ts +14 -4
- package/src/components/ItemBody.svelte +71 -200
- package/src/components/ItemPlayer.svelte +9 -5
- package/src/components/ModalFeedbackDisplay.svelte +15 -5
- package/src/components/utils/stimulusRender.ts +93 -0
- package/src/components/utils/stylesheetRender.ts +58 -0
- package/src/core/ComponentRegistry.ts +22 -7
- package/src/core/Player.ts +401 -209
- package/src/document/AssessmentItemDocument.ts +178 -0
- package/src/extraction/extractors/associateExtractor.ts +1 -133
- package/src/extraction/extractors/choiceExtractor.ts +1 -121
- 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 -89
- package/src/extraction/extractors/gapMatchExtractor.ts +1 -193
- package/src/extraction/extractors/graphicAssociateExtractor.ts +1 -192
- package/src/extraction/extractors/graphicGapMatchExtractor.ts +1 -257
- package/src/extraction/extractors/graphicOrderExtractor.ts +1 -162
- package/src/extraction/extractors/hotspotExtractor.ts +1 -208
- package/src/extraction/extractors/hottextExtractor.ts +1 -163
- package/src/extraction/extractors/index.ts +5 -111
- package/src/extraction/extractors/inlineChoiceExtractor.ts +1 -105
- package/src/extraction/extractors/matchExtractor.ts +1 -187
- package/src/extraction/extractors/mediaExtractor.ts +1 -168
- package/src/extraction/extractors/orderExtractor.ts +1 -120
- package/src/extraction/extractors/portableCustomExtractor.ts +1 -122
- 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 -79
- package/src/extraction/extractors/uploadExtractor.ts +1 -81
- 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 +3 -7
- 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/pnp/applyPnp.ts +8 -2
- package/src/pnp/parsePnpXml.ts +102 -5
- package/src/pnp/types.ts +43 -1
- package/src/types/index.ts +53 -0
- package/src/types/interactions.ts +4 -425
- 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/__tests__/glossaryTriggers.test.ts +0 -411
- package/src/__tests__/pnp.test.ts +0 -250
- package/src/core/ItemRenderer.ts +0 -371
|
@@ -1,90 +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
|
-
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
41
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 0);
|
|
42
|
-
return {
|
|
43
|
-
choices,
|
|
44
|
-
shuffle,
|
|
45
|
-
orientation,
|
|
46
|
-
minChoices,
|
|
47
|
-
maxChoices,
|
|
48
|
-
prompt,
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
validate(data) {
|
|
52
|
-
const errors = [];
|
|
53
|
-
const warnings = [];
|
|
54
|
-
// Validate choices exist
|
|
55
|
-
if (!data.choices || data.choices.length < 2) {
|
|
56
|
-
errors.push('orderInteraction must have at least 2 choices');
|
|
57
|
-
}
|
|
58
|
-
// Warn if too many choices (difficult to order)
|
|
59
|
-
if (data.choices && data.choices.length > 10) {
|
|
60
|
-
warnings.push(`orderInteraction has ${data.choices.length} choices - this may be difficult for users to order`);
|
|
61
|
-
}
|
|
62
|
-
// Validate choice identifiers
|
|
63
|
-
if (data.choices) {
|
|
64
|
-
const identifiers = new Set();
|
|
65
|
-
for (const choice of data.choices) {
|
|
66
|
-
if (!choice.identifier) {
|
|
67
|
-
errors.push('All choices must have an identifier');
|
|
68
|
-
}
|
|
69
|
-
else if (identifiers.has(choice.identifier)) {
|
|
70
|
-
errors.push(`Duplicate choice identifier: ${choice.identifier}`);
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
identifiers.add(choice.identifier);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// Validate orientation (only if provided)
|
|
78
|
-
if (data.orientation) {
|
|
79
|
-
const validOrientations = ['vertical', 'horizontal'];
|
|
80
|
-
if (!validOrientations.includes(data.orientation)) {
|
|
81
|
-
warnings.push(`orientation '${data.orientation}' is not standard (expected: ${validOrientations.join(', ')})`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
valid: errors.length === 0,
|
|
86
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
87
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
};
|
|
1
|
+
export * from '../../interactions/order/extractor.js';
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ExtractedPci } from '../../pci/types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Extractor for <qti-portable-custom-interaction> (QTI 3.0) and
|
|
5
|
-
* <portableCustomInteraction> (QTI 2.x vendor extension).
|
|
6
|
-
*
|
|
7
|
-
* Extracts the module paths, markup, and config properties needed by PciHost
|
|
8
|
-
* to load and initialize the PCI JavaScript module.
|
|
9
|
-
*
|
|
10
|
-
* Priority 20 > standardCustomExtractor priority 10, so this runs first when
|
|
11
|
-
* both would match the same element.
|
|
12
|
-
*/
|
|
13
|
-
export declare const portableCustomExtractor: ElementExtractor<ExtractedPci>;
|
|
1
|
+
export * from '../../interactions/portable-custom/extractor.js';
|
|
14
2
|
//# sourceMappingURL=portableCustomExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portableCustomExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/portableCustomExtractor.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"portableCustomExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/portableCustomExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
|
|
@@ -1,96 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Extractor for <qti-portable-custom-interaction> (QTI 3.0) and
|
|
3
|
-
* <portableCustomInteraction> (QTI 2.x vendor extension).
|
|
4
|
-
*
|
|
5
|
-
* Extracts the module paths, markup, and config properties needed by PciHost
|
|
6
|
-
* to load and initialize the PCI JavaScript module.
|
|
7
|
-
*
|
|
8
|
-
* Priority 20 > standardCustomExtractor priority 10, so this runs first when
|
|
9
|
-
* both would match the same element.
|
|
10
|
-
*/
|
|
11
|
-
export const portableCustomExtractor = {
|
|
12
|
-
id: 'qti:portable-custom-interaction',
|
|
13
|
-
name: 'QTI Portable Custom Interaction',
|
|
14
|
-
priority: 20,
|
|
15
|
-
elementTypes: [
|
|
16
|
-
'portableCustomInteraction',
|
|
17
|
-
'qti-portable-custom-interaction',
|
|
18
|
-
],
|
|
19
|
-
description: 'Extracts QTI 3.0 portable custom interaction module paths, markup, and config',
|
|
20
|
-
canHandle(element, _context) {
|
|
21
|
-
const tag = element.rawTagName?.toLowerCase() ?? '';
|
|
22
|
-
return (tag === 'qti-portable-custom-interaction' ||
|
|
23
|
-
tag === 'portablecustominteraction');
|
|
24
|
-
},
|
|
25
|
-
extract(element, context) {
|
|
26
|
-
const { utils } = context;
|
|
27
|
-
const responseIdentifier = utils.getAttribute(element, 'responseIdentifier') ||
|
|
28
|
-
utils.getAttribute(element, 'response-identifier') || '';
|
|
29
|
-
const customInteractionTypeIdentifier = utils.getAttribute(element, 'customInteractionTypeIdentifier') ||
|
|
30
|
-
utils.getAttribute(element, 'custom-interaction-type-identifier') || '';
|
|
31
|
-
// --- Module paths from <qti-interaction-modules>/<qti-interaction-module> ---
|
|
32
|
-
// These element names ARE in the standard QTI 3.0 element mapper so utils.querySelector works.
|
|
33
|
-
let primaryPath = '';
|
|
34
|
-
let fallbackPath;
|
|
35
|
-
const modulesEl = utils.querySelector(element, 'qti-interaction-modules') ??
|
|
36
|
-
utils.querySelector(element, 'interactionmodules');
|
|
37
|
-
if (modulesEl) {
|
|
38
|
-
const moduleEl = utils.querySelector(modulesEl, 'qti-interaction-module') ??
|
|
39
|
-
utils.querySelector(modulesEl, 'interactionmodule');
|
|
40
|
-
if (moduleEl) {
|
|
41
|
-
primaryPath =
|
|
42
|
-
utils.getAttribute(moduleEl, 'primaryPath') ||
|
|
43
|
-
utils.getAttribute(moduleEl, 'primary-path') || '';
|
|
44
|
-
const fb = utils.getAttribute(moduleEl, 'fallbackPath') ||
|
|
45
|
-
utils.getAttribute(moduleEl, 'fallback-path') || '';
|
|
46
|
-
if (fb)
|
|
47
|
-
fallbackPath = fb;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// --- Markup from <qti-interaction-markup> ---
|
|
51
|
-
const markupEl = utils.querySelector(element, 'qti-interaction-markup') ??
|
|
52
|
-
utils.querySelector(element, 'interactionmarkup');
|
|
53
|
-
const markup = markupEl ? utils.getHtmlContent(markupEl) : '';
|
|
54
|
-
// --- Config from <qti-pci-properties>/<qti-pci-property> ---
|
|
55
|
-
// qti-pci-properties is NOT in the standard QTI 3.0 element mapper, so we use the
|
|
56
|
-
// native node-html-parser querySelector (available as element.querySelector on the raw element).
|
|
57
|
-
const config = {};
|
|
58
|
-
const rawEl = element;
|
|
59
|
-
const propsEl = rawEl.querySelector?.('qti-pci-properties') ??
|
|
60
|
-
rawEl.querySelector?.('pciproperties');
|
|
61
|
-
if (propsEl) {
|
|
62
|
-
const propEls = [
|
|
63
|
-
...(propsEl.querySelectorAll?.('qti-pci-property') ?? []),
|
|
64
|
-
...(propsEl.querySelectorAll?.('pciproperty') ?? []),
|
|
65
|
-
];
|
|
66
|
-
for (const propEl of propEls) {
|
|
67
|
-
const key = propEl.getAttribute?.('key') || propEl.getAttribute?.('name') || '';
|
|
68
|
-
const value = propEl.getAttribute?.('value') || (propEl.textContent ?? '').trim() || '';
|
|
69
|
-
if (key)
|
|
70
|
-
config[key] = value;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
responseIdentifier,
|
|
75
|
-
customInteractionTypeIdentifier,
|
|
76
|
-
primaryPath,
|
|
77
|
-
fallbackPath,
|
|
78
|
-
markup,
|
|
79
|
-
config,
|
|
80
|
-
};
|
|
81
|
-
},
|
|
82
|
-
validate(data) {
|
|
83
|
-
const errors = [];
|
|
84
|
-
const warnings = [];
|
|
85
|
-
if (!data.responseIdentifier) {
|
|
86
|
-
errors.push('portableCustomInteraction is missing responseIdentifier');
|
|
87
|
-
}
|
|
88
|
-
if (!data.customInteractionTypeIdentifier) {
|
|
89
|
-
warnings.push('portableCustomInteraction is missing customInteractionTypeIdentifier');
|
|
90
|
-
}
|
|
91
|
-
if (!data.primaryPath) {
|
|
92
|
-
errors.push('portableCustomInteraction has no primaryPath in qti-interaction-modules');
|
|
93
|
-
}
|
|
94
|
-
return { valid: errors.length === 0, errors: errors.length ? errors : undefined, warnings: warnings.length ? warnings : undefined };
|
|
95
|
-
},
|
|
96
|
-
};
|
|
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"}
|
|
@@ -1,191 +1 @@
|
|
|
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
|
-
/**
|
|
26
|
-
* Standard QTI position object interaction extractor
|
|
27
|
-
* Handles positionObjectInteraction elements (dragging an object to a position)
|
|
28
|
-
*/
|
|
29
|
-
export const standardPositionObjectExtractor = {
|
|
30
|
-
id: 'qti:position-object-interaction',
|
|
31
|
-
name: 'QTI Standard Position Object Interaction',
|
|
32
|
-
priority: 10,
|
|
33
|
-
elementTypes: ['positionObjectInteraction'],
|
|
34
|
-
description: 'Extracts standard QTI positionObjectInteraction (drag object to position)',
|
|
35
|
-
canHandle(element, _context) {
|
|
36
|
-
// All positionObjectInteraction elements are standard
|
|
37
|
-
return element.rawTagName === 'positionObjectInteraction';
|
|
38
|
-
},
|
|
39
|
-
extract(element, context) {
|
|
40
|
-
const { utils } = context;
|
|
41
|
-
// Extract background image data from object element (direct child)
|
|
42
|
-
const objectElements = utils.getChildrenByTag(element, 'object');
|
|
43
|
-
let imageData = null;
|
|
44
|
-
if (objectElements.length > 0) {
|
|
45
|
-
const objectElement = objectElements[0];
|
|
46
|
-
const type = utils.getAttribute(objectElement, 'type', '');
|
|
47
|
-
const data = utils.getAttribute(objectElement, 'data', '');
|
|
48
|
-
const width = utils.getAttribute(objectElement, 'width', '500');
|
|
49
|
-
const height = utils.getAttribute(objectElement, 'height', '300');
|
|
50
|
-
if (type.startsWith('image/svg')) {
|
|
51
|
-
// Extract inline SVG content - get full content including <svg> tag
|
|
52
|
-
const content = utils.getHtmlContent(objectElement);
|
|
53
|
-
imageData = {
|
|
54
|
-
type: 'svg',
|
|
55
|
-
content,
|
|
56
|
-
width,
|
|
57
|
-
height,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
// External image reference
|
|
62
|
-
imageData = {
|
|
63
|
-
type: 'image',
|
|
64
|
-
src: data,
|
|
65
|
-
width,
|
|
66
|
-
height,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// Extract positionObjectStage children
|
|
71
|
-
const stageElements = utils.getChildrenByTag(element, 'positionObjectStage');
|
|
72
|
-
const positionObjectStages = stageElements.map((stage) => {
|
|
73
|
-
const classes = utils.getClasses(stage);
|
|
74
|
-
const identifier = utils.getAttribute(stage, 'identifier', '');
|
|
75
|
-
const matchMax = utils.getNumberAttribute(stage, 'matchMax', 1);
|
|
76
|
-
const matchMin = utils.getNumberAttribute(stage, 'matchMin', 0);
|
|
77
|
-
// Get text content as label, use identifier as fallback
|
|
78
|
-
const textContent = utils.getTextContent(stage).trim();
|
|
79
|
-
const label = textContent || identifier;
|
|
80
|
-
// Extract object data from nested object element
|
|
81
|
-
const stageObjectElements = utils.getChildrenByTag(stage, 'object');
|
|
82
|
-
let objectData = null;
|
|
83
|
-
if (stageObjectElements.length > 0) {
|
|
84
|
-
const objElement = stageObjectElements[0];
|
|
85
|
-
const objType = utils.getAttribute(objElement, 'type', '');
|
|
86
|
-
const objData = utils.getAttribute(objElement, 'data', '');
|
|
87
|
-
const objWidth = utils.getAttribute(objElement, 'width', '50');
|
|
88
|
-
const objHeight = utils.getAttribute(objElement, 'height', '50');
|
|
89
|
-
if (objType.startsWith('image/svg')) {
|
|
90
|
-
// Extract inline SVG content
|
|
91
|
-
const content = utils.getHtmlContent(objElement);
|
|
92
|
-
objectData = {
|
|
93
|
-
type: 'svg',
|
|
94
|
-
content,
|
|
95
|
-
width: objWidth,
|
|
96
|
-
height: objHeight,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
// External image reference
|
|
101
|
-
objectData = {
|
|
102
|
-
type: 'image',
|
|
103
|
-
src: objData,
|
|
104
|
-
width: objWidth,
|
|
105
|
-
height: objHeight,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
identifier,
|
|
111
|
-
label,
|
|
112
|
-
matchMax,
|
|
113
|
-
...(matchMin > 0 ? { matchMin } : {}),
|
|
114
|
-
objectData,
|
|
115
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
116
|
-
};
|
|
117
|
-
});
|
|
118
|
-
// Extract attributes
|
|
119
|
-
// centerPoint defaults to true when not specified
|
|
120
|
-
const centerPoint = utils.getBooleanAttribute(element, 'centerPoint', true);
|
|
121
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 0);
|
|
122
|
-
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
123
|
-
// Extract prompt (optional)
|
|
124
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
125
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
126
|
-
return {
|
|
127
|
-
imageData,
|
|
128
|
-
positionObjectStages,
|
|
129
|
-
centerPoint,
|
|
130
|
-
maxChoices,
|
|
131
|
-
minChoices,
|
|
132
|
-
prompt,
|
|
133
|
-
};
|
|
134
|
-
},
|
|
135
|
-
validate(data) {
|
|
136
|
-
const errors = [];
|
|
137
|
-
const warnings = [];
|
|
138
|
-
// Validate image data
|
|
139
|
-
if (!data.imageData) {
|
|
140
|
-
warnings.push('positionObjectInteraction has no background image');
|
|
141
|
-
}
|
|
142
|
-
else if (data.imageData.type === 'image' && !data.imageData.src) {
|
|
143
|
-
errors.push('positionObjectInteraction must have an image URL');
|
|
144
|
-
}
|
|
145
|
-
else if (data.imageData.type === 'svg' && !data.imageData.content) {
|
|
146
|
-
errors.push('positionObjectInteraction must have SVG content');
|
|
147
|
-
}
|
|
148
|
-
// Warn about dimension consistency (cannot verify actual file dimensions at extraction time)
|
|
149
|
-
if (data.imageData && data.imageData.type === 'image') {
|
|
150
|
-
warnings.push('IMPORTANT: Ensure declared width/height match actual image file dimensions. ' +
|
|
151
|
-
'Mismatched dimensions cause coordinate system errors in mapResponsePoint scoring. ' +
|
|
152
|
-
`Declared: ${data.imageData.width || 'unspecified'}×${data.imageData.height || 'unspecified'}`);
|
|
153
|
-
}
|
|
154
|
-
// Validate positionObjectStages exist
|
|
155
|
-
if (!data.positionObjectStages || data.positionObjectStages.length === 0) {
|
|
156
|
-
errors.push('positionObjectInteraction must have at least one positionObjectStage');
|
|
157
|
-
}
|
|
158
|
-
// Validate positionObjectStage identifiers
|
|
159
|
-
if (data.positionObjectStages) {
|
|
160
|
-
const identifiers = new Set();
|
|
161
|
-
for (const stage of data.positionObjectStages) {
|
|
162
|
-
if (!stage.identifier) {
|
|
163
|
-
errors.push('All positionObjectStages must have an identifier');
|
|
164
|
-
}
|
|
165
|
-
else if (identifiers.has(stage.identifier)) {
|
|
166
|
-
errors.push(`Duplicate positionObjectStage identifier: ${stage.identifier}`);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
identifiers.add(stage.identifier);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
// Validate maxChoices
|
|
174
|
-
if (data.maxChoices < 0) {
|
|
175
|
-
errors.push('maxChoices must be non-negative');
|
|
176
|
-
}
|
|
177
|
-
// Validate minChoices
|
|
178
|
-
if (data.minChoices < 0) {
|
|
179
|
-
errors.push('minChoices must be non-negative');
|
|
180
|
-
}
|
|
181
|
-
// Validate minChoices <= maxChoices
|
|
182
|
-
if (data.maxChoices > 0 && data.minChoices > data.maxChoices) {
|
|
183
|
-
errors.push('minChoices cannot exceed maxChoices');
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
valid: errors.length === 0,
|
|
187
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
188
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
189
|
-
};
|
|
190
|
-
},
|
|
191
|
-
};
|
|
1
|
+
export * from '../../interactions/position-object/extractor.js';
|
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI selectPointInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from selectPointInteraction elements (click point on image)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Image data for select point 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
|
-
* Select point data extracted from selectPointInteraction elements
|
|
19
|
-
*/
|
|
20
|
-
export interface SelectPointData {
|
|
21
|
-
imageData: ImageData | null;
|
|
22
|
-
maxChoices: number;
|
|
23
|
-
minChoices: number;
|
|
24
|
-
prompt: string | null;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Standard QTI select point interaction extractor
|
|
28
|
-
* Handles selectPointInteraction elements (clicking points on an image)
|
|
29
|
-
*/
|
|
30
|
-
export declare const standardSelectPointExtractor: ElementExtractor<SelectPointData>;
|
|
1
|
+
export * from '../../interactions/select-point/extractor.js';
|
|
31
2
|
//# sourceMappingURL=selectPointExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectPointExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/selectPointExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"selectPointExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/selectPointExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC"}
|
|
@@ -1,109 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI selectPointInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from selectPointInteraction elements (click point on image)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI select point interaction extractor
|
|
8
|
-
* Handles selectPointInteraction elements (clicking points on an image)
|
|
9
|
-
*/
|
|
10
|
-
export const standardSelectPointExtractor = {
|
|
11
|
-
id: 'qti:select-point-interaction',
|
|
12
|
-
name: 'QTI Standard Select Point Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['selectPointInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI selectPointInteraction (click point on image)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All selectPointInteraction elements are standard
|
|
18
|
-
return element.rawTagName === 'selectPointInteraction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract image data from object or img element
|
|
23
|
-
const objectElements = utils.getChildrenByTag(element, 'object');
|
|
24
|
-
const imgElements = utils.getChildrenByTag(element, 'img');
|
|
25
|
-
let imageData = null;
|
|
26
|
-
if (objectElements.length > 0) {
|
|
27
|
-
const objectElement = objectElements[0];
|
|
28
|
-
const type = utils.getAttribute(objectElement, 'type', '');
|
|
29
|
-
const data = utils.getAttribute(objectElement, 'data', '');
|
|
30
|
-
const width = utils.getAttribute(objectElement, 'width', '500');
|
|
31
|
-
const height = utils.getAttribute(objectElement, 'height', '300');
|
|
32
|
-
if (type.startsWith('image/svg')) {
|
|
33
|
-
// Extract inline SVG content - get full content including <svg> tag
|
|
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
|
-
else if (imgElements.length > 0) {
|
|
53
|
-
// Handle img element as fallback
|
|
54
|
-
const imgElement = imgElements[0];
|
|
55
|
-
const src = utils.getAttribute(imgElement, 'src', '');
|
|
56
|
-
const width = utils.getAttribute(imgElement, 'width', '500');
|
|
57
|
-
const height = utils.getAttribute(imgElement, 'height', '300');
|
|
58
|
-
imageData = {
|
|
59
|
-
type: 'image',
|
|
60
|
-
src,
|
|
61
|
-
width,
|
|
62
|
-
height,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
// Extract attributes
|
|
66
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
|
|
67
|
-
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
68
|
-
// Extract prompt (optional)
|
|
69
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
70
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
71
|
-
return {
|
|
72
|
-
imageData,
|
|
73
|
-
maxChoices,
|
|
74
|
-
minChoices,
|
|
75
|
-
prompt,
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
|
-
validate(data) {
|
|
79
|
-
const errors = [];
|
|
80
|
-
const warnings = [];
|
|
81
|
-
// Validate image data
|
|
82
|
-
if (!data.imageData) {
|
|
83
|
-
warnings.push('selectPointInteraction has no image data');
|
|
84
|
-
}
|
|
85
|
-
else if (data.imageData.type === 'image' && !data.imageData.src) {
|
|
86
|
-
errors.push('selectPointInteraction must have an image URL');
|
|
87
|
-
}
|
|
88
|
-
else if (data.imageData.type === 'svg' && !data.imageData.content) {
|
|
89
|
-
errors.push('selectPointInteraction must have SVG content');
|
|
90
|
-
}
|
|
91
|
-
// Validate maxChoices — 0 means unlimited per QTI spec
|
|
92
|
-
if (data.maxChoices < 0) {
|
|
93
|
-
errors.push('maxChoices must be non-negative');
|
|
94
|
-
}
|
|
95
|
-
// Validate minChoices
|
|
96
|
-
if (data.minChoices < 0) {
|
|
97
|
-
errors.push('minChoices must be non-negative');
|
|
98
|
-
}
|
|
99
|
-
// Validate minChoices <= maxChoices (skip when maxChoices=0, meaning unlimited)
|
|
100
|
-
if (data.maxChoices > 0 && data.minChoices > data.maxChoices) {
|
|
101
|
-
errors.push(`minChoices (${data.minChoices}) must be less than or equal to maxChoices (${data.maxChoices})`);
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
valid: errors.length === 0,
|
|
105
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
106
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
107
|
-
};
|
|
108
|
-
},
|
|
109
|
-
};
|
|
1
|
+
export * from '../../interactions/select-point/extractor.js';
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI sliderInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from sliderInteraction elements (slider input)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Slider data extracted from sliderInteraction elements
|
|
9
|
-
*/
|
|
10
|
-
export interface SliderData {
|
|
11
|
-
lowerBound: number;
|
|
12
|
-
upperBound: number;
|
|
13
|
-
step: number;
|
|
14
|
-
stepLabel?: boolean;
|
|
15
|
-
orientation: string;
|
|
16
|
-
reverse: boolean;
|
|
17
|
-
prompt: string | null;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Standard QTI slider interaction extractor
|
|
21
|
-
* Handles sliderInteraction elements (slider for numeric input)
|
|
22
|
-
*/
|
|
23
|
-
export declare const standardSliderExtractor: ElementExtractor<SliderData>;
|
|
1
|
+
export * from '../../interactions/slider/extractor.js';
|
|
24
2
|
//# sourceMappingURL=sliderExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sliderExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/sliderExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sliderExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/sliderExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC"}
|