@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
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI choiceInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from choiceInteraction elements with simpleChoice children
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Standard QTI choice interaction extractor
|
|
8
|
+
* Handles choiceInteraction elements with simpleChoice children
|
|
9
|
+
*/
|
|
10
|
+
export const standardChoiceExtractor = {
|
|
11
|
+
id: 'qti:choice-interaction',
|
|
12
|
+
name: 'QTI Standard Choice Interaction',
|
|
13
|
+
priority: 10,
|
|
14
|
+
elementTypes: ['choiceInteraction'],
|
|
15
|
+
description: 'Extracts standard QTI choiceInteraction with simpleChoice elements',
|
|
16
|
+
canHandle(element, context) {
|
|
17
|
+
// Standard QTI choice 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 maxChoices = utils.getNumberAttribute(element, 'maxChoices', 1);
|
|
40
|
+
const minChoices = utils.getNumberAttribute(element, 'minChoices', 0);
|
|
41
|
+
const interactionClasses = utils.getClasses(element);
|
|
42
|
+
const maxSelectionsMessage = utils.getAttribute(element, 'data-max-selections-message', '') || null;
|
|
43
|
+
const minSelectionsMessage = utils.getAttribute(element, 'data-min-selections-message', '') || null;
|
|
44
|
+
return {
|
|
45
|
+
choices,
|
|
46
|
+
shuffle,
|
|
47
|
+
maxChoices,
|
|
48
|
+
minChoices,
|
|
49
|
+
prompt,
|
|
50
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
51
|
+
...(maxSelectionsMessage ? { maxSelectionsMessage } : {}),
|
|
52
|
+
...(minSelectionsMessage ? { minSelectionsMessage } : {}),
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
validate(data) {
|
|
56
|
+
const errors = [];
|
|
57
|
+
const warnings = [];
|
|
58
|
+
// Validate choices exist
|
|
59
|
+
if (!data.choices || data.choices.length === 0) {
|
|
60
|
+
errors.push('choiceInteraction must have at least one choice');
|
|
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 maxChoices
|
|
78
|
+
if (data.maxChoices < 0) {
|
|
79
|
+
errors.push('maxChoices must be non-negative');
|
|
80
|
+
}
|
|
81
|
+
if (data.maxChoices === 0) {
|
|
82
|
+
warnings.push('maxChoices=0 means unlimited selections');
|
|
83
|
+
}
|
|
84
|
+
if (data.maxChoices > data.choices.length) {
|
|
85
|
+
warnings.push(`maxChoices (${data.maxChoices}) is greater than the number of choices (${data.choices.length})`);
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
valid: errors.length === 0,
|
|
89
|
+
errors: errors.length > 0 ? errors : undefined,
|
|
90
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/choice/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './extractor.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/choice/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI customInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from customInteraction elements (custom/portable interactions)
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementExtractor } from '../../extraction/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Custom interaction data extracted from customInteraction elements
|
|
9
|
+
*/
|
|
10
|
+
export interface CustomData {
|
|
11
|
+
xml: string;
|
|
12
|
+
rawAttributes: Record<string, string>;
|
|
13
|
+
prompt: string | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Standard QTI custom interaction extractor
|
|
17
|
+
* Handles customInteraction elements (vendor-specific or portable custom interactions)
|
|
18
|
+
*/
|
|
19
|
+
export declare const standardCustomExtractor: ElementExtractor<CustomData>;
|
|
20
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/custom/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAAgB,CAAC,UAAU,CAkDhE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI customInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from customInteraction elements (custom/portable interactions)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Standard QTI custom interaction extractor
|
|
8
|
+
* Handles customInteraction elements (vendor-specific or portable custom interactions)
|
|
9
|
+
*/
|
|
10
|
+
export const standardCustomExtractor = {
|
|
11
|
+
id: 'qti:custom-interaction',
|
|
12
|
+
name: 'QTI Standard Custom Interaction',
|
|
13
|
+
priority: 10,
|
|
14
|
+
elementTypes: ['customInteraction'],
|
|
15
|
+
description: 'Extracts standard QTI customInteraction (custom/portable interactions)',
|
|
16
|
+
canHandle(element, _context) {
|
|
17
|
+
// All customInteraction elements are handled by this extractor
|
|
18
|
+
return element.rawTagName === 'customInteraction';
|
|
19
|
+
},
|
|
20
|
+
extract(element, context) {
|
|
21
|
+
const { utils } = context;
|
|
22
|
+
// Capture the raw XML for the custom interaction
|
|
23
|
+
const xml = element.outerHTML || element.toString();
|
|
24
|
+
// Extract all attributes
|
|
25
|
+
const rawAttributes = {};
|
|
26
|
+
if (element.attributes) {
|
|
27
|
+
for (const [key, value] of Object.entries(element.attributes)) {
|
|
28
|
+
rawAttributes[key] = String(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Extract prompt (optional)
|
|
32
|
+
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
33
|
+
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
34
|
+
return {
|
|
35
|
+
xml,
|
|
36
|
+
rawAttributes,
|
|
37
|
+
prompt,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
validate(_data) {
|
|
41
|
+
const warnings = [];
|
|
42
|
+
// Warn if no XML content
|
|
43
|
+
if (!_data.xml || _data.xml.trim() === '') {
|
|
44
|
+
warnings.push('customInteraction has no XML content');
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
valid: true,
|
|
48
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/custom/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './extractor.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/custom/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI drawingInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from drawingInteraction elements (drawing on canvas)
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementExtractor } from '../../extraction/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Image data for drawing 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
|
+
* Drawing data extracted from drawingInteraction elements
|
|
19
|
+
*/
|
|
20
|
+
export interface DrawingData {
|
|
21
|
+
imageData: ImageData | null;
|
|
22
|
+
rawAttributes: Record<string, string>;
|
|
23
|
+
prompt: string | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Standard QTI drawing interaction extractor
|
|
27
|
+
* Handles drawingInteraction elements (drawing on a canvas)
|
|
28
|
+
*/
|
|
29
|
+
export declare const standardDrawingExtractor: ElementExtractor<DrawingData>;
|
|
30
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/drawing/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CAAC,WAAW,CAgFlE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI drawingInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from drawingInteraction elements (drawing on canvas)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Standard QTI drawing interaction extractor
|
|
8
|
+
* Handles drawingInteraction elements (drawing on a canvas)
|
|
9
|
+
*/
|
|
10
|
+
export const standardDrawingExtractor = {
|
|
11
|
+
id: 'qti:drawing-interaction',
|
|
12
|
+
name: 'QTI Standard Drawing Interaction',
|
|
13
|
+
priority: 10,
|
|
14
|
+
elementTypes: ['drawingInteraction'],
|
|
15
|
+
description: 'Extracts standard QTI drawingInteraction (drawing on canvas)',
|
|
16
|
+
canHandle(element, _context) {
|
|
17
|
+
// All drawingInteraction elements are standard
|
|
18
|
+
return element.rawTagName === 'drawingInteraction';
|
|
19
|
+
},
|
|
20
|
+
extract(element, context) {
|
|
21
|
+
const { utils } = context;
|
|
22
|
+
// Extract background image data from object element (optional)
|
|
23
|
+
const objectElements = utils.getChildrenByTag(element, 'object');
|
|
24
|
+
let imageData = null;
|
|
25
|
+
if (objectElements.length > 0) {
|
|
26
|
+
const objectElement = objectElements[0];
|
|
27
|
+
const type = utils.getAttribute(objectElement, 'type', '');
|
|
28
|
+
const data = utils.getAttribute(objectElement, 'data', '');
|
|
29
|
+
const width = utils.getAttribute(objectElement, 'width', '');
|
|
30
|
+
const height = utils.getAttribute(objectElement, 'height', '');
|
|
31
|
+
if (type.startsWith('image/svg')) {
|
|
32
|
+
// Extract inline SVG content
|
|
33
|
+
const content = utils.getHtmlContent(objectElement);
|
|
34
|
+
imageData = {
|
|
35
|
+
type: 'svg',
|
|
36
|
+
content,
|
|
37
|
+
...(width ? { width } : {}),
|
|
38
|
+
...(height ? { height } : {}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
else if (data) {
|
|
42
|
+
// External image reference
|
|
43
|
+
imageData = {
|
|
44
|
+
type: 'image',
|
|
45
|
+
src: data,
|
|
46
|
+
...(width ? { width } : {}),
|
|
47
|
+
...(height ? { height } : {}),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Extract all attributes
|
|
52
|
+
const rawAttributes = {};
|
|
53
|
+
if (element.attributes) {
|
|
54
|
+
for (const [key, value] of Object.entries(element.attributes)) {
|
|
55
|
+
rawAttributes[key] = String(value);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Extract prompt (optional)
|
|
59
|
+
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
60
|
+
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
61
|
+
return {
|
|
62
|
+
imageData,
|
|
63
|
+
rawAttributes,
|
|
64
|
+
prompt,
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
validate(data) {
|
|
68
|
+
const warnings = [];
|
|
69
|
+
// Warn if no background image
|
|
70
|
+
if (!data.imageData) {
|
|
71
|
+
warnings.push('drawingInteraction has no background image - students will draw on a blank canvas');
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
valid: true,
|
|
75
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/drawing/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './extractor.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/drawing/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI endAttemptInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from endAttemptInteraction elements (end attempt button)
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementExtractor } from '../../extraction/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* End attempt data extracted from endAttemptInteraction elements
|
|
9
|
+
*/
|
|
10
|
+
export interface EndAttemptData {
|
|
11
|
+
title?: string;
|
|
12
|
+
countAttempt?: boolean;
|
|
13
|
+
prompt: string | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Standard QTI end attempt interaction extractor
|
|
17
|
+
* Handles endAttemptInteraction elements (button to end the attempt)
|
|
18
|
+
*/
|
|
19
|
+
export declare const standardEndAttemptExtractor: ElementExtractor<EndAttemptData>;
|
|
20
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/end-attempt/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,gBAAgB,CAAC,cAAc,CAoDxE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI endAttemptInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from endAttemptInteraction elements (end attempt button)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Standard QTI end attempt interaction extractor
|
|
8
|
+
* Handles endAttemptInteraction elements (button to end the attempt)
|
|
9
|
+
*/
|
|
10
|
+
export const standardEndAttemptExtractor = {
|
|
11
|
+
id: 'qti:end-attempt-interaction',
|
|
12
|
+
name: 'QTI Standard End Attempt Interaction',
|
|
13
|
+
priority: 10,
|
|
14
|
+
elementTypes: ['endAttemptInteraction'],
|
|
15
|
+
description: 'Extracts standard QTI endAttemptInteraction (end attempt button)',
|
|
16
|
+
canHandle(element, _context) {
|
|
17
|
+
// All endAttemptInteraction elements are standard
|
|
18
|
+
return element.rawTagName === 'endAttemptInteraction';
|
|
19
|
+
},
|
|
20
|
+
extract(element, context) {
|
|
21
|
+
const { utils } = context;
|
|
22
|
+
// Extract attributes with defaults
|
|
23
|
+
const title = utils.getAttribute(element, 'title', 'End Attempt');
|
|
24
|
+
const countAttempt = element.hasAttribute('countAttempt')
|
|
25
|
+
? utils.getBooleanAttribute(element, 'countAttempt')
|
|
26
|
+
: true;
|
|
27
|
+
// Extract prompt (optional)
|
|
28
|
+
const promptElements = utils.getChildrenByTag(element, 'prompt');
|
|
29
|
+
const prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;
|
|
30
|
+
return {
|
|
31
|
+
title,
|
|
32
|
+
countAttempt,
|
|
33
|
+
prompt,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
validate(data) {
|
|
37
|
+
const errors = [];
|
|
38
|
+
const warnings = [];
|
|
39
|
+
// Validate title is not empty
|
|
40
|
+
if (!data.title || data.title.trim() === '') {
|
|
41
|
+
errors.push('endAttemptInteraction must have a title');
|
|
42
|
+
}
|
|
43
|
+
// Warn if countAttempt is false (uncommon usage)
|
|
44
|
+
if (data.countAttempt === false) {
|
|
45
|
+
warnings.push('endAttemptInteraction has countAttempt=false - make sure this is intentional');
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
valid: errors.length === 0,
|
|
49
|
+
errors: errors.length > 0 ? errors : undefined,
|
|
50
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/end-attempt/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './extractor.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/end-attempt/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI extendedTextInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from extendedTextInteraction elements (multi-line text input)
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementExtractor } from '../../extraction/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Extended text data extracted from extendedTextInteraction elements
|
|
9
|
+
*/
|
|
10
|
+
export interface ExtendedTextData {
|
|
11
|
+
expectedLines: number;
|
|
12
|
+
expectedLength: number;
|
|
13
|
+
placeholderText: string;
|
|
14
|
+
format: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Standard QTI extended text interaction extractor
|
|
18
|
+
* Handles extendedTextInteraction elements (multi-line text input)
|
|
19
|
+
*/
|
|
20
|
+
export declare const standardExtendedTextExtractor: ElementExtractor<ExtendedTextData>;
|
|
21
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/extended-text/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,gBAAgB,CAAC,gBAAgB,CAkE5E,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI extendedTextInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from extendedTextInteraction elements (multi-line text input)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Standard QTI extended text interaction extractor
|
|
8
|
+
* Handles extendedTextInteraction elements (multi-line text input)
|
|
9
|
+
*/
|
|
10
|
+
export const standardExtendedTextExtractor = {
|
|
11
|
+
id: 'qti:extended-text-interaction',
|
|
12
|
+
name: 'QTI Standard Extended Text Interaction',
|
|
13
|
+
priority: 10,
|
|
14
|
+
elementTypes: ['extendedTextInteraction'],
|
|
15
|
+
description: 'Extracts standard QTI extendedTextInteraction (multi-line text input)',
|
|
16
|
+
canHandle(element, _context) {
|
|
17
|
+
// All extendedTextInteraction elements are standard (both QTI 2.x and 3.0)
|
|
18
|
+
return (element.rawTagName === 'extendedTextInteraction' ||
|
|
19
|
+
element.rawTagName === 'qti-extended-text-interaction');
|
|
20
|
+
},
|
|
21
|
+
extract(element, context) {
|
|
22
|
+
const { utils } = context;
|
|
23
|
+
// Extract attributes
|
|
24
|
+
const expectedLines = utils.getNumberAttribute(element, 'expectedLines', 3);
|
|
25
|
+
const expectedLength = utils.getNumberAttribute(element, 'expectedLength', 200);
|
|
26
|
+
const placeholderText = utils.getAttribute(element, 'placeholderText', '');
|
|
27
|
+
const format = utils.getAttribute(element, 'format', 'plain');
|
|
28
|
+
const patternMask = utils.getAttribute(element, 'patternMask', '') || null;
|
|
29
|
+
const patternMaskMessage = utils.getAttribute(element, 'patternMaskMessage', '') || null;
|
|
30
|
+
const interactionClasses = utils.getClasses(element);
|
|
31
|
+
return {
|
|
32
|
+
expectedLines,
|
|
33
|
+
expectedLength,
|
|
34
|
+
placeholderText,
|
|
35
|
+
format,
|
|
36
|
+
...(patternMask ? { patternMask } : {}),
|
|
37
|
+
...(patternMaskMessage ? { patternMaskMessage } : {}),
|
|
38
|
+
...(interactionClasses.length > 0 ? { interactionClasses } : {}),
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
validate(data) {
|
|
42
|
+
const errors = [];
|
|
43
|
+
const warnings = [];
|
|
44
|
+
// Validate expectedLines
|
|
45
|
+
if (data.expectedLines < 1) {
|
|
46
|
+
errors.push('expectedLines must be at least 1');
|
|
47
|
+
}
|
|
48
|
+
// Validate expectedLength
|
|
49
|
+
if (data.expectedLength < 1) {
|
|
50
|
+
errors.push('expectedLength must be positive');
|
|
51
|
+
}
|
|
52
|
+
// Validate format
|
|
53
|
+
const validFormats = ['plain', 'preFormatted', 'xhtml'];
|
|
54
|
+
if (!validFormats.includes(data.format)) {
|
|
55
|
+
warnings.push(`Unrecognized format "${data.format}" - expected plain, preFormatted, or xhtml`);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
valid: errors.length === 0,
|
|
59
|
+
errors: errors.length > 0 ? errors : undefined,
|
|
60
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interactions/extended-text/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './extractor.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/interactions/extended-text/types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard QTI gapMatchInteraction extractor
|
|
3
|
+
*
|
|
4
|
+
* Extracts data from gapMatchInteraction elements (drag words into gaps)
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementExtractor } from '../../extraction/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Gap match data extracted from gapMatchInteraction elements
|
|
9
|
+
*/
|
|
10
|
+
export interface GapMatchData {
|
|
11
|
+
gapTexts: Array<{
|
|
12
|
+
identifier: string;
|
|
13
|
+
text: string;
|
|
14
|
+
matchMax: number;
|
|
15
|
+
matchMin?: number;
|
|
16
|
+
matchGroup?: string[];
|
|
17
|
+
classes?: string[];
|
|
18
|
+
}>;
|
|
19
|
+
gaps: string[];
|
|
20
|
+
shuffle: boolean;
|
|
21
|
+
prompt: string | null;
|
|
22
|
+
promptText: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Standard QTI gap match interaction extractor
|
|
26
|
+
* Handles gapMatchInteraction elements (drag words into gaps in text)
|
|
27
|
+
*/
|
|
28
|
+
export declare const standardGapMatchExtractor: ElementExtractor<GapMatchData>;
|
|
29
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/interactions/gap-match/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,KAAK,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC,CAAC;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,gBAAgB,CAAC,YAAY,CAkKpE,CAAC"}
|