@pie-qti/item-player 0.1.5 → 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/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 +2 -2
- package/dist/core/Player.d.ts.map +1 -1
- package/dist/core/Player.js +46 -147
- 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 +2515 -2294
- 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 +1 -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/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/components/ItemBody.svelte +35 -173
- package/src/components/ItemPlayer.svelte +9 -5
- package/src/components/ModalFeedbackDisplay.svelte +15 -5
- package/src/core/ComponentRegistry.ts +22 -7
- package/src/core/Player.ts +48 -163
- 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 +2 -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/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/core/ItemRenderer.ts +0 -371
|
@@ -1,88 +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 { portableCustomExtractor } from './portableCustomExtractor.js';
|
|
11
|
-
import { standardDrawingExtractor } from './drawingExtractor.js';
|
|
12
|
-
import { standardEndAttemptExtractor } from './endAttemptExtractor.js';
|
|
13
|
-
import { standardExtendedTextExtractor } from './extendedTextExtractor.js';
|
|
14
|
-
import { standardGapMatchExtractor } from './gapMatchExtractor.js';
|
|
15
|
-
import { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
|
|
16
|
-
import { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
|
|
17
|
-
import { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
|
|
18
|
-
import { standardHotspotExtractor } from './hotspotExtractor.js';
|
|
19
|
-
import { standardHottextExtractor } from './hottextExtractor.js';
|
|
20
|
-
import { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
|
|
21
|
-
import { standardMatchExtractor } from './matchExtractor.js';
|
|
22
|
-
import { standardMediaExtractor } from './mediaExtractor.js';
|
|
23
|
-
import { standardOrderExtractor } from './orderExtractor.js';
|
|
24
|
-
import { standardPositionObjectExtractor } from './positionObjectExtractor.js';
|
|
25
|
-
import { standardSelectPointExtractor } from './selectPointExtractor.js';
|
|
26
|
-
import { standardSliderExtractor } from './sliderExtractor.js';
|
|
27
|
-
import { standardTextEntryExtractor } from './textEntryExtractor.js';
|
|
28
|
-
import { standardUploadExtractor } from './uploadExtractor.js';
|
|
29
|
-
export { standardAssociateExtractor } from './associateExtractor.js';
|
|
30
|
-
export { standardChoiceExtractor } from './choiceExtractor.js';
|
|
31
|
-
export { standardCustomExtractor } from './customExtractor.js';
|
|
32
|
-
export { portableCustomExtractor } from './portableCustomExtractor.js';
|
|
33
|
-
export { standardDrawingExtractor } from './drawingExtractor.js';
|
|
34
|
-
export { standardEndAttemptExtractor } from './endAttemptExtractor.js';
|
|
35
|
-
export { standardExtendedTextExtractor } from './extendedTextExtractor.js';
|
|
36
|
-
export { standardGapMatchExtractor } from './gapMatchExtractor.js';
|
|
37
|
-
export { standardGraphicAssociateExtractor } from './graphicAssociateExtractor.js';
|
|
38
|
-
export { standardGraphicGapMatchExtractor } from './graphicGapMatchExtractor.js';
|
|
39
|
-
export { standardGraphicOrderExtractor } from './graphicOrderExtractor.js';
|
|
40
|
-
export { standardHotspotExtractor } from './hotspotExtractor.js';
|
|
41
|
-
export { standardHottextExtractor } from './hottextExtractor.js';
|
|
42
|
-
export { standardInlineChoiceExtractor } from './inlineChoiceExtractor.js';
|
|
43
|
-
export { standardMatchExtractor } from './matchExtractor.js';
|
|
44
|
-
export { standardMediaExtractor } from './mediaExtractor.js';
|
|
45
|
-
export { standardOrderExtractor } from './orderExtractor.js';
|
|
46
|
-
export { standardPositionObjectExtractor } from './positionObjectExtractor.js';
|
|
47
|
-
export { standardSelectPointExtractor } from './selectPointExtractor.js';
|
|
48
|
-
export { standardSliderExtractor } from './sliderExtractor.js';
|
|
49
|
-
export { standardTextEntryExtractor } from './textEntryExtractor.js';
|
|
50
|
-
export { standardUploadExtractor } from './uploadExtractor.js';
|
|
51
|
-
/**
|
|
52
|
-
* All standard QTI extractors
|
|
53
|
-
* Register these with ExtractionRegistry to enable standard QTI support
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* import { ALL_STANDARD_EXTRACTORS } from '@pie-qti/item-player';
|
|
57
|
-
*
|
|
58
|
-
* const registry = new ExtractionRegistry();
|
|
59
|
-
* for (const extractor of ALL_STANDARD_EXTRACTORS) {
|
|
60
|
-
* registry.register(extractor);
|
|
61
|
-
* }
|
|
62
|
-
*/
|
|
63
|
-
export const ALL_STANDARD_EXTRACTORS = [
|
|
64
|
-
// PCI extractor has higher priority (20) than standardCustomExtractor (10)
|
|
65
|
-
portableCustomExtractor,
|
|
66
|
-
// All 21 standard QTI 2.2 interaction extractors (Phase 2 - Complete)
|
|
67
|
-
standardChoiceExtractor,
|
|
68
|
-
standardTextEntryExtractor,
|
|
69
|
-
standardExtendedTextExtractor,
|
|
70
|
-
standardInlineChoiceExtractor,
|
|
71
|
-
standardOrderExtractor,
|
|
72
|
-
standardMatchExtractor,
|
|
73
|
-
standardAssociateExtractor,
|
|
74
|
-
standardGapMatchExtractor,
|
|
75
|
-
standardSliderExtractor,
|
|
76
|
-
standardHotspotExtractor,
|
|
77
|
-
standardGraphicGapMatchExtractor,
|
|
78
|
-
standardUploadExtractor,
|
|
79
|
-
standardDrawingExtractor,
|
|
80
|
-
standardCustomExtractor,
|
|
81
|
-
standardMediaExtractor,
|
|
82
|
-
standardHottextExtractor,
|
|
83
|
-
standardSelectPointExtractor,
|
|
84
|
-
standardGraphicOrderExtractor,
|
|
85
|
-
standardGraphicAssociateExtractor,
|
|
86
|
-
standardPositionObjectExtractor,
|
|
87
|
-
standardEndAttemptExtractor,
|
|
88
|
-
];
|
|
8
|
+
export * from '../../interactions/index.js';
|
|
@@ -1,25 +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
|
-
fixed?: boolean;
|
|
15
|
-
}>;
|
|
16
|
-
shuffle: boolean;
|
|
17
|
-
/** Text from the QTI <label> child element; used as the placeholder "Select…" option */
|
|
18
|
-
label: string | null;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Standard QTI inline choice interaction extractor
|
|
22
|
-
* Handles inlineChoiceInteraction elements (dropdown selections within text)
|
|
23
|
-
*/
|
|
24
|
-
export declare const standardInlineChoiceExtractor: ElementExtractor<InlineChoiceData>;
|
|
1
|
+
export * from '../../interactions/inline-choice/extractor.js';
|
|
25
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"}
|
|
@@ -1,80 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI inlineChoiceInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from inlineChoiceInteraction elements (dropdown in text)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI inline choice interaction extractor
|
|
8
|
-
* Handles inlineChoiceInteraction elements (dropdown selections within text)
|
|
9
|
-
*/
|
|
10
|
-
export const standardInlineChoiceExtractor = {
|
|
11
|
-
id: 'qti:inline-choice-interaction',
|
|
12
|
-
name: 'QTI Standard Inline Choice Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['inlineChoiceInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI inlineChoiceInteraction (dropdown in text)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All inlineChoiceInteraction elements are standard
|
|
18
|
-
return element.rawTagName === 'inlineChoiceInteraction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract choices (inlineChoice children)
|
|
23
|
-
const inlineChoices = utils.getChildrenByTag(element, 'inlineChoice');
|
|
24
|
-
const choices = inlineChoices.map((choice) => {
|
|
25
|
-
const fixed = utils.getBooleanAttribute(choice, 'fixed');
|
|
26
|
-
return {
|
|
27
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
28
|
-
text: utils.getTextContent(choice),
|
|
29
|
-
...(fixed ? { fixed } : {}),
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
// Extract <label> child — used as placeholder text in the dropdown
|
|
33
|
-
const labelElements = utils.getChildrenByTag(element, 'label');
|
|
34
|
-
const label = labelElements.length > 0 ? utils.getTextContent(labelElements[0]) : null;
|
|
35
|
-
// data-prompt: alternative placeholder for the dropdown default option
|
|
36
|
-
const dataPrompt = utils.getAttribute(element, 'data-prompt', '') || null;
|
|
37
|
-
// Extract attributes
|
|
38
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle');
|
|
39
|
-
const interactionClasses = utils.getClasses(element);
|
|
40
|
-
return {
|
|
41
|
-
choices,
|
|
42
|
-
shuffle,
|
|
43
|
-
label,
|
|
44
|
-
...(dataPrompt ? { dataPrompt } : {}),
|
|
45
|
-
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
validate(data) {
|
|
49
|
-
const errors = [];
|
|
50
|
-
const warnings = [];
|
|
51
|
-
// Validate choices exist
|
|
52
|
-
if (!data.choices || data.choices.length === 0) {
|
|
53
|
-
errors.push('inlineChoiceInteraction must have at least one choice');
|
|
54
|
-
}
|
|
55
|
-
// Validate choice identifiers
|
|
56
|
-
if (data.choices) {
|
|
57
|
-
const identifiers = new Set();
|
|
58
|
-
for (const choice of data.choices) {
|
|
59
|
-
if (!choice.identifier) {
|
|
60
|
-
errors.push('All choices must have an identifier');
|
|
61
|
-
}
|
|
62
|
-
else if (identifiers.has(choice.identifier)) {
|
|
63
|
-
errors.push(`Duplicate choice identifier: ${choice.identifier}`);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
identifiers.add(choice.identifier);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
// Warn if too many choices
|
|
70
|
-
if (data.choices.length >= 10) {
|
|
71
|
-
warnings.push(`inlineChoiceInteraction has ${data.choices.length} choices - consider limiting for better usability`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
valid: errors.length === 0,
|
|
76
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
77
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
};
|
|
1
|
+
export * from '../../interactions/inline-choice/extractor.js';
|
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI matchInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from matchInteraction elements (matching pairs)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Match data extracted from matchInteraction elements
|
|
9
|
-
*/
|
|
10
|
-
export interface MatchData {
|
|
11
|
-
sourceSet: Array<{
|
|
12
|
-
identifier: string;
|
|
13
|
-
text: string;
|
|
14
|
-
matchMax: number;
|
|
15
|
-
matchMin?: number;
|
|
16
|
-
matchGroup?: string[];
|
|
17
|
-
classes?: string[];
|
|
18
|
-
}>;
|
|
19
|
-
targetSet: Array<{
|
|
20
|
-
identifier: string;
|
|
21
|
-
text: string;
|
|
22
|
-
matchMax: number;
|
|
23
|
-
matchMin?: number;
|
|
24
|
-
matchGroup?: string[];
|
|
25
|
-
classes?: string[];
|
|
26
|
-
}>;
|
|
27
|
-
shuffle: boolean;
|
|
28
|
-
maxAssociations: number;
|
|
29
|
-
minAssociations?: number;
|
|
30
|
-
prompt: string | null;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Standard QTI match interaction extractor
|
|
34
|
-
* Handles matchInteraction elements (matching pairs between two sets)
|
|
35
|
-
*/
|
|
36
|
-
export declare const standardMatchExtractor: ElementExtractor<MatchData>;
|
|
1
|
+
export * from '../../interactions/match/extractor.js';
|
|
37
2
|
//# sourceMappingURL=matchExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/matchExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"matchExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/matchExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
|
@@ -1,160 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI matchInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from matchInteraction elements (matching pairs)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI match interaction extractor
|
|
8
|
-
* Handles matchInteraction elements (matching pairs between two sets)
|
|
9
|
-
*/
|
|
10
|
-
export const standardMatchExtractor = {
|
|
11
|
-
id: 'qti:match-interaction',
|
|
12
|
-
name: 'QTI Standard Match Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['matchInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI matchInteraction (matching pairs)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All matchInteraction elements are standard (both QTI 2.x and 3.0)
|
|
18
|
-
return element.rawTagName === 'matchInteraction' || element.rawTagName === 'qti-match-interaction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract all simpleAssociableChoice children
|
|
23
|
-
const allChoices = utils.getChildrenByTag(element, 'simpleAssociableChoice');
|
|
24
|
-
// Determine which are source vs target based on matchSet structure
|
|
25
|
-
// In QTI, matchInteraction can have two simpleMatchSet elements
|
|
26
|
-
const matchSets = utils.getChildrenByTag(element, 'simpleMatchSet');
|
|
27
|
-
let sourceSet = [];
|
|
28
|
-
let targetSet = [];
|
|
29
|
-
if (matchSets.length >= 2) {
|
|
30
|
-
// Extract choices from first matchSet (source)
|
|
31
|
-
const sourceMatchSet = matchSets[0];
|
|
32
|
-
const sourceElements = utils.getChildrenByTag(sourceMatchSet, 'simpleAssociableChoice');
|
|
33
|
-
sourceSet = sourceElements.map((choice) => {
|
|
34
|
-
const classes = utils.getClasses(choice);
|
|
35
|
-
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 1);
|
|
36
|
-
const matchMin = utils.getNumberAttribute(choice, 'matchMin', 0);
|
|
37
|
-
const matchGroupRaw = utils.getAttribute(choice, 'matchGroup', '');
|
|
38
|
-
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
39
|
-
return {
|
|
40
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
41
|
-
text: utils.getHtmlContent(choice),
|
|
42
|
-
matchMax,
|
|
43
|
-
...(matchMin > 0 ? { matchMin } : {}),
|
|
44
|
-
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
45
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
// Extract choices from second matchSet (target)
|
|
49
|
-
const targetMatchSet = matchSets[1];
|
|
50
|
-
const targetElements = utils.getChildrenByTag(targetMatchSet, 'simpleAssociableChoice');
|
|
51
|
-
targetSet = targetElements.map((choice) => {
|
|
52
|
-
const classes = utils.getClasses(choice);
|
|
53
|
-
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 1);
|
|
54
|
-
const matchMin = utils.getNumberAttribute(choice, 'matchMin', 0);
|
|
55
|
-
const matchGroupRaw = utils.getAttribute(choice, 'matchGroup', '');
|
|
56
|
-
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
57
|
-
return {
|
|
58
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
59
|
-
text: utils.getHtmlContent(choice),
|
|
60
|
-
matchMax,
|
|
61
|
-
...(matchMin > 0 ? { matchMin } : {}),
|
|
62
|
-
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
63
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
// Fallback: treat all choices as both source and target
|
|
69
|
-
const extractedChoices = allChoices.map((choice) => {
|
|
70
|
-
const classes = utils.getClasses(choice);
|
|
71
|
-
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 1);
|
|
72
|
-
const matchMin = utils.getNumberAttribute(choice, 'matchMin', 0);
|
|
73
|
-
const matchGroupRaw = utils.getAttribute(choice, 'matchGroup', '');
|
|
74
|
-
const matchGroup = matchGroupRaw.split(/\s+/).filter(Boolean);
|
|
75
|
-
return {
|
|
76
|
-
identifier: utils.getAttribute(choice, 'identifier', ''),
|
|
77
|
-
text: utils.getHtmlContent(choice),
|
|
78
|
-
matchMax,
|
|
79
|
-
...(matchMin > 0 ? { matchMin } : {}),
|
|
80
|
-
...(matchGroup.length > 0 ? { matchGroup } : {}),
|
|
81
|
-
...(classes.length > 0 ? { classes } : {}),
|
|
82
|
-
};
|
|
83
|
-
});
|
|
84
|
-
sourceSet = extractedChoices;
|
|
85
|
-
targetSet = extractedChoices;
|
|
86
|
-
}
|
|
87
|
-
// Extract attributes
|
|
88
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle');
|
|
89
|
-
const maxAssociations = utils.getNumberAttribute(element, 'maxAssociations', 1);
|
|
90
|
-
const minAssociationsRaw = utils.getNumberAttribute(element, 'minAssociations', 0);
|
|
91
|
-
const minAssociations = minAssociationsRaw > 0 ? minAssociationsRaw : undefined;
|
|
92
|
-
const interactionClasses = utils.getClasses(element);
|
|
93
|
-
const maxSelectionsMessage = utils.getAttribute(element, 'data-qti-max-selections-message', '') || null;
|
|
94
|
-
const minSelectionsMessage = utils.getAttribute(element, 'data-qti-min-selections-message', '') || null;
|
|
95
|
-
const firstColumnHeader = utils.getAttribute(element, 'data-qti-first-column-header', '') || null;
|
|
96
|
-
// Extract prompt (optional)
|
|
97
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
98
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
99
|
-
return {
|
|
100
|
-
sourceSet,
|
|
101
|
-
targetSet,
|
|
102
|
-
shuffle,
|
|
103
|
-
maxAssociations,
|
|
104
|
-
...(minAssociations !== undefined ? { minAssociations } : {}),
|
|
105
|
-
prompt,
|
|
106
|
-
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
107
|
-
...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),
|
|
108
|
-
...(minSelectionsMessage ? { minSelectionsMessage } : {}),
|
|
109
|
-
...(firstColumnHeader ? { firstColumnHeader } : {}),
|
|
110
|
-
};
|
|
111
|
-
},
|
|
112
|
-
validate(data) {
|
|
113
|
-
const errors = [];
|
|
114
|
-
// Validate source choices exist
|
|
115
|
-
if (!data.sourceSet || data.sourceSet.length === 0) {
|
|
116
|
-
errors.push('matchInteraction must have at least one source choice');
|
|
117
|
-
}
|
|
118
|
-
// Validate target choices exist
|
|
119
|
-
if (!data.targetSet || data.targetSet.length === 0) {
|
|
120
|
-
errors.push('matchInteraction must have at least one target choice');
|
|
121
|
-
}
|
|
122
|
-
// Validate choice identifiers
|
|
123
|
-
if (data.sourceSet) {
|
|
124
|
-
const identifiers = new Set();
|
|
125
|
-
for (const choice of data.sourceSet) {
|
|
126
|
-
if (!choice.identifier) {
|
|
127
|
-
errors.push('All source choices must have an identifier');
|
|
128
|
-
}
|
|
129
|
-
else if (identifiers.has(choice.identifier)) {
|
|
130
|
-
errors.push(`Duplicate source identifier: ${choice.identifier}`);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
identifiers.add(choice.identifier);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (data.targetSet) {
|
|
138
|
-
const identifiers = new Set();
|
|
139
|
-
for (const choice of data.targetSet) {
|
|
140
|
-
if (!choice.identifier) {
|
|
141
|
-
errors.push('All target choices must have an identifier');
|
|
142
|
-
}
|
|
143
|
-
else if (identifiers.has(choice.identifier)) {
|
|
144
|
-
errors.push(`Duplicate target identifier: ${choice.identifier}`);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
identifiers.add(choice.identifier);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
// Validate maxAssociations
|
|
152
|
-
if (data.maxAssociations < 0) {
|
|
153
|
-
errors.push('maxAssociations must be non-negative');
|
|
154
|
-
}
|
|
155
|
-
return {
|
|
156
|
-
valid: errors.length === 0,
|
|
157
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
158
|
-
};
|
|
159
|
-
},
|
|
160
|
-
};
|
|
1
|
+
export * from '../../interactions/match/extractor.js';
|
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI mediaInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from mediaInteraction elements (video/audio playback)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Media element data
|
|
9
|
-
*/
|
|
10
|
-
export interface MediaElement {
|
|
11
|
-
type: 'audio' | 'video' | 'object';
|
|
12
|
-
src: string;
|
|
13
|
-
mimeType: string;
|
|
14
|
-
width?: number;
|
|
15
|
-
height?: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Media data extracted from mediaInteraction elements
|
|
19
|
-
*/
|
|
20
|
-
export interface MediaData {
|
|
21
|
-
mediaElement: MediaElement | null;
|
|
22
|
-
autostart: boolean;
|
|
23
|
-
minPlays: number;
|
|
24
|
-
maxPlays: number;
|
|
25
|
-
loop: boolean;
|
|
26
|
-
prompt: string | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Standard QTI media interaction extractor
|
|
30
|
-
* Handles mediaInteraction elements (video/audio playback with interaction)
|
|
31
|
-
*/
|
|
32
|
-
export declare const standardMediaExtractor: ElementExtractor<MediaData>;
|
|
1
|
+
export * from '../../interactions/media/extractor.js';
|
|
33
2
|
//# sourceMappingURL=mediaExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/mediaExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mediaExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/mediaExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
|
@@ -1,125 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI mediaInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from mediaInteraction elements (video/audio playback)
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Standard QTI media interaction extractor
|
|
8
|
-
* Handles mediaInteraction elements (video/audio playback with interaction)
|
|
9
|
-
*/
|
|
10
|
-
export const standardMediaExtractor = {
|
|
11
|
-
id: 'qti:media-interaction',
|
|
12
|
-
name: 'QTI Standard Media Interaction',
|
|
13
|
-
priority: 10,
|
|
14
|
-
elementTypes: ['mediaInteraction'],
|
|
15
|
-
description: 'Extracts standard QTI mediaInteraction (video/audio playback)',
|
|
16
|
-
canHandle(element, _context) {
|
|
17
|
-
// All mediaInteraction elements are standard
|
|
18
|
-
return element.rawTagName === 'mediaInteraction';
|
|
19
|
-
},
|
|
20
|
-
extract(element, context) {
|
|
21
|
-
const { utils } = context;
|
|
22
|
-
// Extract attributes
|
|
23
|
-
const autostart = utils.getBooleanAttribute(element, 'autostart', false);
|
|
24
|
-
const minPlays = utils.getNumberAttribute(element, 'minPlays', 0);
|
|
25
|
-
const maxPlays = utils.getNumberAttribute(element, 'maxPlays', 0);
|
|
26
|
-
const loop = utils.getBooleanAttribute(element, 'loop', false);
|
|
27
|
-
// Extract prompt (optional)
|
|
28
|
-
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
29
|
-
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
30
|
-
// Extract media element (audio, video, or object)
|
|
31
|
-
let mediaElement = null;
|
|
32
|
-
// Check for audio element
|
|
33
|
-
const audioElements = utils.getChildrenByTag(element, 'audio');
|
|
34
|
-
if (audioElements.length > 0) {
|
|
35
|
-
const audioElement = audioElements[0];
|
|
36
|
-
const sourceElements = utils.getChildrenByTag(audioElement, 'source');
|
|
37
|
-
if (sourceElements.length === 0) {
|
|
38
|
-
throw new Error('audio element must contain at least one source element');
|
|
39
|
-
}
|
|
40
|
-
const firstSource = sourceElements[0];
|
|
41
|
-
mediaElement = {
|
|
42
|
-
type: 'audio',
|
|
43
|
-
src: utils.getAttribute(firstSource, 'src', ''),
|
|
44
|
-
mimeType: utils.getAttribute(firstSource, 'type', ''),
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
// Check for video element
|
|
48
|
-
const videoElements = utils.getChildrenByTag(element, 'video');
|
|
49
|
-
if (videoElements.length > 0) {
|
|
50
|
-
const videoElement = videoElements[0];
|
|
51
|
-
const sourceElements = utils.getChildrenByTag(videoElement, 'source');
|
|
52
|
-
if (sourceElements.length === 0) {
|
|
53
|
-
throw new Error('video element must contain at least one source element');
|
|
54
|
-
}
|
|
55
|
-
const firstSource = sourceElements[0];
|
|
56
|
-
const width = utils.getNumberAttribute(videoElement, 'width', 640);
|
|
57
|
-
const height = utils.getNumberAttribute(videoElement, 'height', 480);
|
|
58
|
-
mediaElement = {
|
|
59
|
-
type: 'video',
|
|
60
|
-
src: utils.getAttribute(firstSource, 'src', ''),
|
|
61
|
-
mimeType: utils.getAttribute(firstSource, 'type', ''),
|
|
62
|
-
width,
|
|
63
|
-
height,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
// Check for object element
|
|
67
|
-
const objectElements = utils.getChildrenByTag(element, 'object');
|
|
68
|
-
if (objectElements.length > 0) {
|
|
69
|
-
const objectElement = objectElements[0];
|
|
70
|
-
const data = utils.getAttribute(objectElement, 'data', '');
|
|
71
|
-
if (!data) {
|
|
72
|
-
throw new Error('object element must have data attribute');
|
|
73
|
-
}
|
|
74
|
-
const width = utils.getNumberAttribute(objectElement, 'width', 0);
|
|
75
|
-
const height = utils.getNumberAttribute(objectElement, 'height', 0);
|
|
76
|
-
mediaElement = {
|
|
77
|
-
type: 'object',
|
|
78
|
-
src: data,
|
|
79
|
-
mimeType: utils.getAttribute(objectElement, 'type', ''),
|
|
80
|
-
...(width > 0 ? { width } : {}),
|
|
81
|
-
...(height > 0 ? { height } : {}),
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
// Throw error if no media element found
|
|
85
|
-
if (!mediaElement) {
|
|
86
|
-
throw new Error('mediaInteraction must contain audio, video, or object element');
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
mediaElement,
|
|
90
|
-
autostart,
|
|
91
|
-
minPlays,
|
|
92
|
-
maxPlays,
|
|
93
|
-
loop,
|
|
94
|
-
prompt,
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
validate(data) {
|
|
98
|
-
const errors = [];
|
|
99
|
-
const warnings = [];
|
|
100
|
-
// Validate media element exists
|
|
101
|
-
if (!data.mediaElement) {
|
|
102
|
-
errors.push('mediaInteraction must have a mediaElement');
|
|
103
|
-
}
|
|
104
|
-
// Validate play constraints
|
|
105
|
-
if (data.minPlays < 0) {
|
|
106
|
-
errors.push('minPlays must be non-negative');
|
|
107
|
-
}
|
|
108
|
-
if (data.maxPlays < 0) {
|
|
109
|
-
errors.push('maxPlays must be non-negative');
|
|
110
|
-
}
|
|
111
|
-
// Validate minPlays <= maxPlays (when maxPlays > 0, as 0 means unlimited)
|
|
112
|
-
if (data.maxPlays > 0 && data.minPlays > data.maxPlays) {
|
|
113
|
-
errors.push(`maxPlays (${data.maxPlays}) must be greater than or equal to minPlays (${data.minPlays})`);
|
|
114
|
-
}
|
|
115
|
-
// Warn if loop is true with maxPlays
|
|
116
|
-
if (data.loop && data.maxPlays > 0) {
|
|
117
|
-
warnings.push('mediaInteraction has loop=true with maxPlays - loop may be ignored');
|
|
118
|
-
}
|
|
119
|
-
return {
|
|
120
|
-
valid: errors.length === 0,
|
|
121
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
122
|
-
warnings: warnings.length > 0 ? warnings : undefined,
|
|
123
|
-
};
|
|
124
|
-
},
|
|
125
|
-
};
|
|
1
|
+
export * from '../../interactions/media/extractor.js';
|
|
@@ -1,28 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Standard QTI orderInteraction extractor
|
|
3
|
-
*
|
|
4
|
-
* Extracts data from orderInteraction elements (ordering/ranking tasks)
|
|
5
|
-
*/
|
|
6
|
-
import type { ElementExtractor } from '../types.js';
|
|
7
|
-
/**
|
|
8
|
-
* Order data extracted from orderInteraction elements
|
|
9
|
-
*/
|
|
10
|
-
export interface OrderData {
|
|
11
|
-
choices: Array<{
|
|
12
|
-
identifier: string;
|
|
13
|
-
text: string;
|
|
14
|
-
fixed?: boolean;
|
|
15
|
-
classes?: string[];
|
|
16
|
-
}>;
|
|
17
|
-
shuffle: boolean;
|
|
18
|
-
minChoices: number;
|
|
19
|
-
maxChoices: number;
|
|
20
|
-
orientation?: string;
|
|
21
|
-
prompt: string | null;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Standard QTI order interaction extractor
|
|
25
|
-
* Handles orderInteraction elements with simpleChoice children
|
|
26
|
-
*/
|
|
27
|
-
export declare const standardOrderExtractor: ElementExtractor<OrderData>;
|
|
1
|
+
export * from '../../interactions/order/extractor.js';
|
|
28
2
|
//# sourceMappingURL=orderExtractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orderExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/orderExtractor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"orderExtractor.d.ts","sourceRoot":"","sources":["../../../src/extraction/extractors/orderExtractor.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|