@pie-qti/item-player 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/catalog/applyGlossaryTriggers.d.ts +13 -3
- package/dist/catalog/applyGlossaryTriggers.js +1 -0
- package/dist/catalog/applyGlossaryTriggers.js.map +1 -0
- package/dist/catalog/catalogExtractor.d.ts +0 -1
- package/dist/catalog/catalogExtractor.js +1 -0
- package/dist/catalog/catalogExtractor.js.map +1 -0
- package/dist/catalog/catalogLookup.d.ts +0 -1
- package/dist/catalog/catalogLookup.js +1 -0
- package/dist/catalog/catalogLookup.js.map +1 -0
- package/dist/catalog/glossaryAction.d.ts +4 -3
- package/dist/catalog/glossaryAction.js +1 -0
- package/dist/catalog/glossaryAction.js.map +1 -0
- package/dist/catalog/types.d.ts +0 -1
- package/dist/catalog/types.js +1 -0
- package/dist/catalog/types.js.map +1 -0
- package/dist/components/actions/typesetAction.d.ts +0 -1
- package/dist/components/actions/typesetAction.js +1 -0
- package/dist/components/actions/typesetAction.js.map +1 -0
- package/dist/components/utils/feedbackUtils.d.ts +0 -1
- package/dist/components/utils/feedbackUtils.js +1 -0
- package/dist/components/utils/feedbackUtils.js.map +1 -0
- package/dist/components/utils/index.d.ts +1 -3
- package/dist/components/utils/index.js +2 -2
- package/dist/components/utils/index.js.map +1 -0
- package/dist/components/utils/stimulusRender.d.ts +0 -1
- package/dist/components/utils/stimulusRender.js +1 -0
- package/dist/components/utils/stimulusRender.js.map +1 -0
- package/dist/components/utils/stylesheetRender.d.ts +0 -1
- package/dist/components/utils/stylesheetRender.js +1 -0
- package/dist/components/utils/stylesheetRender.js.map +1 -0
- package/dist/core/ComponentRegistry.d.ts +10 -2
- package/dist/core/ComponentRegistry.js +43 -1
- package/dist/core/ComponentRegistry.js.map +1 -0
- package/dist/core/Player.d.ts +10 -3
- package/dist/core/Player.js +55 -46
- package/dist/core/Player.js.map +1 -0
- package/dist/core/Plugin.d.ts +0 -1
- package/dist/core/Plugin.js +1 -0
- package/dist/core/Plugin.js.map +1 -0
- package/dist/core/PluginManager.d.ts +0 -1
- package/dist/core/PluginManager.js +1 -0
- package/dist/core/PluginManager.js.map +1 -0
- package/dist/core/constants.d.ts +0 -1
- package/dist/core/constants.js +1 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/declarations.d.ts +0 -1
- package/dist/core/declarations.js +1 -0
- package/dist/core/declarations.js.map +1 -0
- package/dist/core/parsingLimits.d.ts +0 -1
- package/dist/core/parsingLimits.js +1 -0
- package/dist/core/parsingLimits.js.map +1 -0
- package/dist/core/random.d.ts +0 -1
- package/dist/core/random.js +1 -0
- package/dist/core/random.js.map +1 -0
- package/dist/core/rolePolicy.d.ts +0 -1
- package/dist/core/rolePolicy.js +1 -0
- package/dist/core/rolePolicy.js.map +1 -0
- package/dist/core/sanitizer.d.ts +0 -1
- package/dist/core/sanitizer.js +1 -0
- package/dist/core/sanitizer.js.map +1 -0
- package/dist/core/trustedTypes.d.ts +0 -1
- package/dist/core/trustedTypes.js +1 -0
- package/dist/core/trustedTypes.js.map +1 -0
- package/dist/core/urlPolicy.d.ts +0 -1
- package/dist/core/urlPolicy.js +1 -0
- package/dist/core/urlPolicy.js.map +1 -0
- package/dist/document/AssessmentItemDocument.d.ts +1 -2
- package/dist/document/AssessmentItemDocument.js +1 -0
- package/dist/document/AssessmentItemDocument.js.map +1 -0
- package/dist/element.d.ts +15 -0
- package/dist/element.js +1816 -1625
- package/dist/element.js.map +1 -1
- package/dist/extensions/MathLiveEditor.d.ts +0 -1
- package/dist/extensions/MathLiveEditor.js +1 -0
- package/dist/extensions/MathLiveEditor.js.map +1 -0
- package/dist/extraction/ExtractionRegistry.d.ts +1 -2
- package/dist/extraction/ExtractionRegistry.js +1 -0
- package/dist/extraction/ExtractionRegistry.js.map +1 -0
- package/dist/extraction/createContext.d.ts +1 -2
- package/dist/extraction/createContext.js +1 -0
- package/dist/extraction/createContext.js.map +1 -0
- package/dist/extraction/index.d.ts +2 -3
- package/dist/extraction/index.js +2 -1
- package/dist/extraction/index.js.map +1 -0
- package/dist/extraction/interactionExtractionPipeline.d.ts +1 -2
- package/dist/extraction/interactionExtractionPipeline.js +1 -0
- package/dist/extraction/interactionExtractionPipeline.js.map +1 -0
- package/dist/extraction/interactionSecurity.d.ts +1 -2
- package/dist/extraction/interactionSecurity.js +1 -0
- package/dist/extraction/interactionSecurity.js.map +1 -0
- package/dist/extraction/types.d.ts +1 -2
- package/dist/extraction/types.js +1 -0
- package/dist/extraction/types.js.map +1 -0
- package/dist/extraction/utils.d.ts +0 -1
- package/dist/extraction/utils.js +1 -0
- package/dist/extraction/utils.js.map +1 -0
- package/dist/iframe/IFramePlayerHost.d.ts +0 -1
- package/dist/iframe/IFramePlayerHost.js +1 -0
- package/dist/iframe/IFramePlayerHost.js.map +1 -0
- package/dist/iframe/index.d.ts +0 -1
- package/dist/iframe/index.js +1 -0
- package/dist/iframe/index.js.map +1 -0
- package/dist/iframe/protocol.d.ts +0 -1
- package/dist/iframe/protocol.js +1 -0
- package/dist/iframe/protocol.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/interactions/associate/extractor.d.ts +0 -1
- package/dist/interactions/associate/extractor.js +1 -0
- package/dist/interactions/associate/extractor.js.map +1 -0
- package/dist/interactions/associate/index.d.ts +0 -1
- package/dist/interactions/associate/index.js +1 -0
- package/dist/interactions/associate/index.js.map +1 -0
- package/dist/interactions/associate/types.d.ts +0 -1
- package/dist/interactions/associate/types.js +1 -0
- package/dist/interactions/associate/types.js.map +1 -0
- package/dist/interactions/choice/extractor.d.ts +0 -1
- package/dist/interactions/choice/extractor.js +1 -0
- package/dist/interactions/choice/extractor.js.map +1 -0
- package/dist/interactions/choice/index.d.ts +0 -1
- package/dist/interactions/choice/index.js +1 -0
- package/dist/interactions/choice/index.js.map +1 -0
- package/dist/interactions/choice/types.d.ts +0 -1
- package/dist/interactions/choice/types.js +1 -0
- package/dist/interactions/choice/types.js.map +1 -0
- package/dist/interactions/custom/extractor.d.ts +0 -1
- package/dist/interactions/custom/extractor.js +1 -0
- package/dist/interactions/custom/extractor.js.map +1 -0
- package/dist/interactions/custom/index.d.ts +0 -1
- package/dist/interactions/custom/index.js +1 -0
- package/dist/interactions/custom/index.js.map +1 -0
- package/dist/interactions/custom/types.d.ts +0 -1
- package/dist/interactions/custom/types.js +1 -0
- package/dist/interactions/custom/types.js.map +1 -0
- package/dist/interactions/drawing/extractor.d.ts +0 -1
- package/dist/interactions/drawing/extractor.js +1 -0
- package/dist/interactions/drawing/extractor.js.map +1 -0
- package/dist/interactions/drawing/index.d.ts +0 -1
- package/dist/interactions/drawing/index.js +1 -0
- package/dist/interactions/drawing/index.js.map +1 -0
- package/dist/interactions/drawing/types.d.ts +0 -1
- package/dist/interactions/drawing/types.js +1 -0
- package/dist/interactions/drawing/types.js.map +1 -0
- package/dist/interactions/end-attempt/extractor.d.ts +0 -1
- package/dist/interactions/end-attempt/extractor.js +1 -0
- package/dist/interactions/end-attempt/extractor.js.map +1 -0
- package/dist/interactions/end-attempt/index.d.ts +0 -1
- package/dist/interactions/end-attempt/index.js +1 -0
- package/dist/interactions/end-attempt/index.js.map +1 -0
- package/dist/interactions/end-attempt/types.d.ts +0 -1
- package/dist/interactions/end-attempt/types.js +1 -0
- package/dist/interactions/end-attempt/types.js.map +1 -0
- package/dist/interactions/extended-text/extractor.d.ts +0 -1
- package/dist/interactions/extended-text/extractor.js +1 -0
- package/dist/interactions/extended-text/extractor.js.map +1 -0
- package/dist/interactions/extended-text/index.d.ts +0 -1
- package/dist/interactions/extended-text/index.js +1 -0
- package/dist/interactions/extended-text/index.js.map +1 -0
- package/dist/interactions/extended-text/types.d.ts +0 -1
- package/dist/interactions/extended-text/types.js +1 -0
- package/dist/interactions/extended-text/types.js.map +1 -0
- package/dist/interactions/gap-match/extractor.d.ts +0 -1
- package/dist/interactions/gap-match/extractor.js +1 -0
- package/dist/interactions/gap-match/extractor.js.map +1 -0
- package/dist/interactions/gap-match/index.d.ts +0 -1
- package/dist/interactions/gap-match/index.js +1 -0
- package/dist/interactions/gap-match/index.js.map +1 -0
- package/dist/interactions/gap-match/types.d.ts +0 -1
- package/dist/interactions/gap-match/types.js +1 -0
- package/dist/interactions/gap-match/types.js.map +1 -0
- package/dist/interactions/graphic-associate/extractor.d.ts +0 -1
- package/dist/interactions/graphic-associate/extractor.js +1 -0
- package/dist/interactions/graphic-associate/extractor.js.map +1 -0
- package/dist/interactions/graphic-associate/index.d.ts +0 -1
- package/dist/interactions/graphic-associate/index.js +1 -0
- package/dist/interactions/graphic-associate/index.js.map +1 -0
- package/dist/interactions/graphic-associate/types.d.ts +0 -1
- package/dist/interactions/graphic-associate/types.js +1 -0
- package/dist/interactions/graphic-associate/types.js.map +1 -0
- package/dist/interactions/graphic-gap-match/extractor.d.ts +0 -1
- package/dist/interactions/graphic-gap-match/extractor.js +1 -0
- package/dist/interactions/graphic-gap-match/extractor.js.map +1 -0
- package/dist/interactions/graphic-gap-match/index.d.ts +0 -1
- package/dist/interactions/graphic-gap-match/index.js +1 -0
- package/dist/interactions/graphic-gap-match/index.js.map +1 -0
- package/dist/interactions/graphic-gap-match/types.d.ts +0 -1
- package/dist/interactions/graphic-gap-match/types.js +1 -0
- package/dist/interactions/graphic-gap-match/types.js.map +1 -0
- package/dist/interactions/graphic-order/extractor.d.ts +0 -1
- package/dist/interactions/graphic-order/extractor.js +1 -0
- package/dist/interactions/graphic-order/extractor.js.map +1 -0
- package/dist/interactions/graphic-order/index.d.ts +0 -1
- package/dist/interactions/graphic-order/index.js +1 -0
- package/dist/interactions/graphic-order/index.js.map +1 -0
- package/dist/interactions/graphic-order/types.d.ts +0 -1
- package/dist/interactions/graphic-order/types.js +1 -0
- package/dist/interactions/graphic-order/types.js.map +1 -0
- package/dist/interactions/hotspot/extractor.d.ts +0 -1
- package/dist/interactions/hotspot/extractor.js +1 -0
- package/dist/interactions/hotspot/extractor.js.map +1 -0
- package/dist/interactions/hotspot/index.d.ts +0 -1
- package/dist/interactions/hotspot/index.js +1 -0
- package/dist/interactions/hotspot/index.js.map +1 -0
- package/dist/interactions/hotspot/types.d.ts +0 -1
- package/dist/interactions/hotspot/types.js +1 -0
- package/dist/interactions/hotspot/types.js.map +1 -0
- package/dist/interactions/hottext/extractor.d.ts +0 -1
- package/dist/interactions/hottext/extractor.js +1 -0
- package/dist/interactions/hottext/extractor.js.map +1 -0
- package/dist/interactions/hottext/index.d.ts +0 -1
- package/dist/interactions/hottext/index.js +1 -0
- package/dist/interactions/hottext/index.js.map +1 -0
- package/dist/interactions/hottext/types.d.ts +0 -1
- package/dist/interactions/hottext/types.js +1 -0
- package/dist/interactions/hottext/types.js.map +1 -0
- package/dist/interactions/index.d.ts +0 -1
- package/dist/interactions/index.js +1 -0
- package/dist/interactions/index.js.map +1 -0
- package/dist/interactions/inline/index.d.ts +0 -1
- package/dist/interactions/inline/index.js +1 -0
- package/dist/interactions/inline/index.js.map +1 -0
- package/dist/interactions/inline/render-plan.d.ts +0 -1
- package/dist/interactions/inline/render-plan.js +1 -0
- package/dist/interactions/inline/render-plan.js.map +1 -0
- package/dist/interactions/inline-choice/extractor.d.ts +0 -1
- package/dist/interactions/inline-choice/extractor.js +1 -0
- package/dist/interactions/inline-choice/extractor.js.map +1 -0
- package/dist/interactions/inline-choice/index.d.ts +0 -1
- package/dist/interactions/inline-choice/index.js +1 -0
- package/dist/interactions/inline-choice/index.js.map +1 -0
- package/dist/interactions/inline-choice/types.d.ts +0 -1
- package/dist/interactions/inline-choice/types.js +1 -0
- package/dist/interactions/inline-choice/types.js.map +1 -0
- package/dist/interactions/match/extractor.d.ts +0 -1
- package/dist/interactions/match/extractor.js +1 -0
- package/dist/interactions/match/extractor.js.map +1 -0
- package/dist/interactions/match/index.d.ts +0 -1
- package/dist/interactions/match/index.js +1 -0
- package/dist/interactions/match/index.js.map +1 -0
- package/dist/interactions/match/types.d.ts +0 -1
- package/dist/interactions/match/types.js +1 -0
- package/dist/interactions/match/types.js.map +1 -0
- package/dist/interactions/media/extractor.d.ts +0 -1
- package/dist/interactions/media/extractor.js +1 -0
- package/dist/interactions/media/extractor.js.map +1 -0
- package/dist/interactions/media/index.d.ts +0 -1
- package/dist/interactions/media/index.js +1 -0
- package/dist/interactions/media/index.js.map +1 -0
- package/dist/interactions/media/types.d.ts +0 -1
- package/dist/interactions/media/types.js +1 -0
- package/dist/interactions/media/types.js.map +1 -0
- package/dist/interactions/modules.d.ts +0 -1
- package/dist/interactions/modules.js +1 -0
- package/dist/interactions/modules.js.map +1 -0
- package/dist/interactions/order/extractor.d.ts +0 -1
- package/dist/interactions/order/extractor.js +1 -0
- package/dist/interactions/order/extractor.js.map +1 -0
- package/dist/interactions/order/index.d.ts +0 -1
- package/dist/interactions/order/index.js +1 -0
- package/dist/interactions/order/index.js.map +1 -0
- package/dist/interactions/order/types.d.ts +0 -1
- package/dist/interactions/order/types.js +1 -0
- package/dist/interactions/order/types.js.map +1 -0
- package/dist/interactions/portable-custom/extractor.d.ts +0 -1
- package/dist/interactions/portable-custom/extractor.js +1 -0
- package/dist/interactions/portable-custom/extractor.js.map +1 -0
- package/dist/interactions/portable-custom/index.d.ts +0 -1
- package/dist/interactions/portable-custom/index.js +1 -0
- package/dist/interactions/portable-custom/index.js.map +1 -0
- package/dist/interactions/portable-custom/types.d.ts +0 -1
- package/dist/interactions/portable-custom/types.js +1 -0
- package/dist/interactions/portable-custom/types.js.map +1 -0
- package/dist/interactions/position-object/extractor.d.ts +0 -1
- package/dist/interactions/position-object/extractor.js +1 -0
- package/dist/interactions/position-object/extractor.js.map +1 -0
- package/dist/interactions/position-object/index.d.ts +0 -1
- package/dist/interactions/position-object/index.js +1 -0
- package/dist/interactions/position-object/index.js.map +1 -0
- package/dist/interactions/position-object/types.d.ts +0 -1
- package/dist/interactions/position-object/types.js +1 -0
- package/dist/interactions/position-object/types.js.map +1 -0
- package/dist/interactions/select-point/extractor.d.ts +0 -1
- package/dist/interactions/select-point/extractor.js +1 -0
- package/dist/interactions/select-point/extractor.js.map +1 -0
- package/dist/interactions/select-point/index.d.ts +0 -1
- package/dist/interactions/select-point/index.js +1 -0
- package/dist/interactions/select-point/index.js.map +1 -0
- package/dist/interactions/select-point/types.d.ts +0 -1
- package/dist/interactions/select-point/types.js +1 -0
- package/dist/interactions/select-point/types.js.map +1 -0
- package/dist/interactions/shared/index.d.ts +0 -1
- package/dist/interactions/shared/index.js +1 -0
- package/dist/interactions/shared/index.js.map +1 -0
- package/dist/interactions/shared/types.d.ts +0 -1
- package/dist/interactions/shared/types.js +1 -0
- package/dist/interactions/shared/types.js.map +1 -0
- package/dist/interactions/slider/extractor.d.ts +0 -1
- package/dist/interactions/slider/extractor.js +1 -0
- package/dist/interactions/slider/extractor.js.map +1 -0
- package/dist/interactions/slider/index.d.ts +0 -1
- package/dist/interactions/slider/index.js +1 -0
- package/dist/interactions/slider/index.js.map +1 -0
- package/dist/interactions/slider/types.d.ts +0 -1
- package/dist/interactions/slider/types.js +1 -0
- package/dist/interactions/slider/types.js.map +1 -0
- package/dist/interactions/text-entry/extractor.d.ts +0 -1
- package/dist/interactions/text-entry/extractor.js +1 -0
- package/dist/interactions/text-entry/extractor.js.map +1 -0
- package/dist/interactions/text-entry/index.d.ts +0 -1
- package/dist/interactions/text-entry/index.js +1 -0
- package/dist/interactions/text-entry/index.js.map +1 -0
- package/dist/interactions/text-entry/types.d.ts +0 -1
- package/dist/interactions/text-entry/types.js +1 -0
- package/dist/interactions/text-entry/types.js.map +1 -0
- package/dist/interactions/upload/extractor.d.ts +0 -1
- package/dist/interactions/upload/extractor.js +1 -0
- package/dist/interactions/upload/extractor.js.map +1 -0
- package/dist/interactions/upload/index.d.ts +0 -1
- package/dist/interactions/upload/index.js +1 -0
- package/dist/interactions/upload/index.js.map +1 -0
- package/dist/interactions/upload/types.d.ts +0 -1
- package/dist/interactions/upload/types.js +1 -0
- package/dist/interactions/upload/types.js.map +1 -0
- package/dist/pci/PciHost.d.ts +0 -1
- package/dist/pci/PciHost.js +1 -0
- package/dist/pci/PciHost.js.map +1 -0
- package/dist/pci/types.d.ts +0 -1
- package/dist/pci/types.js +1 -0
- package/dist/pci/types.js.map +1 -0
- package/dist/pnp/applyPnp.d.ts +0 -1
- package/dist/pnp/applyPnp.js +1 -0
- package/dist/pnp/applyPnp.js.map +1 -0
- package/dist/pnp/parsePnpXml.d.ts +0 -1
- package/dist/pnp/parsePnpXml.js +1 -0
- package/dist/pnp/parsePnpXml.js.map +1 -0
- package/dist/pnp/types.d.ts +0 -1
- package/dist/pnp/types.js +1 -0
- package/dist/pnp/types.js.map +1 -0
- package/dist/presentation/itemPresentationPlan.d.ts +53 -0
- package/dist/presentation/itemPresentationPlan.js +98 -0
- package/dist/presentation/itemPresentationPlan.js.map +1 -0
- package/dist/server.d.ts +0 -1
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -0
- package/dist/types/index.d.ts +17 -3
- package/dist/types/index.js +1 -3
- package/dist/types/index.js.map +1 -0
- package/dist/types/responseValidation.d.ts +0 -1
- package/dist/types/responseValidation.js +1 -0
- package/dist/types/responseValidation.js.map +1 -0
- package/dist/utils/PerformanceMonitor.d.ts +0 -1
- package/dist/utils/PerformanceMonitor.js +1 -0
- package/dist/utils/PerformanceMonitor.js.map +1 -0
- package/dist/utils/drawingUtils.d.ts +0 -1
- package/dist/utils/drawingUtils.js +1 -0
- package/dist/utils/drawingUtils.js.map +1 -0
- package/dist/utils/responseUtils.d.ts +0 -1
- package/dist/utils/responseUtils.js +1 -0
- package/dist/utils/responseUtils.js.map +1 -0
- package/dist/web-components/QTIInteractionBase.d.ts +1 -2
- package/dist/web-components/QTIInteractionBase.js +1 -0
- package/dist/web-components/QTIInteractionBase.js.map +1 -0
- package/dist/web-components/QTIInteractionElement.d.ts +1 -2
- package/dist/web-components/QTIInteractionElement.js +1 -0
- package/dist/web-components/QTIInteractionElement.js.map +1 -0
- package/dist/web-components/index.d.ts +0 -1
- package/dist/web-components/index.js +1 -0
- package/dist/web-components/index.js.map +1 -0
- package/package.json +7 -14
- package/dist/catalog/applyGlossaryTriggers.d.ts.map +0 -1
- package/dist/catalog/catalogExtractor.d.ts.map +0 -1
- package/dist/catalog/catalogLookup.d.ts.map +0 -1
- package/dist/catalog/glossaryAction.d.ts.map +0 -1
- package/dist/catalog/types.d.ts.map +0 -1
- package/dist/components/actions/typesetAction.d.ts.map +0 -1
- package/dist/components/utils/assignProps.d.ts +0 -2
- package/dist/components/utils/assignProps.d.ts.map +0 -1
- package/dist/components/utils/assignProps.js +0 -1
- package/dist/components/utils/feedbackUtils.d.ts.map +0 -1
- package/dist/components/utils/index.d.ts.map +0 -1
- package/dist/components/utils/stimulusRender.d.ts.map +0 -1
- package/dist/components/utils/stylesheetRender.d.ts.map +0 -1
- package/dist/core/ComponentRegistry.d.ts.map +0 -1
- package/dist/core/ItemRenderer.d.ts +0 -91
- package/dist/core/ItemRenderer.d.ts.map +0 -1
- package/dist/core/ItemRenderer.js +0 -248
- package/dist/core/Player.d.ts.map +0 -1
- package/dist/core/Plugin.d.ts.map +0 -1
- package/dist/core/PluginManager.d.ts.map +0 -1
- package/dist/core/constants.d.ts.map +0 -1
- package/dist/core/declarations.d.ts.map +0 -1
- package/dist/core/parsingLimits.d.ts.map +0 -1
- package/dist/core/random.d.ts.map +0 -1
- package/dist/core/rolePolicy.d.ts.map +0 -1
- package/dist/core/sanitizer.d.ts.map +0 -1
- package/dist/core/trustedTypes.d.ts.map +0 -1
- package/dist/core/urlPolicy.d.ts.map +0 -1
- package/dist/document/AssessmentItemDocument.d.ts.map +0 -1
- package/dist/extensions/MathLiveEditor.d.ts.map +0 -1
- package/dist/extraction/ExtractionRegistry.d.ts.map +0 -1
- package/dist/extraction/createContext.d.ts.map +0 -1
- package/dist/extraction/extractors/associateExtractor.d.ts +0 -2
- package/dist/extraction/extractors/associateExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/associateExtractor.js +0 -1
- package/dist/extraction/extractors/choiceExtractor.d.ts +0 -2
- package/dist/extraction/extractors/choiceExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/choiceExtractor.js +0 -1
- package/dist/extraction/extractors/customExtractor.d.ts +0 -2
- package/dist/extraction/extractors/customExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/customExtractor.js +0 -1
- package/dist/extraction/extractors/drawingExtractor.d.ts +0 -2
- package/dist/extraction/extractors/drawingExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/drawingExtractor.js +0 -1
- package/dist/extraction/extractors/endAttemptExtractor.d.ts +0 -2
- package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/endAttemptExtractor.js +0 -1
- package/dist/extraction/extractors/extendedTextExtractor.d.ts +0 -2
- package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/extendedTextExtractor.js +0 -1
- package/dist/extraction/extractors/gapMatchExtractor.d.ts +0 -2
- package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/gapMatchExtractor.js +0 -1
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +0 -2
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/graphicAssociateExtractor.js +0 -1
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +0 -2
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/graphicGapMatchExtractor.js +0 -1
- package/dist/extraction/extractors/graphicOrderExtractor.d.ts +0 -2
- package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/graphicOrderExtractor.js +0 -1
- package/dist/extraction/extractors/hotspotExtractor.d.ts +0 -2
- package/dist/extraction/extractors/hotspotExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/hotspotExtractor.js +0 -1
- package/dist/extraction/extractors/hottextExtractor.d.ts +0 -2
- package/dist/extraction/extractors/hottextExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/hottextExtractor.js +0 -1
- package/dist/extraction/extractors/index.d.ts +0 -9
- package/dist/extraction/extractors/index.d.ts.map +0 -1
- package/dist/extraction/extractors/index.js +0 -8
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +0 -2
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/inlineChoiceExtractor.js +0 -1
- package/dist/extraction/extractors/matchExtractor.d.ts +0 -2
- package/dist/extraction/extractors/matchExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/matchExtractor.js +0 -1
- package/dist/extraction/extractors/mediaExtractor.d.ts +0 -2
- package/dist/extraction/extractors/mediaExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/mediaExtractor.js +0 -1
- package/dist/extraction/extractors/orderExtractor.d.ts +0 -2
- package/dist/extraction/extractors/orderExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/orderExtractor.js +0 -1
- package/dist/extraction/extractors/portableCustomExtractor.d.ts +0 -2
- package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/portableCustomExtractor.js +0 -1
- package/dist/extraction/extractors/positionObjectExtractor.d.ts +0 -2
- package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/positionObjectExtractor.js +0 -1
- package/dist/extraction/extractors/selectPointExtractor.d.ts +0 -2
- package/dist/extraction/extractors/selectPointExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/selectPointExtractor.js +0 -1
- package/dist/extraction/extractors/sliderExtractor.d.ts +0 -2
- package/dist/extraction/extractors/sliderExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/sliderExtractor.js +0 -1
- package/dist/extraction/extractors/textEntryExtractor.d.ts +0 -2
- package/dist/extraction/extractors/textEntryExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/textEntryExtractor.js +0 -1
- package/dist/extraction/extractors/uploadExtractor.d.ts +0 -2
- package/dist/extraction/extractors/uploadExtractor.d.ts.map +0 -1
- package/dist/extraction/extractors/uploadExtractor.js +0 -1
- package/dist/extraction/index.d.ts.map +0 -1
- package/dist/extraction/interactionExtractionPipeline.d.ts.map +0 -1
- package/dist/extraction/interactionSecurity.d.ts.map +0 -1
- package/dist/extraction/types.d.ts.map +0 -1
- package/dist/extraction/utils.d.ts.map +0 -1
- package/dist/iframe/IFramePlayerHost.d.ts.map +0 -1
- package/dist/iframe/index.d.ts.map +0 -1
- package/dist/iframe/protocol.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/interactions/associate/extractor.d.ts.map +0 -1
- package/dist/interactions/associate/index.d.ts.map +0 -1
- package/dist/interactions/associate/types.d.ts.map +0 -1
- package/dist/interactions/choice/extractor.d.ts.map +0 -1
- package/dist/interactions/choice/index.d.ts.map +0 -1
- package/dist/interactions/choice/types.d.ts.map +0 -1
- package/dist/interactions/custom/extractor.d.ts.map +0 -1
- package/dist/interactions/custom/index.d.ts.map +0 -1
- package/dist/interactions/custom/types.d.ts.map +0 -1
- package/dist/interactions/drawing/extractor.d.ts.map +0 -1
- package/dist/interactions/drawing/index.d.ts.map +0 -1
- package/dist/interactions/drawing/types.d.ts.map +0 -1
- package/dist/interactions/end-attempt/extractor.d.ts.map +0 -1
- package/dist/interactions/end-attempt/index.d.ts.map +0 -1
- package/dist/interactions/end-attempt/types.d.ts.map +0 -1
- package/dist/interactions/extended-text/extractor.d.ts.map +0 -1
- package/dist/interactions/extended-text/index.d.ts.map +0 -1
- package/dist/interactions/extended-text/types.d.ts.map +0 -1
- package/dist/interactions/gap-match/extractor.d.ts.map +0 -1
- package/dist/interactions/gap-match/index.d.ts.map +0 -1
- package/dist/interactions/gap-match/types.d.ts.map +0 -1
- package/dist/interactions/graphic-associate/extractor.d.ts.map +0 -1
- package/dist/interactions/graphic-associate/index.d.ts.map +0 -1
- package/dist/interactions/graphic-associate/types.d.ts.map +0 -1
- package/dist/interactions/graphic-gap-match/extractor.d.ts.map +0 -1
- package/dist/interactions/graphic-gap-match/index.d.ts.map +0 -1
- package/dist/interactions/graphic-gap-match/types.d.ts.map +0 -1
- package/dist/interactions/graphic-order/extractor.d.ts.map +0 -1
- package/dist/interactions/graphic-order/index.d.ts.map +0 -1
- package/dist/interactions/graphic-order/types.d.ts.map +0 -1
- package/dist/interactions/hotspot/extractor.d.ts.map +0 -1
- package/dist/interactions/hotspot/index.d.ts.map +0 -1
- package/dist/interactions/hotspot/types.d.ts.map +0 -1
- package/dist/interactions/hottext/extractor.d.ts.map +0 -1
- package/dist/interactions/hottext/index.d.ts.map +0 -1
- package/dist/interactions/hottext/types.d.ts.map +0 -1
- package/dist/interactions/index.d.ts.map +0 -1
- package/dist/interactions/inline/index.d.ts.map +0 -1
- package/dist/interactions/inline/render-plan.d.ts.map +0 -1
- package/dist/interactions/inline-choice/extractor.d.ts.map +0 -1
- package/dist/interactions/inline-choice/index.d.ts.map +0 -1
- package/dist/interactions/inline-choice/types.d.ts.map +0 -1
- package/dist/interactions/match/extractor.d.ts.map +0 -1
- package/dist/interactions/match/index.d.ts.map +0 -1
- package/dist/interactions/match/types.d.ts.map +0 -1
- package/dist/interactions/media/extractor.d.ts.map +0 -1
- package/dist/interactions/media/index.d.ts.map +0 -1
- package/dist/interactions/media/types.d.ts.map +0 -1
- package/dist/interactions/modules.d.ts.map +0 -1
- package/dist/interactions/order/extractor.d.ts.map +0 -1
- package/dist/interactions/order/index.d.ts.map +0 -1
- package/dist/interactions/order/types.d.ts.map +0 -1
- package/dist/interactions/portable-custom/extractor.d.ts.map +0 -1
- package/dist/interactions/portable-custom/index.d.ts.map +0 -1
- package/dist/interactions/portable-custom/types.d.ts.map +0 -1
- package/dist/interactions/position-object/extractor.d.ts.map +0 -1
- package/dist/interactions/position-object/index.d.ts.map +0 -1
- package/dist/interactions/position-object/types.d.ts.map +0 -1
- package/dist/interactions/select-point/extractor.d.ts.map +0 -1
- package/dist/interactions/select-point/index.d.ts.map +0 -1
- package/dist/interactions/select-point/types.d.ts.map +0 -1
- package/dist/interactions/shared/index.d.ts.map +0 -1
- package/dist/interactions/shared/types.d.ts.map +0 -1
- package/dist/interactions/slider/extractor.d.ts.map +0 -1
- package/dist/interactions/slider/index.d.ts.map +0 -1
- package/dist/interactions/slider/types.d.ts.map +0 -1
- package/dist/interactions/text-entry/extractor.d.ts.map +0 -1
- package/dist/interactions/text-entry/index.d.ts.map +0 -1
- package/dist/interactions/text-entry/types.d.ts.map +0 -1
- package/dist/interactions/upload/extractor.d.ts.map +0 -1
- package/dist/interactions/upload/index.d.ts.map +0 -1
- package/dist/interactions/upload/types.d.ts.map +0 -1
- package/dist/pci/PciHost.d.ts.map +0 -1
- package/dist/pci/types.d.ts.map +0 -1
- package/dist/pnp/applyPnp.d.ts.map +0 -1
- package/dist/pnp/parsePnpXml.d.ts.map +0 -1
- package/dist/pnp/types.d.ts.map +0 -1
- package/dist/server.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/interactions.d.ts +0 -8
- package/dist/types/interactions.d.ts.map +0 -1
- package/dist/types/interactions.js +0 -7
- package/dist/types/responseValidation.d.ts.map +0 -1
- package/dist/utils/PerformanceMonitor.d.ts.map +0 -1
- package/dist/utils/drawingUtils.d.ts.map +0 -1
- package/dist/utils/responseUtils.d.ts.map +0 -1
- package/dist/utils/touchDragHelper.d.ts +0 -2
- package/dist/utils/touchDragHelper.d.ts.map +0 -1
- package/dist/utils/touchDragHelper.js +0 -1
- package/dist/web-components/QTIInteractionBase.d.ts.map +0 -1
- package/dist/web-components/QTIInteractionElement.d.ts.map +0 -1
- package/dist/web-components/index.d.ts.map +0 -1
- package/src/__tests__/catalog.test.ts +0 -267
- package/src/__tests__/fixtures/pci/echo-pci.js +0 -49
- package/src/__tests__/pci.test.ts +0 -353
- package/src/__tests__/qti3-attribute-extraction.test.ts +0 -174
- package/src/__tests__/qti3-debug.test.ts +0 -140
- package/src/__tests__/qti3-extraction.test.ts +0 -309
- package/src/catalog/applyGlossaryTriggers.ts +0 -372
- package/src/catalog/catalogExtractor.ts +0 -130
- package/src/catalog/catalogLookup.ts +0 -53
- package/src/catalog/glossaryAction.ts +0 -38
- package/src/catalog/types.ts +0 -37
- package/src/components/ItemBody.svelte +0 -363
- package/src/components/ItemPlayer.svelte +0 -163
- package/src/components/ModalFeedbackDisplay.svelte +0 -97
- package/src/components/actions/typesetAction.ts +0 -74
- package/src/components/index.ts +0 -22
- package/src/components/utils/assignProps.ts +0 -2
- package/src/components/utils/feedbackUtils.ts +0 -140
- package/src/components/utils/index.ts +0 -13
- package/src/components/utils/stimulusRender.ts +0 -93
- package/src/components/utils/stylesheetRender.ts +0 -58
- package/src/core/ComponentRegistry.ts +0 -248
- package/src/core/Player.ts +0 -1618
- package/src/core/Plugin.ts +0 -123
- package/src/core/PluginManager.ts +0 -182
- package/src/core/constants.ts +0 -117
- package/src/core/declarations.ts +0 -171
- package/src/core/parsingLimits.ts +0 -62
- package/src/core/random.ts +0 -24
- package/src/core/rolePolicy.ts +0 -34
- package/src/core/sanitizer.ts +0 -305
- package/src/core/trustedTypes.ts +0 -63
- package/src/core/urlPolicy.ts +0 -98
- package/src/document/AssessmentItemDocument.ts +0 -247
- package/src/element.ts +0 -128
- package/src/extensions/MathLiveEditor.ts +0 -313
- package/src/extraction/ExtractionRegistry.ts +0 -335
- package/src/extraction/createContext.ts +0 -52
- package/src/extraction/extractors/associateExtractor.ts +0 -1
- package/src/extraction/extractors/choiceExtractor.ts +0 -1
- package/src/extraction/extractors/conformance-qti3-advanced.test.ts +0 -239
- package/src/extraction/extractors/conformance-qti3-basic.test.ts +0 -82
- package/src/extraction/extractors/conformance.test.ts +0 -208
- package/src/extraction/extractors/customExtractor.ts +0 -1
- package/src/extraction/extractors/drawingExtractor.ts +0 -1
- package/src/extraction/extractors/endAttemptExtractor.ts +0 -1
- package/src/extraction/extractors/extendedTextExtractor.ts +0 -1
- package/src/extraction/extractors/gapMatchExtractor.ts +0 -1
- package/src/extraction/extractors/graphicAssociateExtractor.ts +0 -1
- package/src/extraction/extractors/graphicGapMatchExtractor.ts +0 -1
- package/src/extraction/extractors/graphicOrderExtractor.ts +0 -1
- package/src/extraction/extractors/hotspotExtractor.ts +0 -1
- package/src/extraction/extractors/hottextExtractor.ts +0 -1
- package/src/extraction/extractors/index.ts +0 -9
- package/src/extraction/extractors/inlineChoiceExtractor.ts +0 -1
- package/src/extraction/extractors/matchExtractor.ts +0 -1
- package/src/extraction/extractors/mediaExtractor.ts +0 -1
- package/src/extraction/extractors/orderExtractor.ts +0 -1
- package/src/extraction/extractors/portableCustomExtractor.ts +0 -1
- package/src/extraction/extractors/positionObjectExtractor.ts +0 -1
- package/src/extraction/extractors/selectPointExtractor.ts +0 -1
- package/src/extraction/extractors/sliderExtractor.ts +0 -1
- package/src/extraction/extractors/textEntryExtractor.ts +0 -1
- package/src/extraction/extractors/uploadExtractor.ts +0 -1
- package/src/extraction/index.ts +0 -108
- package/src/extraction/interactionExtractionPipeline.ts +0 -70
- package/src/extraction/interactionSecurity.ts +0 -60
- package/src/extraction/types.ts +0 -246
- package/src/extraction/utils.ts +0 -243
- package/src/iframe/IFramePlayerHost.ts +0 -265
- package/src/iframe/index.ts +0 -11
- package/src/iframe/protocol.ts +0 -137
- package/src/index.ts +0 -101
- package/src/interactions/associate/extractor.ts +0 -133
- package/src/interactions/associate/index.ts +0 -2
- package/src/interactions/associate/types.ts +0 -1
- package/src/interactions/choice/extractor.ts +0 -121
- package/src/interactions/choice/index.ts +0 -2
- package/src/interactions/choice/types.ts +0 -1
- package/src/interactions/custom/extractor.ts +0 -72
- package/src/interactions/custom/index.ts +0 -2
- package/src/interactions/custom/types.ts +0 -1
- package/src/interactions/drawing/extractor.ts +0 -113
- package/src/interactions/drawing/index.ts +0 -2
- package/src/interactions/drawing/types.ts +0 -1
- package/src/interactions/end-attempt/extractor.ts +0 -74
- package/src/interactions/end-attempt/index.ts +0 -2
- package/src/interactions/end-attempt/types.ts +0 -1
- package/src/interactions/extended-text/extractor.ts +0 -92
- package/src/interactions/extended-text/index.ts +0 -2
- package/src/interactions/extended-text/types.ts +0 -1
- package/src/interactions/gap-match/extractor.ts +0 -193
- package/src/interactions/gap-match/index.ts +0 -2
- package/src/interactions/gap-match/types.ts +0 -1
- package/src/interactions/graphic-associate/extractor.ts +0 -192
- package/src/interactions/graphic-associate/index.ts +0 -2
- package/src/interactions/graphic-associate/types.ts +0 -1
- package/src/interactions/graphic-gap-match/extractor.ts +0 -257
- package/src/interactions/graphic-gap-match/index.ts +0 -2
- package/src/interactions/graphic-gap-match/types.ts +0 -1
- package/src/interactions/graphic-order/extractor.ts +0 -162
- package/src/interactions/graphic-order/index.ts +0 -2
- package/src/interactions/graphic-order/types.ts +0 -1
- package/src/interactions/hotspot/extractor.ts +0 -208
- package/src/interactions/hotspot/index.ts +0 -2
- package/src/interactions/hotspot/types.ts +0 -1
- package/src/interactions/hottext/extractor.ts +0 -163
- package/src/interactions/hottext/index.ts +0 -2
- package/src/interactions/hottext/types.ts +0 -1
- package/src/interactions/index.ts +0 -52
- package/src/interactions/inline/index.ts +0 -1
- package/src/interactions/inline/render-plan.ts +0 -105
- package/src/interactions/inline-choice/InlineChoice.svelte +0 -57
- package/src/interactions/inline-choice/extractor.ts +0 -105
- package/src/interactions/inline-choice/index.ts +0 -2
- package/src/interactions/inline-choice/types.ts +0 -1
- package/src/interactions/match/extractor.ts +0 -187
- package/src/interactions/match/index.ts +0 -2
- package/src/interactions/match/types.ts +0 -1
- package/src/interactions/media/extractor.ts +0 -168
- package/src/interactions/media/index.ts +0 -2
- package/src/interactions/media/types.ts +0 -1
- package/src/interactions/modules.ts +0 -111
- package/src/interactions/order/extractor.ts +0 -120
- package/src/interactions/order/index.ts +0 -2
- package/src/interactions/order/types.ts +0 -1
- package/src/interactions/portable-custom/extractor.ts +0 -122
- package/src/interactions/portable-custom/index.ts +0 -2
- package/src/interactions/portable-custom/types.ts +0 -1
- package/src/interactions/position-object/extractor.ts +0 -243
- package/src/interactions/position-object/index.ts +0 -2
- package/src/interactions/position-object/types.ts +0 -1
- package/src/interactions/select-point/extractor.ts +0 -143
- package/src/interactions/select-point/index.ts +0 -2
- package/src/interactions/select-point/types.ts +0 -1
- package/src/interactions/shared/index.ts +0 -1
- package/src/interactions/shared/types.ts +0 -430
- package/src/interactions/slider/extractor.ts +0 -102
- package/src/interactions/slider/index.ts +0 -2
- package/src/interactions/slider/types.ts +0 -1
- package/src/interactions/text-entry/InlineTextEntry.svelte +0 -75
- package/src/interactions/text-entry/extractor.ts +0 -79
- package/src/interactions/text-entry/index.ts +0 -2
- package/src/interactions/text-entry/types.ts +0 -1
- package/src/interactions/upload/extractor.ts +0 -81
- package/src/interactions/upload/index.ts +0 -2
- package/src/interactions/upload/types.ts +0 -1
- package/src/pci/PciHost.ts +0 -138
- package/src/pci/types.ts +0 -70
- package/src/pnp/applyPnp.ts +0 -29
- package/src/pnp/parsePnpXml.ts +0 -215
- package/src/pnp/types.ts +0 -75
- package/src/server.ts +0 -14
- package/src/types/index.ts +0 -388
- package/src/types/interactions.ts +0 -8
- package/src/types/responseValidation.ts +0 -29
- package/src/types/xmldom.d.ts +0 -12
- package/src/utils/PerformanceMonitor.ts +0 -335
- package/src/utils/drawingUtils.ts +0 -73
- package/src/utils/responseUtils.ts +0 -51
- package/src/utils/touchDragHelper.ts +0 -1
- package/src/web-components/QTIInteractionBase.ts +0 -303
- package/src/web-components/QTIInteractionElement.ts +0 -125
- package/src/web-components/index.ts +0 -22
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QTI 3.0 Attribute Extraction Tests
|
|
3
|
-
*
|
|
4
|
-
* Verifies that the attribute mapper integration works correctly for QTI 3.0
|
|
5
|
-
* kebab-case attributes at the extraction utilities layer.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { describe, it, expect } from 'bun:test';
|
|
9
|
-
import { parse } from 'node-html-parser';
|
|
10
|
-
import { createQtiParser } from '@pie-qti/qti-common';
|
|
11
|
-
import { createExtractionUtils } from '../extraction/utils.js';
|
|
12
|
-
import type { QTIElement } from '../types/interactions.js';
|
|
13
|
-
|
|
14
|
-
describe('QTI 3.0 Attribute Extraction', () => {
|
|
15
|
-
it('should extract max-choices attribute (kebab-case) from QTI 3.0 element', () => {
|
|
16
|
-
const xml = `
|
|
17
|
-
<qti-choice-interaction response-identifier="RESPONSE" shuffle="false" max-choices="1">
|
|
18
|
-
<qti-prompt>Select one</qti-prompt>
|
|
19
|
-
<qti-simple-choice identifier="A">Choice A</qti-simple-choice>
|
|
20
|
-
</qti-choice-interaction>`;
|
|
21
|
-
|
|
22
|
-
const { attributeMapper } = createQtiParser(xml);
|
|
23
|
-
const dom = parse(xml);
|
|
24
|
-
const element = dom.querySelector('qti-choice-interaction') as unknown as QTIElement;
|
|
25
|
-
|
|
26
|
-
const utils = createExtractionUtils(undefined, undefined, attributeMapper);
|
|
27
|
-
|
|
28
|
-
// Extract QTI 3.0 kebab-case attributes using camelCase names
|
|
29
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 0);
|
|
30
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle', true);
|
|
31
|
-
const responseId = utils.getAttribute(element, 'responseIdentifier', '');
|
|
32
|
-
|
|
33
|
-
expect(maxChoices).toBe(1);
|
|
34
|
-
expect(shuffle).toBe(false);
|
|
35
|
-
expect(responseId).toBe('RESPONSE');
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should extract expected-length attribute from QTI 3.0 text entry', () => {
|
|
39
|
-
const xml = `
|
|
40
|
-
<qti-text-entry-interaction response-identifier="RESPONSE" expected-length="15" />`;
|
|
41
|
-
|
|
42
|
-
const { attributeMapper } = createQtiParser(xml);
|
|
43
|
-
const dom = parse(xml);
|
|
44
|
-
const element = dom.querySelector('qti-text-entry-interaction') as unknown as QTIElement;
|
|
45
|
-
|
|
46
|
-
const utils = createExtractionUtils(undefined, undefined, attributeMapper);
|
|
47
|
-
|
|
48
|
-
const expectedLength = utils.getNumberAttribute(element, 'expectedLength', 0);
|
|
49
|
-
const responseId = utils.getAttribute(element, 'responseIdentifier', '');
|
|
50
|
-
|
|
51
|
-
expect(expectedLength).toBe(15);
|
|
52
|
-
expect(responseId).toBe('RESPONSE');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should extract expected-lines and placeholder-text from QTI 3.0 extended text', () => {
|
|
56
|
-
const xml = `
|
|
57
|
-
<qti-extended-text-interaction
|
|
58
|
-
response-identifier="RESPONSE"
|
|
59
|
-
expected-lines="5"
|
|
60
|
-
expected-length="500"
|
|
61
|
-
placeholder-text="Type here..." />`;
|
|
62
|
-
|
|
63
|
-
const { attributeMapper } = createQtiParser(xml);
|
|
64
|
-
const dom = parse(xml);
|
|
65
|
-
const element = dom.querySelector('qti-extended-text-interaction') as unknown as QTIElement;
|
|
66
|
-
|
|
67
|
-
const utils = createExtractionUtils(undefined, undefined, attributeMapper);
|
|
68
|
-
|
|
69
|
-
const expectedLines = utils.getNumberAttribute(element, 'expectedLines', 0);
|
|
70
|
-
const expectedLength = utils.getNumberAttribute(element, 'expectedLength', 0);
|
|
71
|
-
const placeholderText = utils.getAttribute(element, 'placeholderText', '');
|
|
72
|
-
|
|
73
|
-
expect(expectedLines).toBe(5);
|
|
74
|
-
expect(expectedLength).toBe(500);
|
|
75
|
-
expect(placeholderText).toBe('Type here...');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('should extract max-associations from QTI 3.0 match interaction', () => {
|
|
79
|
-
const xml = `
|
|
80
|
-
<qti-match-interaction response-identifier="RESPONSE" shuffle="false" max-associations="3">
|
|
81
|
-
<qti-simple-match-set>
|
|
82
|
-
<qti-simple-associable-choice identifier="A" match-max="1">Item A</qti-simple-associable-choice>
|
|
83
|
-
</qti-simple-match-set>
|
|
84
|
-
</qti-match-interaction>`;
|
|
85
|
-
|
|
86
|
-
const { attributeMapper } = createQtiParser(xml);
|
|
87
|
-
const dom = parse(xml);
|
|
88
|
-
const interaction = dom.querySelector('qti-match-interaction') as unknown as QTIElement;
|
|
89
|
-
const choice = dom.querySelector('qti-simple-associable-choice') as unknown as QTIElement;
|
|
90
|
-
|
|
91
|
-
const utils = createExtractionUtils(undefined, undefined, attributeMapper);
|
|
92
|
-
|
|
93
|
-
const maxAssociations = utils.getNumberAttribute(interaction, 'maxAssociations', 0);
|
|
94
|
-
const matchMax = utils.getNumberAttribute(choice, 'matchMax', 0);
|
|
95
|
-
|
|
96
|
-
expect(maxAssociations).toBe(3);
|
|
97
|
-
expect(matchMax).toBe(1);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should handle QTI 2.x camelCase attributes with default mapper', () => {
|
|
101
|
-
const xml = `
|
|
102
|
-
<choiceInteraction responseIdentifier="RESPONSE" shuffle="true" maxChoices="2">
|
|
103
|
-
<simpleChoice identifier="A">Choice A</simpleChoice>
|
|
104
|
-
</choiceInteraction>`;
|
|
105
|
-
|
|
106
|
-
// No mapper specified - defaults to QTI 2.x
|
|
107
|
-
const dom = parse(xml);
|
|
108
|
-
const element = dom.querySelector('choiceinteraction') as unknown as QTIElement;
|
|
109
|
-
|
|
110
|
-
const utils = createExtractionUtils(); // Defaults to Qti2xAttributeNameMapper
|
|
111
|
-
|
|
112
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 0);
|
|
113
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle', false);
|
|
114
|
-
const responseId = utils.getAttribute(element, 'responseIdentifier', '');
|
|
115
|
-
|
|
116
|
-
expect(maxChoices).toBe(2);
|
|
117
|
-
expect(shuffle).toBe(true);
|
|
118
|
-
expect(responseId).toBe('RESPONSE');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should handle boolean attributes correctly for both versions', () => {
|
|
122
|
-
// QTI 3.0
|
|
123
|
-
const qti3xml = `<qti-choice-interaction shuffle="true" />`;
|
|
124
|
-
const { attributeMapper: qti3Mapper } = createQtiParser(qti3xml);
|
|
125
|
-
const qti3Dom = parse(qti3xml);
|
|
126
|
-
const qti3Element = qti3Dom.querySelector('qti-choice-interaction') as unknown as QTIElement;
|
|
127
|
-
const qti3Utils = createExtractionUtils(undefined, undefined, qti3Mapper);
|
|
128
|
-
|
|
129
|
-
expect(qti3Utils.getBooleanAttribute(qti3Element, 'shuffle', false)).toBe(true);
|
|
130
|
-
|
|
131
|
-
// QTI 2.x
|
|
132
|
-
const qti2xml = `<choiceInteraction shuffle="true" />`;
|
|
133
|
-
const qti2Dom = parse(qti2xml);
|
|
134
|
-
const qti2Element = qti2Dom.querySelector('choiceinteraction') as unknown as QTIElement;
|
|
135
|
-
const qti2Utils = createExtractionUtils(); // defaults
|
|
136
|
-
|
|
137
|
-
expect(qti2Utils.getBooleanAttribute(qti2Element, 'shuffle', false)).toBe(true);
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
it('should return default values when attributes are missing', () => {
|
|
141
|
-
const xml = `<qti-choice-interaction response-identifier="RESPONSE" />`;
|
|
142
|
-
const { attributeMapper } = createQtiParser(xml);
|
|
143
|
-
const dom = parse(xml);
|
|
144
|
-
const element = dom.querySelector('qti-choice-interaction') as unknown as QTIElement;
|
|
145
|
-
|
|
146
|
-
const utils = createExtractionUtils(undefined, undefined, attributeMapper);
|
|
147
|
-
|
|
148
|
-
// These attributes don't exist, should return defaults
|
|
149
|
-
const maxChoices = utils.getNumberAttribute(element, 'maxChoices', 99);
|
|
150
|
-
const shuffle = utils.getBooleanAttribute(element, 'shuffle', true);
|
|
151
|
-
|
|
152
|
-
expect(maxChoices).toBe(99);
|
|
153
|
-
expect(shuffle).toBe(true);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('should handle lower-bound and upper-bound for slider', () => {
|
|
157
|
-
const xml = `
|
|
158
|
-
<qti-slider-interaction response-identifier="RESPONSE" lower-bound="0" upper-bound="100" step="5" />`;
|
|
159
|
-
|
|
160
|
-
const { attributeMapper } = createQtiParser(xml);
|
|
161
|
-
const dom = parse(xml);
|
|
162
|
-
const element = dom.querySelector('qti-slider-interaction') as unknown as QTIElement;
|
|
163
|
-
|
|
164
|
-
const utils = createExtractionUtils(undefined, undefined, attributeMapper);
|
|
165
|
-
|
|
166
|
-
const lowerBound = utils.getNumberAttribute(element, 'lowerBound', 0);
|
|
167
|
-
const upperBound = utils.getNumberAttribute(element, 'upperBound', 0);
|
|
168
|
-
const step = utils.getNumberAttribute(element, 'step', 0);
|
|
169
|
-
|
|
170
|
-
expect(lowerBound).toBe(0);
|
|
171
|
-
expect(upperBound).toBe(100);
|
|
172
|
-
expect(step).toBe(5);
|
|
173
|
-
});
|
|
174
|
-
});
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'bun:test';
|
|
2
|
-
import { detectQtiVersion } from '@pie-qti/qti-common';
|
|
3
|
-
import { Player } from '../core/Player.js';
|
|
4
|
-
import { parse } from 'node-html-parser';
|
|
5
|
-
|
|
6
|
-
const QTI3_SIMPLE = `<?xml version="1.0" encoding="UTF-8"?>
|
|
7
|
-
<qti-assessment-item
|
|
8
|
-
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
|
|
9
|
-
identifier="test"
|
|
10
|
-
title="Test">
|
|
11
|
-
<qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier"/>
|
|
12
|
-
<qti-item-body>
|
|
13
|
-
<qti-choice-interaction response-identifier="RESPONSE" max-choices="1">
|
|
14
|
-
<qti-simple-choice identifier="A">A</qti-simple-choice>
|
|
15
|
-
</qti-choice-interaction>
|
|
16
|
-
</qti-item-body>
|
|
17
|
-
</qti-assessment-item>`;
|
|
18
|
-
|
|
19
|
-
const QTI3_TEXT_ENTRY = `<?xml version="1.0" encoding="UTF-8"?>
|
|
20
|
-
<qti-assessment-item
|
|
21
|
-
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
|
|
22
|
-
identifier="qti3-text-entry"
|
|
23
|
-
title="Text Entry">
|
|
24
|
-
<qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="string"/>
|
|
25
|
-
<qti-item-body>
|
|
26
|
-
<p>What is the capital? <qti-text-entry-interaction response-identifier="RESPONSE" expected-length="15"/></p>
|
|
27
|
-
</qti-item-body>
|
|
28
|
-
</qti-assessment-item>`;
|
|
29
|
-
|
|
30
|
-
describe('QTI 3.0 Debug', () => {
|
|
31
|
-
it('should detect QTI 3.0 version', () => {
|
|
32
|
-
const version = detectQtiVersion(QTI3_SIMPLE);
|
|
33
|
-
console.log('Detected version:', version);
|
|
34
|
-
expect(version).toBe('3.0');
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should create player with QTI 3.0', () => {
|
|
38
|
-
const player = new Player({ itemXml: QTI3_SIMPLE });
|
|
39
|
-
console.log('Player created successfully');
|
|
40
|
-
expect(player).toBeDefined();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should parse HTML and find elements', () => {
|
|
44
|
-
const docRoot = parse(QTI3_SIMPLE, { lowerCaseTagName: false, comment: false });
|
|
45
|
-
console.log('Parsed HTML structure:');
|
|
46
|
-
console.log('Root tag:', docRoot.rawTagName);
|
|
47
|
-
|
|
48
|
-
const itemBody = docRoot.querySelector('qti-item-body');
|
|
49
|
-
console.log('Found qti-item-body:', !!itemBody);
|
|
50
|
-
if (itemBody) {
|
|
51
|
-
console.log('itemBody children:', itemBody.childNodes.length);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const choiceInteraction = docRoot.querySelector('qti-choice-interaction');
|
|
55
|
-
console.log('Found qti-choice-interaction:', !!choiceInteraction);
|
|
56
|
-
if (choiceInteraction) {
|
|
57
|
-
console.log('choiceInteraction tag:', (choiceInteraction as any).rawTagName);
|
|
58
|
-
console.log('response-identifier attr:', choiceInteraction.getAttribute('response-identifier'));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
expect(choiceInteraction).toBeDefined();
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('should extract choice interaction', () => {
|
|
65
|
-
const player = new Player({ itemXml: QTI3_SIMPLE });
|
|
66
|
-
const interactions = player.getInteractionData();
|
|
67
|
-
console.log('Choice interactions found:', interactions.length);
|
|
68
|
-
expect(interactions.length).toBeGreaterThan(0);
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('should parse text entry in HTML', () => {
|
|
72
|
-
const docRoot = parse(QTI3_TEXT_ENTRY, { lowerCaseTagName: false, comment: false });
|
|
73
|
-
const textEntry = docRoot.querySelector('qti-text-entry-interaction');
|
|
74
|
-
console.log('Found qti-text-entry-interaction:', !!textEntry);
|
|
75
|
-
if (textEntry) {
|
|
76
|
-
console.log('textEntry tag:', (textEntry as any).rawTagName);
|
|
77
|
-
console.log('response-identifier attr:', textEntry.getAttribute('response-identifier'));
|
|
78
|
-
} else {
|
|
79
|
-
// Try finding all elements
|
|
80
|
-
const allElements = docRoot.querySelectorAll('*');
|
|
81
|
-
console.log('Total elements found:', allElements.length);
|
|
82
|
-
console.log('Element tags:', allElements.map((el: any) => el.rawTagName).slice(0, 10));
|
|
83
|
-
}
|
|
84
|
-
expect(textEntry).toBeDefined();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('should extract text entry interaction', () => {
|
|
88
|
-
const player = new Player({ itemXml: QTI3_TEXT_ENTRY });
|
|
89
|
-
const interactions = player.getInteractionData();
|
|
90
|
-
console.log('Text entry interactions found:', interactions.length);
|
|
91
|
-
console.log('Interactions:', JSON.stringify(interactions, null, 2));
|
|
92
|
-
expect(interactions.length).toBeGreaterThan(0);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('should process responses for QTI 3.0', () => {
|
|
96
|
-
const qti3WithProcessing = `<?xml version="1.0" encoding="UTF-8"?>
|
|
97
|
-
<qti-assessment-item
|
|
98
|
-
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
|
|
99
|
-
identifier="test"
|
|
100
|
-
title="Test">
|
|
101
|
-
<qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
|
|
102
|
-
<qti-correct-response>
|
|
103
|
-
<qti-value>A</qti-value>
|
|
104
|
-
</qti-correct-response>
|
|
105
|
-
</qti-response-declaration>
|
|
106
|
-
<qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
|
|
107
|
-
<qti-default-value>
|
|
108
|
-
<qti-value>0</qti-value>
|
|
109
|
-
</qti-default-value>
|
|
110
|
-
</qti-outcome-declaration>
|
|
111
|
-
<qti-item-body>
|
|
112
|
-
<qti-choice-interaction response-identifier="RESPONSE" max-choices="1">
|
|
113
|
-
<qti-simple-choice identifier="A">Correct</qti-simple-choice>
|
|
114
|
-
<qti-simple-choice identifier="B">Wrong</qti-simple-choice>
|
|
115
|
-
</qti-choice-interaction>
|
|
116
|
-
</qti-item-body>
|
|
117
|
-
<qti-response-processing>
|
|
118
|
-
<qti-response-condition>
|
|
119
|
-
<qti-response-if>
|
|
120
|
-
<qti-match>
|
|
121
|
-
<qti-variable identifier="RESPONSE"/>
|
|
122
|
-
<qti-correct identifier="RESPONSE"/>
|
|
123
|
-
</qti-match>
|
|
124
|
-
<qti-set-outcome-value identifier="SCORE">
|
|
125
|
-
<qti-base-value base-type="float">1.0</qti-base-value>
|
|
126
|
-
</qti-set-outcome-value>
|
|
127
|
-
</qti-response-if>
|
|
128
|
-
</qti-response-condition>
|
|
129
|
-
</qti-response-processing>
|
|
130
|
-
</qti-assessment-item>`;
|
|
131
|
-
|
|
132
|
-
const player = new Player({ itemXml: qti3WithProcessing });
|
|
133
|
-
player.setResponses({ RESPONSE: 'A' });
|
|
134
|
-
const result = player.processResponses();
|
|
135
|
-
console.log('Response processing result:', result);
|
|
136
|
-
console.log('Score:', result.score);
|
|
137
|
-
console.log('Outcome values:', result.outcomeValues);
|
|
138
|
-
expect(result.score).toBe(1.0);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QTI 3.0 Extraction Tests
|
|
3
|
-
*
|
|
4
|
-
* Verifies that QTI 3.0 content (kebab-case attributes/elements) extracts correctly
|
|
5
|
-
* and produces identical data structures to QTI 2.x equivalents.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { describe, it, expect } from 'bun:test';
|
|
9
|
-
import { Player } from '../core/Player.js';
|
|
10
|
-
|
|
11
|
-
// QTI 3.0 sample items
|
|
12
|
-
const QTI3_SIMPLE_CHOICE = `<?xml version="1.0" encoding="UTF-8"?>
|
|
13
|
-
<qti-assessment-item
|
|
14
|
-
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
|
|
15
|
-
identifier="qti3-simple-choice"
|
|
16
|
-
title="Simple Multiple Choice (QTI 3.0)"
|
|
17
|
-
adaptive="false"
|
|
18
|
-
time-dependent="false">
|
|
19
|
-
|
|
20
|
-
<qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="identifier">
|
|
21
|
-
<qti-correct-response>
|
|
22
|
-
<qti-value>ChoiceA</qti-value>
|
|
23
|
-
</qti-correct-response>
|
|
24
|
-
</qti-response-declaration>
|
|
25
|
-
|
|
26
|
-
<qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
|
|
27
|
-
<qti-default-value>
|
|
28
|
-
<qti-value>0.0</qti-value>
|
|
29
|
-
</qti-default-value>
|
|
30
|
-
</qti-outcome-declaration>
|
|
31
|
-
|
|
32
|
-
<qti-item-body>
|
|
33
|
-
<p>If Maya has 12 cookies and gives 5 to her friend, how many cookies does she have left?</p>
|
|
34
|
-
<qti-choice-interaction response-identifier="RESPONSE" shuffle="false" max-choices="1">
|
|
35
|
-
<qti-prompt>Select the correct answer:</qti-prompt>
|
|
36
|
-
<qti-simple-choice identifier="ChoiceA">7</qti-simple-choice>
|
|
37
|
-
<qti-simple-choice identifier="ChoiceB">17</qti-simple-choice>
|
|
38
|
-
<qti-simple-choice identifier="ChoiceC">5</qti-simple-choice>
|
|
39
|
-
<qti-simple-choice identifier="ChoiceD">8</qti-simple-choice>
|
|
40
|
-
</qti-choice-interaction>
|
|
41
|
-
</qti-item-body>
|
|
42
|
-
|
|
43
|
-
<qti-response-processing>
|
|
44
|
-
<qti-response-condition>
|
|
45
|
-
<qti-response-if>
|
|
46
|
-
<qti-match>
|
|
47
|
-
<qti-variable identifier="RESPONSE"/>
|
|
48
|
-
<qti-correct identifier="RESPONSE"/>
|
|
49
|
-
</qti-match>
|
|
50
|
-
<qti-set-outcome-value identifier="SCORE">
|
|
51
|
-
<qti-base-value base-type="float">1.0</qti-base-value>
|
|
52
|
-
</qti-set-outcome-value>
|
|
53
|
-
</qti-response-if>
|
|
54
|
-
</qti-response-condition>
|
|
55
|
-
</qti-response-processing>
|
|
56
|
-
</qti-assessment-item>`;
|
|
57
|
-
|
|
58
|
-
const QTI3_TEXT_ENTRY = `<?xml version="1.0" encoding="UTF-8"?>
|
|
59
|
-
<qti-assessment-item
|
|
60
|
-
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
|
|
61
|
-
identifier="qti3-text-entry"
|
|
62
|
-
title="Text Entry (QTI 3.0)"
|
|
63
|
-
adaptive="false"
|
|
64
|
-
time-dependent="false">
|
|
65
|
-
|
|
66
|
-
<qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="string">
|
|
67
|
-
<qti-correct-response>
|
|
68
|
-
<qti-value>Paris</qti-value>
|
|
69
|
-
</qti-correct-response>
|
|
70
|
-
</qti-response-declaration>
|
|
71
|
-
|
|
72
|
-
<qti-item-body>
|
|
73
|
-
<p>What is the capital of France? <qti-text-entry-interaction response-identifier="RESPONSE" expected-length="15"/></p>
|
|
74
|
-
</qti-item-body>
|
|
75
|
-
|
|
76
|
-
<qti-response-processing>
|
|
77
|
-
<qti-response-condition>
|
|
78
|
-
<qti-response-if>
|
|
79
|
-
<qti-match>
|
|
80
|
-
<qti-variable identifier="RESPONSE"/>
|
|
81
|
-
<qti-correct identifier="RESPONSE"/>
|
|
82
|
-
</qti-match>
|
|
83
|
-
<qti-set-outcome-value identifier="SCORE">
|
|
84
|
-
<qti-base-value base-type="float">1.0</qti-base-value>
|
|
85
|
-
</qti-set-outcome-value>
|
|
86
|
-
</qti-response-if>
|
|
87
|
-
</qti-response-condition>
|
|
88
|
-
</qti-response-processing>
|
|
89
|
-
</qti-assessment-item>`;
|
|
90
|
-
|
|
91
|
-
const QTI3_EXTENDED_TEXT = `<?xml version="1.0" encoding="UTF-8"?>
|
|
92
|
-
<qti-assessment-item
|
|
93
|
-
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
|
|
94
|
-
identifier="qti3-extended-text"
|
|
95
|
-
title="Extended Text (QTI 3.0)"
|
|
96
|
-
adaptive="false"
|
|
97
|
-
time-dependent="false">
|
|
98
|
-
|
|
99
|
-
<qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="string"/>
|
|
100
|
-
|
|
101
|
-
<qti-item-body>
|
|
102
|
-
<p>Describe the water cycle in your own words.</p>
|
|
103
|
-
<qti-extended-text-interaction
|
|
104
|
-
response-identifier="RESPONSE"
|
|
105
|
-
expected-lines="5"
|
|
106
|
-
expected-length="500"
|
|
107
|
-
placeholder-text="Type your answer here..."/>
|
|
108
|
-
</qti-item-body>
|
|
109
|
-
</qti-assessment-item>`;
|
|
110
|
-
|
|
111
|
-
const QTI3_MATCH = `<?xml version="1.0" encoding="UTF-8"?>
|
|
112
|
-
<qti-assessment-item
|
|
113
|
-
xmlns="http://www.imsglobal.org/xsd/imsqtiasi_v3p0"
|
|
114
|
-
identifier="qti3-match"
|
|
115
|
-
title="Match Interaction (QTI 3.0)"
|
|
116
|
-
adaptive="false"
|
|
117
|
-
time-dependent="false">
|
|
118
|
-
|
|
119
|
-
<qti-response-declaration identifier="RESPONSE" cardinality="multiple" base-type="directedPair">
|
|
120
|
-
<qti-correct-response>
|
|
121
|
-
<qti-value>france paris</qti-value>
|
|
122
|
-
<qti-value>germany berlin</qti-value>
|
|
123
|
-
</qti-correct-response>
|
|
124
|
-
<qti-mapping default-value="0">
|
|
125
|
-
<qti-map-entry map-key="france paris" mapped-value="1.5"/>
|
|
126
|
-
<qti-map-entry map-key="germany berlin" mapped-value="1.5"/>
|
|
127
|
-
</qti-mapping>
|
|
128
|
-
</qti-response-declaration>
|
|
129
|
-
|
|
130
|
-
<qti-outcome-declaration identifier="SCORE" cardinality="single" base-type="float">
|
|
131
|
-
<qti-default-value>
|
|
132
|
-
<qti-value>0</qti-value>
|
|
133
|
-
</qti-default-value>
|
|
134
|
-
</qti-outcome-declaration>
|
|
135
|
-
|
|
136
|
-
<qti-item-body>
|
|
137
|
-
<p>Match each country with its capital city:</p>
|
|
138
|
-
<qti-match-interaction response-identifier="RESPONSE" shuffle="false" max-associations="3">
|
|
139
|
-
<qti-prompt>Drag each capital to its country:</qti-prompt>
|
|
140
|
-
<qti-simple-match-set>
|
|
141
|
-
<qti-simple-associable-choice identifier="france" match-max="1">France</qti-simple-associable-choice>
|
|
142
|
-
<qti-simple-associable-choice identifier="germany" match-max="1">Germany</qti-simple-associable-choice>
|
|
143
|
-
</qti-simple-match-set>
|
|
144
|
-
<qti-simple-match-set>
|
|
145
|
-
<qti-simple-associable-choice identifier="paris" match-max="1">Paris</qti-simple-associable-choice>
|
|
146
|
-
<qti-simple-associable-choice identifier="berlin" match-max="1">Berlin</qti-simple-associable-choice>
|
|
147
|
-
</qti-simple-match-set>
|
|
148
|
-
</qti-match-interaction>
|
|
149
|
-
</qti-item-body>
|
|
150
|
-
|
|
151
|
-
<qti-response-processing>
|
|
152
|
-
<qti-response-condition>
|
|
153
|
-
<qti-response-if>
|
|
154
|
-
<qti-is-null>
|
|
155
|
-
<qti-variable identifier="RESPONSE"/>
|
|
156
|
-
</qti-is-null>
|
|
157
|
-
<qti-set-outcome-value identifier="SCORE">
|
|
158
|
-
<qti-base-value base-type="float">0</qti-base-value>
|
|
159
|
-
</qti-set-outcome-value>
|
|
160
|
-
</qti-response-if>
|
|
161
|
-
<qti-response-else>
|
|
162
|
-
<qti-set-outcome-value identifier="SCORE">
|
|
163
|
-
<qti-map-response identifier="RESPONSE"/>
|
|
164
|
-
</qti-set-outcome-value>
|
|
165
|
-
</qti-response-else>
|
|
166
|
-
</qti-response-condition>
|
|
167
|
-
</qti-response-processing>
|
|
168
|
-
</qti-assessment-item>`;
|
|
169
|
-
|
|
170
|
-
describe('QTI 3.0 Extraction', () => {
|
|
171
|
-
describe('Choice Interaction', () => {
|
|
172
|
-
it('should extract and render QTI 3.0 choice interaction', () => {
|
|
173
|
-
const player = new Player({ itemXml: QTI3_SIMPLE_CHOICE });
|
|
174
|
-
const interactions = player.getInteractionData();
|
|
175
|
-
|
|
176
|
-
// Verify interaction was extracted
|
|
177
|
-
expect(interactions).toHaveLength(1);
|
|
178
|
-
const interaction = interactions[0];
|
|
179
|
-
|
|
180
|
-
expect(interaction.type).toBe('choiceInteraction'); // normalized to QTI 2.x camelCase
|
|
181
|
-
expect(interaction.responseId).toBe('RESPONSE');
|
|
182
|
-
expect(interaction.maxChoices).toBe(1);
|
|
183
|
-
expect(interaction.shuffle).toBe(false);
|
|
184
|
-
expect(interaction.choices).toHaveLength(4);
|
|
185
|
-
expect(interaction.choices[0].identifier).toBe('ChoiceA');
|
|
186
|
-
expect(interaction.choices[0].text).toContain('7');
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it('should process responses correctly for QTI 3.0 items', () => {
|
|
190
|
-
const player = new Player({ itemXml: QTI3_SIMPLE_CHOICE });
|
|
191
|
-
|
|
192
|
-
// Set correct response
|
|
193
|
-
player.setResponses({ RESPONSE: 'ChoiceA' });
|
|
194
|
-
const result = player.processResponses();
|
|
195
|
-
|
|
196
|
-
expect(result.score).toBe(1.0);
|
|
197
|
-
expect(result.outcomeValues.SCORE).toBe(1.0);
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
describe('Text Entry Interaction', () => {
|
|
202
|
-
it('should extract QTI 3.0 text entry with expected-length attribute', () => {
|
|
203
|
-
const player = new Player({ itemXml: QTI3_TEXT_ENTRY });
|
|
204
|
-
const interactions = player.getInteractionData();
|
|
205
|
-
|
|
206
|
-
expect(interactions).toHaveLength(1);
|
|
207
|
-
const interaction = interactions[0];
|
|
208
|
-
|
|
209
|
-
expect(interaction.type).toBe('textEntryInteraction'); // normalized to QTI 2.x camelCase
|
|
210
|
-
expect(interaction.responseId).toBe('RESPONSE');
|
|
211
|
-
expect(interaction.expectedLength).toBe(15);
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('should process text entry responses correctly', () => {
|
|
215
|
-
const player = new Player({ itemXml: QTI3_TEXT_ENTRY });
|
|
216
|
-
|
|
217
|
-
player.setResponses({ RESPONSE: 'Paris' });
|
|
218
|
-
const result = player.processResponses();
|
|
219
|
-
|
|
220
|
-
expect(result.score).toBe(1.0);
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
describe('Extended Text Interaction', () => {
|
|
225
|
-
it('should extract QTI 3.0 extended text with kebab-case attributes', () => {
|
|
226
|
-
const player = new Player({ itemXml: QTI3_EXTENDED_TEXT });
|
|
227
|
-
const interactions = player.getInteractionData();
|
|
228
|
-
|
|
229
|
-
expect(interactions).toHaveLength(1);
|
|
230
|
-
const interaction = interactions[0];
|
|
231
|
-
|
|
232
|
-
expect(interaction.type).toBe('extendedTextInteraction'); // normalized to QTI 2.x camelCase
|
|
233
|
-
expect(interaction.responseId).toBe('RESPONSE');
|
|
234
|
-
expect(interaction.expectedLines).toBe(5);
|
|
235
|
-
expect(interaction.expectedLength).toBe(500);
|
|
236
|
-
expect(interaction.placeholderText).toBe('Type your answer here...');
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
describe('Match Interaction', () => {
|
|
241
|
-
it('should extract QTI 3.0 match interaction with kebab-case attributes', () => {
|
|
242
|
-
const player = new Player({ itemXml: QTI3_MATCH });
|
|
243
|
-
const interactions = player.getInteractionData();
|
|
244
|
-
|
|
245
|
-
expect(interactions).toHaveLength(1);
|
|
246
|
-
const interaction = interactions[0];
|
|
247
|
-
|
|
248
|
-
expect(interaction.type).toBe('matchInteraction'); // normalized to QTI 2.x camelCase
|
|
249
|
-
expect(interaction.responseId).toBe('RESPONSE');
|
|
250
|
-
expect(interaction.maxAssociations).toBe(3);
|
|
251
|
-
expect(interaction.shuffle).toBe(false);
|
|
252
|
-
expect(interaction.sourceSet).toHaveLength(2);
|
|
253
|
-
expect(interaction.targetSet).toHaveLength(2);
|
|
254
|
-
expect(interaction.sourceSet[0].identifier).toBe('france');
|
|
255
|
-
expect(interaction.targetSet[0].identifier).toBe('paris');
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
it('should process match interaction responses correctly', () => {
|
|
259
|
-
const player = new Player({ itemXml: QTI3_MATCH });
|
|
260
|
-
|
|
261
|
-
// Set correct response
|
|
262
|
-
player.setResponses({ RESPONSE: ['france paris', 'germany berlin'] });
|
|
263
|
-
const result = player.processResponses();
|
|
264
|
-
|
|
265
|
-
expect(result.score).toBe(3.0);
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
describe('Backward Compatibility', () => {
|
|
270
|
-
it('should handle QTI 2.x without mappers (default behavior)', () => {
|
|
271
|
-
const qti2xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
272
|
-
<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2"
|
|
273
|
-
identifier="qti2-choice"
|
|
274
|
-
title="QTI 2.x Choice"
|
|
275
|
-
adaptive="false"
|
|
276
|
-
timeDependent="false">
|
|
277
|
-
<responseDeclaration identifier="RESPONSE" cardinality="single" baseType="identifier">
|
|
278
|
-
<correctResponse>
|
|
279
|
-
<value>A</value>
|
|
280
|
-
</correctResponse>
|
|
281
|
-
</responseDeclaration>
|
|
282
|
-
<outcomeDeclaration identifier="SCORE" cardinality="single" baseType="float">
|
|
283
|
-
<defaultValue><value>0</value></defaultValue>
|
|
284
|
-
</outcomeDeclaration>
|
|
285
|
-
<itemBody>
|
|
286
|
-
<choiceInteraction responseIdentifier="RESPONSE" shuffle="true" maxChoices="1">
|
|
287
|
-
<simpleChoice identifier="A">Choice A</simpleChoice>
|
|
288
|
-
<simpleChoice identifier="B">Choice B</simpleChoice>
|
|
289
|
-
</choiceInteraction>
|
|
290
|
-
</itemBody>
|
|
291
|
-
<responseProcessing template="http://www.imsglobal.org/question/qti_v2p2/rptemplates/match_correct"/>
|
|
292
|
-
</assessmentItem>`;
|
|
293
|
-
|
|
294
|
-
// No explicit mappers - should automatically use QTI 2.x defaults
|
|
295
|
-
const player = new Player({ itemXml: qti2xml });
|
|
296
|
-
const interactions = player.getInteractionData();
|
|
297
|
-
|
|
298
|
-
expect(interactions).toHaveLength(1);
|
|
299
|
-
expect(interactions[0].type).toBe('choiceInteraction');
|
|
300
|
-
expect(interactions[0].maxChoices).toBe(1);
|
|
301
|
-
expect(interactions[0].shuffle).toBe(true);
|
|
302
|
-
|
|
303
|
-
// Verify responses work
|
|
304
|
-
player.setResponses({ RESPONSE: 'A' });
|
|
305
|
-
const result = player.processResponses();
|
|
306
|
-
expect(result.score).toBe(1);
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
});
|