@pie-qti/item-player 0.1.1 → 0.1.5
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 +22 -19
- package/dist/catalog/applyGlossaryTriggers.d.ts +15 -0
- package/dist/catalog/applyGlossaryTriggers.d.ts.map +1 -0
- package/dist/catalog/applyGlossaryTriggers.js +193 -0
- package/dist/catalog/catalogExtractor.d.ts +18 -0
- package/dist/catalog/catalogExtractor.d.ts.map +1 -0
- package/dist/catalog/catalogExtractor.js +114 -0
- package/dist/catalog/catalogLookup.d.ts +18 -0
- package/dist/catalog/catalogLookup.d.ts.map +1 -0
- package/dist/catalog/catalogLookup.js +44 -0
- package/dist/catalog/glossaryAction.d.ts +17 -0
- package/dist/catalog/glossaryAction.d.ts.map +1 -0
- package/dist/catalog/glossaryAction.js +21 -0
- package/dist/catalog/types.d.ts +26 -0
- package/dist/catalog/types.d.ts.map +1 -0
- package/dist/catalog/types.js +6 -0
- package/dist/components/actions/typesetAction.d.ts +24 -0
- package/dist/components/actions/typesetAction.d.ts.map +1 -0
- package/dist/components/actions/typesetAction.js +59 -0
- package/dist/components/utils/assignProps.d.ts +2 -0
- package/dist/components/utils/assignProps.d.ts.map +1 -0
- package/dist/components/utils/assignProps.js +1 -0
- package/dist/components/utils/feedbackUtils.d.ts +73 -0
- package/dist/components/utils/feedbackUtils.d.ts.map +1 -0
- package/dist/components/utils/feedbackUtils.js +93 -0
- package/dist/components/utils/index.d.ts +6 -0
- package/dist/components/utils/index.d.ts.map +1 -0
- package/dist/components/utils/index.js +5 -0
- package/dist/core/ComponentRegistry.d.ts +128 -0
- package/dist/core/ComponentRegistry.d.ts.map +1 -0
- package/dist/core/ComponentRegistry.js +137 -0
- package/dist/core/ItemRenderer.d.ts +91 -0
- package/dist/core/ItemRenderer.d.ts.map +1 -0
- package/dist/core/ItemRenderer.js +261 -0
- package/dist/core/Player.d.ts +195 -0
- package/dist/core/Player.d.ts.map +1 -0
- package/dist/core/Player.js +1235 -0
- package/dist/core/Plugin.d.ts +105 -0
- package/dist/core/Plugin.d.ts.map +1 -0
- package/dist/core/Plugin.js +7 -0
- package/dist/core/PluginManager.d.ts +56 -0
- package/dist/core/PluginManager.d.ts.map +1 -0
- package/dist/core/PluginManager.js +147 -0
- package/dist/core/constants.d.ts +68 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +106 -0
- package/dist/core/declarations.d.ts +45 -0
- package/dist/core/declarations.d.ts.map +1 -0
- package/dist/core/declarations.js +133 -0
- package/dist/core/parsingLimits.d.ts +12 -0
- package/dist/core/parsingLimits.d.ts.map +1 -0
- package/dist/core/parsingLimits.js +45 -0
- package/dist/core/random.d.ts +12 -0
- package/dist/core/random.d.ts.map +1 -0
- package/dist/core/random.js +21 -0
- package/dist/core/rolePolicy.d.ts +16 -0
- package/dist/core/rolePolicy.d.ts.map +1 -0
- package/dist/core/rolePolicy.js +15 -0
- package/dist/core/sanitizer.d.ts +34 -0
- package/dist/core/sanitizer.d.ts.map +1 -0
- package/dist/core/sanitizer.js +198 -0
- package/dist/core/trustedTypes.d.ts +16 -0
- package/dist/core/trustedTypes.d.ts.map +1 -0
- package/dist/core/trustedTypes.js +55 -0
- package/dist/core/urlPolicy.d.ts +8 -0
- package/dist/core/urlPolicy.d.ts.map +1 -0
- package/dist/core/urlPolicy.js +90 -0
- package/dist/element.d.ts +22 -0
- package/dist/element.js +5327 -0
- package/dist/element.js.map +1 -0
- package/dist/extensions/MathLiveEditor.d.ts +32 -0
- package/dist/extensions/MathLiveEditor.d.ts.map +1 -0
- package/dist/extensions/MathLiveEditor.js +249 -0
- package/dist/extraction/ExtractionRegistry.d.ts +112 -0
- package/dist/extraction/ExtractionRegistry.d.ts.map +1 -0
- package/dist/extraction/ExtractionRegistry.js +260 -0
- package/dist/extraction/createContext.d.ts +30 -0
- package/dist/extraction/createContext.d.ts.map +1 -0
- package/dist/extraction/createContext.js +39 -0
- package/dist/extraction/extractors/associateExtractor.d.ts +29 -0
- package/dist/extraction/extractors/associateExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/associateExtractor.js +97 -0
- package/dist/extraction/extractors/choiceExtractor.d.ts +27 -0
- package/dist/extraction/extractors/choiceExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/choiceExtractor.js +93 -0
- package/dist/extraction/extractors/customExtractor.d.ts +20 -0
- package/dist/extraction/extractors/customExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/customExtractor.js +51 -0
- package/dist/extraction/extractors/drawingExtractor.d.ts +30 -0
- package/dist/extraction/extractors/drawingExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/drawingExtractor.js +78 -0
- package/dist/extraction/extractors/endAttemptExtractor.d.ts +20 -0
- package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/endAttemptExtractor.js +53 -0
- package/dist/extraction/extractors/extendedTextExtractor.d.ts +21 -0
- package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/extendedTextExtractor.js +63 -0
- package/dist/extraction/extractors/gapMatchExtractor.d.ts +29 -0
- package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/gapMatchExtractor.js +155 -0
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +41 -0
- package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/graphicAssociateExtractor.js +143 -0
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +53 -0
- package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/graphicGapMatchExtractor.js +205 -0
- package/dist/extraction/extractors/graphicOrderExtractor.d.ts +37 -0
- package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/graphicOrderExtractor.js +121 -0
- package/dist/extraction/extractors/hotspotExtractor.d.ts +38 -0
- package/dist/extraction/extractors/hotspotExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/hotspotExtractor.js +159 -0
- package/dist/extraction/extractors/hottextExtractor.d.ts +26 -0
- package/dist/extraction/extractors/hottextExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/hottextExtractor.js +128 -0
- package/dist/extraction/extractors/index.d.ts +63 -0
- package/dist/extraction/extractors/index.d.ts.map +1 -0
- package/dist/extraction/extractors/index.js +88 -0
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +25 -0
- package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/inlineChoiceExtractor.js +80 -0
- package/dist/extraction/extractors/matchExtractor.d.ts +37 -0
- package/dist/extraction/extractors/matchExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/matchExtractor.js +160 -0
- package/dist/extraction/extractors/mediaExtractor.d.ts +33 -0
- package/dist/extraction/extractors/mediaExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/mediaExtractor.js +125 -0
- package/dist/extraction/extractors/orderExtractor.d.ts +28 -0
- package/dist/extraction/extractors/orderExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/orderExtractor.js +90 -0
- package/dist/extraction/extractors/portableCustomExtractor.d.ts +14 -0
- package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/portableCustomExtractor.js +96 -0
- package/dist/extraction/extractors/positionObjectExtractor.d.ts +59 -0
- package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/positionObjectExtractor.js +191 -0
- package/dist/extraction/extractors/selectPointExtractor.d.ts +31 -0
- package/dist/extraction/extractors/selectPointExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/selectPointExtractor.js +109 -0
- package/dist/extraction/extractors/sliderExtractor.d.ts +24 -0
- package/dist/extraction/extractors/sliderExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/sliderExtractor.js +73 -0
- package/dist/extraction/extractors/textEntryExtractor.d.ts +21 -0
- package/dist/extraction/extractors/textEntryExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/textEntryExtractor.js +54 -0
- package/dist/extraction/extractors/uploadExtractor.d.ts +20 -0
- package/dist/extraction/extractors/uploadExtractor.d.ts.map +1 -0
- package/dist/extraction/extractors/uploadExtractor.js +59 -0
- package/dist/extraction/index.d.ts +49 -0
- package/dist/extraction/index.d.ts.map +1 -0
- package/dist/extraction/index.js +49 -0
- package/dist/extraction/types.d.ts +209 -0
- package/dist/extraction/types.d.ts.map +1 -0
- package/dist/extraction/types.js +30 -0
- package/dist/extraction/utils.d.ts +15 -0
- package/dist/extraction/utils.d.ts.map +1 -0
- package/dist/extraction/utils.js +178 -0
- package/dist/iframe/IFramePlayerHost.d.ts +122 -0
- package/dist/iframe/IFramePlayerHost.d.ts.map +1 -0
- package/dist/iframe/IFramePlayerHost.js +172 -0
- package/dist/iframe/index.d.ts +9 -0
- package/dist/iframe/index.d.ts.map +1 -0
- package/dist/iframe/index.js +8 -0
- package/dist/iframe/protocol.d.ts +75 -0
- package/dist/iframe/protocol.d.ts.map +1 -0
- package/dist/iframe/protocol.js +53 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/pci/PciHost.d.ts +53 -0
- package/dist/pci/PciHost.d.ts.map +1 -0
- package/dist/pci/PciHost.js +116 -0
- package/dist/pci/types.d.ts +57 -0
- package/dist/pci/types.d.ts.map +1 -0
- package/dist/pci/types.js +19 -0
- package/dist/pnp/applyPnp.d.ts +9 -0
- package/dist/pnp/applyPnp.d.ts.map +1 -0
- package/dist/pnp/applyPnp.js +19 -0
- package/dist/pnp/parsePnpXml.d.ts +9 -0
- package/dist/pnp/parsePnpXml.d.ts.map +1 -0
- package/dist/pnp/parsePnpXml.js +101 -0
- package/dist/pnp/types.d.ts +40 -0
- package/dist/pnp/types.d.ts.map +1 -0
- package/dist/pnp/types.js +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +10 -0
- package/dist/types/index.d.ts +304 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/interactions.d.ts +412 -0
- package/dist/types/interactions.d.ts.map +1 -0
- package/dist/types/interactions.js +7 -0
- package/dist/types/responseValidation.d.ts +25 -0
- package/dist/types/responseValidation.d.ts.map +1 -0
- package/dist/types/responseValidation.js +1 -0
- package/dist/utils/PerformanceMonitor.d.ts +170 -0
- package/dist/utils/PerformanceMonitor.d.ts.map +1 -0
- package/dist/utils/PerformanceMonitor.js +242 -0
- package/dist/utils/drawingUtils.d.ts +39 -0
- package/dist/utils/drawingUtils.d.ts.map +1 -0
- package/dist/utils/drawingUtils.js +57 -0
- package/dist/utils/responseUtils.d.ts +16 -0
- package/dist/utils/responseUtils.d.ts.map +1 -0
- package/dist/utils/responseUtils.js +45 -0
- package/dist/utils/touchDragHelper.d.ts +2 -0
- package/dist/utils/touchDragHelper.d.ts.map +1 -0
- package/dist/utils/touchDragHelper.js +1 -0
- package/dist/web-components/QTIInteractionBase.d.ts +120 -0
- package/dist/web-components/QTIInteractionBase.d.ts.map +1 -0
- package/dist/web-components/QTIInteractionBase.js +243 -0
- package/dist/web-components/QTIInteractionElement.d.ts +77 -0
- package/dist/web-components/QTIInteractionElement.d.ts.map +1 -0
- package/dist/web-components/QTIInteractionElement.js +61 -0
- package/dist/web-components/index.d.ts +8 -0
- package/dist/web-components/index.d.ts.map +1 -0
- package/dist/web-components/index.js +10 -0
- package/package.json +104 -76
- package/src/__tests__/catalog.test.ts +267 -0
- package/src/__tests__/fixtures/pci/echo-pci.js +49 -0
- package/src/__tests__/glossaryTriggers.test.ts +411 -0
- package/src/__tests__/pci.test.ts +353 -0
- package/src/__tests__/pnp.test.ts +250 -0
- package/src/__tests__/qti3-attribute-extraction.test.ts +174 -0
- package/src/__tests__/qti3-debug.test.ts +140 -0
- package/src/__tests__/qti3-extraction.test.ts +309 -0
- package/src/catalog/applyGlossaryTriggers.ts +232 -0
- package/src/catalog/catalogExtractor.ts +130 -0
- package/src/catalog/catalogLookup.ts +53 -0
- package/src/catalog/glossaryAction.ts +28 -0
- package/src/catalog/types.ts +37 -0
- package/src/components/ItemBody.svelte +136 -26
- package/src/components/ItemPlayer.svelte +6 -2
- package/src/components/index.ts +3 -0
- package/src/components/utils/assignProps.ts +1 -23
- package/src/core/ComponentRegistry.ts +14 -0
- package/src/core/ItemRenderer.ts +4 -0
- package/src/core/Player.ts +312 -38
- package/src/core/parsingLimits.ts +1 -1
- package/src/core/rolePolicy.ts +34 -0
- package/src/core/urlPolicy.ts +5 -2
- package/src/element.ts +128 -0
- package/src/extensions/MathLiveEditor.ts +6 -3
- package/src/extraction/ExtractionRegistry.ts +51 -11
- package/src/extraction/createContext.ts +6 -1
- package/src/extraction/extractors/associateExtractor.ts +4 -0
- package/src/extraction/extractors/choiceExtractor.ts +12 -1
- package/src/extraction/extractors/conformance-qti3-advanced.test.ts +239 -0
- package/src/extraction/extractors/conformance-qti3-basic.test.ts +82 -0
- package/src/extraction/extractors/conformance.test.ts +208 -0
- package/src/extraction/extractors/extendedTextExtractor.ts +11 -2
- package/src/extraction/extractors/gapMatchExtractor.ts +36 -21
- package/src/extraction/extractors/graphicAssociateExtractor.ts +4 -0
- package/src/extraction/extractors/graphicGapMatchExtractor.ts +82 -10
- package/src/extraction/extractors/hotspotExtractor.ts +26 -8
- package/src/extraction/extractors/hottextExtractor.ts +15 -5
- package/src/extraction/extractors/index.ts +4 -0
- package/src/extraction/extractors/inlineChoiceExtractor.ts +22 -5
- package/src/extraction/extractors/matchExtractor.ts +33 -6
- package/src/extraction/extractors/orderExtractor.ts +6 -0
- package/src/extraction/extractors/portableCustomExtractor.ts +122 -0
- package/src/extraction/extractors/selectPointExtractor.ts +5 -5
- package/src/extraction/extractors/textEntryExtractor.ts +11 -2
- package/src/extraction/extractors/uploadExtractor.ts +10 -2
- package/src/extraction/utils.ts +99 -16
- package/src/index.ts +19 -1
- package/src/pci/PciHost.ts +138 -0
- package/src/pci/types.ts +70 -0
- package/src/pnp/applyPnp.ts +23 -0
- package/src/pnp/parsePnpXml.ts +118 -0
- package/src/pnp/types.ts +33 -0
- package/src/types/index.ts +50 -16
- package/src/types/interactions.ts +81 -6
- package/src/types/xmldom.d.ts +12 -0
- package/src/utils/drawingUtils.ts +73 -0
- package/src/utils/touchDragHelper.ts +1 -211
- package/.turbo/turbo-build.log +0 -1
- package/CHANGELOG.md +0 -9
- package/docs/QTI-COMPLIANCE.md +0 -197
- package/docs/WCAG-2.2-COMPLIANCE.md +0 -466
- package/docs/custom-extractors.md +0 -679
- package/docs/iframe-mode.md +0 -78
- package/docs/security-audit.md +0 -236
- package/docs/server-api.md +0 -691
- package/tests/conformance/FIXTURE_POLICY.md +0 -29
- package/tests/conformance/README.md +0 -70
- package/tests/conformance/fixtures/baseTypes_all/cases.json +0 -61
- package/tests/conformance/fixtures/baseTypes_all/item.xml +0 -131
- package/tests/conformance/fixtures/baseTypes_all/manifest.json +0 -7
- package/tests/conformance/fixtures/choice_match_correct/cases.json +0 -17
- package/tests/conformance/fixtures/choice_match_correct/item.xml +0 -55
- package/tests/conformance/fixtures/choice_match_correct/manifest.json +0 -14
- package/tests/conformance/fixtures/contains_multiple/cases.json +0 -12
- package/tests/conformance/fixtures/contains_multiple/item.xml +0 -37
- package/tests/conformance/fixtures/contains_multiple/manifest.json +0 -13
- package/tests/conformance/fixtures/isNull_isNotNull/cases.json +0 -9
- package/tests/conformance/fixtures/isNull_isNotNull/item.xml +0 -41
- package/tests/conformance/fixtures/isNull_isNotNull/manifest.json +0 -23
- package/tests/conformance/fixtures/mapResponse_bounds_default_duplicates/cases.json +0 -27
- package/tests/conformance/fixtures/mapResponse_bounds_default_duplicates/item.xml +0 -30
- package/tests/conformance/fixtures/mapResponse_bounds_default_duplicates/manifest.json +0 -15
- package/tests/conformance/fixtures/mapResponse_integer_mapKey/cases.json +0 -11
- package/tests/conformance/fixtures/mapResponse_integer_mapKey/item.xml +0 -26
- package/tests/conformance/fixtures/mapResponse_integer_mapKey/manifest.json +0 -13
- package/tests/conformance/fixtures/mapResponse_mapEntry_caseSensitive_override/cases.json +0 -27
- package/tests/conformance/fixtures/mapResponse_mapEntry_caseSensitive_override/item.xml +0 -32
- package/tests/conformance/fixtures/mapResponse_mapEntry_caseSensitive_override/manifest.json +0 -7
- package/tests/conformance/fixtures/mapResponse_mapping_caseSensitive_defaultValue/cases.json +0 -9
- package/tests/conformance/fixtures/mapResponse_mapping_caseSensitive_defaultValue/item.xml +0 -25
- package/tests/conformance/fixtures/mapResponse_mapping_caseSensitive_defaultValue/manifest.json +0 -12
- package/tests/conformance/fixtures/mapResponse_multiple_cardinality/cases.json +0 -12
- package/tests/conformance/fixtures/mapResponse_multiple_cardinality/item.xml +0 -35
- package/tests/conformance/fixtures/mapResponse_multiple_cardinality/manifest.json +0 -11
- package/tests/conformance/fixtures/mapping_bounds_upperLower/cases.json +0 -12
- package/tests/conformance/fixtures/mapping_bounds_upperLower/item.xml +0 -37
- package/tests/conformance/fixtures/mapping_bounds_upperLower/manifest.json +0 -11
- package/tests/conformance/fixtures/mapping_mapResponse/cases.json +0 -22
- package/tests/conformance/fixtures/mapping_mapResponse/item.xml +0 -53
- package/tests/conformance/fixtures/mapping_mapResponse/manifest.json +0 -16
- package/tests/conformance/fixtures/member_multiple/cases.json +0 -12
- package/tests/conformance/fixtures/member_multiple/item.xml +0 -37
- package/tests/conformance/fixtures/member_multiple/manifest.json +0 -13
- package/tests/conformance/fixtures/modalFeedback_basic/cases.json +0 -17
- package/tests/conformance/fixtures/modalFeedback_basic/item.xml +0 -52
- package/tests/conformance/fixtures/modalFeedback_basic/manifest.json +0 -13
- package/tests/conformance/fixtures/multiple_unordered_match/cases.json +0 -17
- package/tests/conformance/fixtures/multiple_unordered_match/item.xml +0 -44
- package/tests/conformance/fixtures/multiple_unordered_match/manifest.json +0 -11
- package/tests/conformance/fixtures/ordered_match/cases.json +0 -17
- package/tests/conformance/fixtures/ordered_match/item.xml +0 -48
- package/tests/conformance/fixtures/ordered_match/manifest.json +0 -13
- package/tests/conformance/fixtures/outcomeProcessing_derive_percent_passfail/cases.json +0 -27
- package/tests/conformance/fixtures/outcomeProcessing_derive_percent_passfail/item.xml +0 -103
- package/tests/conformance/fixtures/outcomeProcessing_derive_percent_passfail/manifest.json +0 -7
- package/tests/conformance/fixtures/outcomeProcessing_exitTest/cases.json +0 -15
- package/tests/conformance/fixtures/outcomeProcessing_exitTest/item.xml +0 -33
- package/tests/conformance/fixtures/outcomeProcessing_exitTest/manifest.json +0 -10
- package/tests/conformance/fixtures/outcomeProcessing_numberExpressions/cases.json +0 -14
- package/tests/conformance/fixtures/outcomeProcessing_numberExpressions/item.xml +0 -26
- package/tests/conformance/fixtures/outcomeProcessing_numberExpressions/manifest.json +0 -8
- package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_equal/cases.json +0 -17
- package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_equal/item.xml +0 -43
- package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_equal/manifest.json +0 -16
- package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_toBoolean/cases.json +0 -27
- package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_toBoolean/item.xml +0 -37
- package/tests/conformance/fixtures/outcomeProcessing_outcomeCondition_toBoolean/manifest.json +0 -16
- package/tests/conformance/fixtures/outcomeProcessing_outcomeMaximum/cases.json +0 -14
- package/tests/conformance/fixtures/outcomeProcessing_outcomeMaximum/item.xml +0 -35
- package/tests/conformance/fixtures/outcomeProcessing_outcomeMaximum/manifest.json +0 -8
- package/tests/conformance/fixtures/outcomeProcessing_outcomeMinimum/cases.json +0 -14
- package/tests/conformance/fixtures/outcomeProcessing_outcomeMinimum/item.xml +0 -35
- package/tests/conformance/fixtures/outcomeProcessing_outcomeMinimum/manifest.json +0 -8
- package/tests/conformance/fixtures/outcomeProcessing_outcomeProcessingFragment/cases.json +0 -15
- package/tests/conformance/fixtures/outcomeProcessing_outcomeProcessingFragment/item.xml +0 -39
- package/tests/conformance/fixtures/outcomeProcessing_outcomeProcessingFragment/manifest.json +0 -11
- package/tests/conformance/fixtures/outcomeProcessing_testVariables/cases.json +0 -14
- package/tests/conformance/fixtures/outcomeProcessing_testVariables/item.xml +0 -35
- package/tests/conformance/fixtures/outcomeProcessing_testVariables/manifest.json +0 -8
- package/tests/conformance/fixtures/pair_unordered_match/cases.json +0 -22
- package/tests/conformance/fixtures/pair_unordered_match/item.xml +0 -44
- package/tests/conformance/fixtures/pair_unordered_match/manifest.json +0 -13
- package/tests/conformance/fixtures/positionObject_coordinateSystem_aspectRatio/cases.json +0 -95
- package/tests/conformance/fixtures/positionObject_coordinateSystem_aspectRatio/item.xml +0 -53
- package/tests/conformance/fixtures/positionObject_mapResponsePoint_scoring/cases.json +0 -115
- package/tests/conformance/fixtures/positionObject_mapResponsePoint_scoring/item.xml +0 -45
- package/tests/conformance/fixtures/positionObject_mapResponse_wrong/cases.json +0 -29
- package/tests/conformance/fixtures/positionObject_mapResponse_wrong/item.xml +0 -40
- package/tests/conformance/fixtures/responseCondition_elseIf_chain/cases.json +0 -10
- package/tests/conformance/fixtures/responseCondition_elseIf_chain/item.xml +0 -49
- package/tests/conformance/fixtures/responseCondition_elseIf_chain/manifest.json +0 -15
- package/tests/conformance/fixtures/responseProcessing_anyN/cases.json +0 -27
- package/tests/conformance/fixtures/responseProcessing_anyN/item.xml +0 -47
- package/tests/conformance/fixtures/responseProcessing_anyN/manifest.json +0 -16
- package/tests/conformance/fixtures/responseProcessing_anyN_allN/cases.json +0 -27
- package/tests/conformance/fixtures/responseProcessing_anyN_allN/item.xml +0 -69
- package/tests/conformance/fixtures/responseProcessing_anyN_allN/manifest.json +0 -23
- package/tests/conformance/fixtures/responseProcessing_arithmetic_nulls/cases.json +0 -15
- package/tests/conformance/fixtures/responseProcessing_arithmetic_nulls/item.xml +0 -58
- package/tests/conformance/fixtures/responseProcessing_arithmetic_nulls/manifest.json +0 -15
- package/tests/conformance/fixtures/responseProcessing_boolean_compare_ops/cases.json +0 -37
- package/tests/conformance/fixtures/responseProcessing_boolean_compare_ops/item.xml +0 -94
- package/tests/conformance/fixtures/responseProcessing_boolean_compare_ops/manifest.json +0 -27
- package/tests/conformance/fixtures/responseProcessing_containerSize_index/cases.json +0 -33
- package/tests/conformance/fixtures/responseProcessing_containerSize_index/item.xml +0 -79
- package/tests/conformance/fixtures/responseProcessing_containerSize_index/manifest.json +0 -16
- package/tests/conformance/fixtures/responseProcessing_customOperator/cases.json +0 -15
- package/tests/conformance/fixtures/responseProcessing_customOperator/item.xml +0 -30
- package/tests/conformance/fixtures/responseProcessing_customOperator/manifest.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_default_expression/cases.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_default_expression/item.xml +0 -48
- package/tests/conformance/fixtures/responseProcessing_default_expression/manifest.json +0 -13
- package/tests/conformance/fixtures/responseProcessing_deleteValue_repeat/cases.json +0 -29
- package/tests/conformance/fixtures/responseProcessing_deleteValue_repeat/item.xml +0 -68
- package/tests/conformance/fixtures/responseProcessing_deleteValue_repeat/manifest.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_equalRounded_tolerance/cases.json +0 -39
- package/tests/conformance/fixtures/responseProcessing_equalRounded_tolerance/item.xml +0 -39
- package/tests/conformance/fixtures/responseProcessing_equalRounded_tolerance/manifest.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_exitResponse/cases.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_exitResponse/item.xml +0 -25
- package/tests/conformance/fixtures/responseProcessing_exitResponse/manifest.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_inside_duration_statsOperator/cases.json +0 -26
- package/tests/conformance/fixtures/responseProcessing_inside_duration_statsOperator/item.xml +0 -134
- package/tests/conformance/fixtures/responseProcessing_inside_duration_statsOperator/manifest.json +0 -16
- package/tests/conformance/fixtures/responseProcessing_lookupTable_interpolationTable/cases.json +0 -27
- package/tests/conformance/fixtures/responseProcessing_lookupTable_interpolationTable/item.xml +0 -33
- package/tests/conformance/fixtures/responseProcessing_lookupTable_interpolationTable/manifest.json +0 -13
- package/tests/conformance/fixtures/responseProcessing_lookupTable_matchTable/cases.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_lookupTable_matchTable/item.xml +0 -33
- package/tests/conformance/fixtures/responseProcessing_lookupTable_matchTable/manifest.json +0 -13
- package/tests/conformance/fixtures/responseProcessing_mapOutcome_basic/cases.json +0 -27
- package/tests/conformance/fixtures/responseProcessing_mapOutcome_basic/item.xml +0 -40
- package/tests/conformance/fixtures/responseProcessing_mapOutcome_basic/manifest.json +0 -18
- package/tests/conformance/fixtures/responseProcessing_mapResponsePoint_basic/cases.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_mapResponsePoint_basic/item.xml +0 -33
- package/tests/conformance/fixtures/responseProcessing_mapResponsePoint_basic/manifest.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_ordered/cases.json +0 -29
- package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_ordered/item.xml +0 -26
- package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_ordered/manifest.json +0 -7
- package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_whitespace/cases.json +0 -23
- package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_whitespace/item.xml +0 -28
- package/tests/conformance/fixtures/responseProcessing_mapResponse_directedPair_whitespace/manifest.json +0 -11
- package/tests/conformance/fixtures/responseProcessing_mapResponse_pair_unordered/cases.json +0 -29
- package/tests/conformance/fixtures/responseProcessing_mapResponse_pair_unordered/item.xml +0 -26
- package/tests/conformance/fixtures/responseProcessing_mapResponse_pair_unordered/manifest.json +0 -7
- package/tests/conformance/fixtures/responseProcessing_mathOperator_integerUtils/cases.json +0 -31
- package/tests/conformance/fixtures/responseProcessing_mathOperator_integerUtils/item.xml +0 -102
- package/tests/conformance/fixtures/responseProcessing_mathOperator_integerUtils/manifest.json +0 -18
- package/tests/conformance/fixtures/responseProcessing_math_max_min_round_truncate/cases.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_math_max_min_round_truncate/item.xml +0 -45
- package/tests/conformance/fixtures/responseProcessing_math_max_min_round_truncate/manifest.json +0 -21
- package/tests/conformance/fixtures/responseProcessing_misc_math_string_stats/cases.json +0 -26
- package/tests/conformance/fixtures/responseProcessing_misc_math_string_stats/item.xml +0 -157
- package/tests/conformance/fixtures/responseProcessing_misc_math_string_stats/manifest.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_notEqual_basic/cases.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_notEqual_basic/item.xml +0 -39
- package/tests/conformance/fixtures/responseProcessing_notEqual_basic/manifest.json +0 -18
- package/tests/conformance/fixtures/responseProcessing_patternMatch_caseSensitive/cases.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_patternMatch_caseSensitive/item.xml +0 -51
- package/tests/conformance/fixtures/responseProcessing_patternMatch_caseSensitive/manifest.json +0 -19
- package/tests/conformance/fixtures/responseProcessing_preCondition/cases.json +0 -31
- package/tests/conformance/fixtures/responseProcessing_preCondition/item.xml +0 -44
- package/tests/conformance/fixtures/responseProcessing_preCondition/manifest.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_random_lookupOutcomeValue/cases.json +0 -27
- package/tests/conformance/fixtures/responseProcessing_random_lookupOutcomeValue/item.xml +0 -42
- package/tests/conformance/fixtures/responseProcessing_random_lookupOutcomeValue/manifest.json +0 -14
- package/tests/conformance/fixtures/responseProcessing_record_fieldValue/cases.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_record_fieldValue/item.xml +0 -40
- package/tests/conformance/fixtures/responseProcessing_record_fieldValue/manifest.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_responseCondition_toBoolean/cases.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_responseCondition_toBoolean/item.xml +0 -63
- package/tests/conformance/fixtures/responseProcessing_responseCondition_toBoolean/manifest.json +0 -9
- package/tests/conformance/fixtures/responseProcessing_responseProcessingFragment/cases.json +0 -12
- package/tests/conformance/fixtures/responseProcessing_responseProcessingFragment/item.xml +0 -40
- package/tests/conformance/fixtures/responseProcessing_responseProcessingFragment/manifest.json +0 -13
- package/tests/conformance/fixtures/responseProcessing_setDefaultValue/cases.json +0 -15
- package/tests/conformance/fixtures/responseProcessing_setDefaultValue/item.xml +0 -67
- package/tests/conformance/fixtures/responseProcessing_setDefaultValue/manifest.json +0 -9
- package/tests/conformance/fixtures/responseProcessing_setResponseValue_setDefaultValue/cases.json +0 -27
- package/tests/conformance/fixtures/responseProcessing_setResponseValue_setDefaultValue/item.xml +0 -69
- package/tests/conformance/fixtures/responseProcessing_setResponseValue_setDefaultValue/manifest.json +0 -10
- package/tests/conformance/fixtures/responseProcessing_subtract_divide/cases.json +0 -15
- package/tests/conformance/fixtures/responseProcessing_subtract_divide/item.xml +0 -35
- package/tests/conformance/fixtures/responseProcessing_subtract_divide/manifest.json +0 -11
- package/tests/conformance/fixtures/responseProcessing_template_map_response/cases.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_template_map_response/item.xml +0 -31
- package/tests/conformance/fixtures/responseProcessing_template_map_response/manifest.json +0 -8
- package/tests/conformance/fixtures/responseProcessing_template_map_response_point/cases.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_template_map_response_point/item.xml +0 -27
- package/tests/conformance/fixtures/responseProcessing_template_map_response_point/manifest.json +0 -8
- package/tests/conformance/fixtures/responseProcessing_template_match_correct/cases.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_template_match_correct/item.xml +0 -34
- package/tests/conformance/fixtures/responseProcessing_template_match_correct/manifest.json +0 -8
- package/tests/conformance/fixtures/responseProcessing_template_match_correct_directedPair/cases.json +0 -22
- package/tests/conformance/fixtures/responseProcessing_template_match_correct_directedPair/item.xml +0 -30
- package/tests/conformance/fixtures/responseProcessing_template_match_correct_directedPair/manifest.json +0 -7
- package/tests/conformance/fixtures/responseProcessing_template_match_correct_two_responses/cases.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_template_match_correct_two_responses/item.xml +0 -30
- package/tests/conformance/fixtures/responseProcessing_template_match_correct_two_responses/manifest.json +0 -9
- package/tests/conformance/fixtures/responseProcessing_template_match_nothing/cases.json +0 -17
- package/tests/conformance/fixtures/responseProcessing_template_match_nothing/item.xml +0 -30
- package/tests/conformance/fixtures/responseProcessing_template_match_nothing/manifest.json +0 -8
- package/tests/conformance/fixtures/responseProcessing_xiInclude/cases.json +0 -14
- package/tests/conformance/fixtures/responseProcessing_xiInclude/item.xml +0 -25
- package/tests/conformance/fixtures/responseProcessing_xiInclude/manifest.json +0 -9
- package/tests/conformance/fixtures/stringMatch_caseSensitive_substring/cases.json +0 -12
- package/tests/conformance/fixtures/stringMatch_caseSensitive_substring/item.xml +0 -52
- package/tests/conformance/fixtures/stringMatch_caseSensitive_substring/manifest.json +0 -14
- package/tests/conformance/fixtures/templateProcessing_exitTemplate/cases.json +0 -12
- package/tests/conformance/fixtures/templateProcessing_exitTemplate/item.xml +0 -48
- package/tests/conformance/fixtures/templateProcessing_exitTemplate/manifest.json +0 -13
- package/tests/conformance/fixtures/templateProcessing_setCorrectResponse/cases.json +0 -27
- package/tests/conformance/fixtures/templateProcessing_setCorrectResponse/item.xml +0 -74
- package/tests/conformance/fixtures/templateProcessing_setCorrectResponse/manifest.json +0 -22
- package/tests/conformance/fixtures/templateProcessing_templateCondition_branching/cases.json +0 -17
- package/tests/conformance/fixtures/templateProcessing_templateCondition_branching/item.xml +0 -133
- package/tests/conformance/fixtures/templateProcessing_templateCondition_branching/manifest.json +0 -22
- package/tests/conformance/fixtures/templateProcessing_templateCondition_toBoolean/cases.json +0 -12
- package/tests/conformance/fixtures/templateProcessing_templateCondition_toBoolean/item.xml +0 -107
- package/tests/conformance/fixtures/templateProcessing_templateCondition_toBoolean/manifest.json +0 -16
- package/tests/conformance/fixtures/templateProcessing_templateConstraint/cases.json +0 -15
- package/tests/conformance/fixtures/templateProcessing_templateConstraint/item.xml +0 -52
- package/tests/conformance/fixtures/templateProcessing_templateConstraint/manifest.json +0 -14
- package/tests/conformance/fixtures/template_randomFloat_roundTo_mathConstant/cases.json +0 -16
- package/tests/conformance/fixtures/template_randomFloat_roundTo_mathConstant/item.xml +0 -49
- package/tests/conformance/fixtures/template_randomFloat_roundTo_mathConstant/manifest.json +0 -15
- package/tests/conformance/fixtures/template_randomInteger_printedVariable/cases.json +0 -16
- package/tests/conformance/fixtures/template_randomInteger_printedVariable/item.xml +0 -38
- package/tests/conformance/fixtures/template_randomInteger_printedVariable/manifest.json +0 -13
- package/tests/conformance/harness.ts +0 -84
- package/tests/conformance/run-fixtures.test.ts +0 -127
- package/tests/conformance/scripts/normalize-covers.ts +0 -152
- package/tests/conformance/types.ts +0 -53
- package/tests/core/Player.test.ts +0 -563
- package/tests/core/adaptiveItems.test.ts +0 -442
- package/tests/core/correctResponse.test.ts +0 -280
- package/tests/core/interaction-plumbing.test.ts +0 -141
- package/tests/core/modalFeedback.test.ts +0 -308
- package/tests/core/outcome-reset.test.ts +0 -43
- package/tests/extraction/extractors/associateExtractor.test.ts +0 -182
- package/tests/extraction/extractors/choiceExtractor.test.ts +0 -239
- package/tests/extraction/extractors/customExtractor.test.ts +0 -83
- package/tests/extraction/extractors/drawingExtractor.test.ts +0 -94
- package/tests/extraction/extractors/endAttemptExtractor.test.ts +0 -188
- package/tests/extraction/extractors/extendedTextExtractor.test.ts +0 -178
- package/tests/extraction/extractors/gapMatchExtractor.test.ts +0 -318
- package/tests/extraction/extractors/graphicAssociateExtractor.test.ts +0 -260
- package/tests/extraction/extractors/graphicGapMatchExtractor.test.ts +0 -320
- package/tests/extraction/extractors/graphicOrderExtractor.test.ts +0 -223
- package/tests/extraction/extractors/hotspotExtractor.test.ts +0 -298
- package/tests/extraction/extractors/hottextExtractor.test.ts +0 -240
- package/tests/extraction/extractors/inlineChoiceExtractor.test.ts +0 -292
- package/tests/extraction/extractors/matchExtractor.test.ts +0 -241
- package/tests/extraction/extractors/mediaExtractor.test.ts +0 -295
- package/tests/extraction/extractors/orderExtractor.test.ts +0 -212
- package/tests/extraction/extractors/positionObjectExtractor.test.ts +0 -363
- package/tests/extraction/extractors/selectPointExtractor.test.ts +0 -214
- package/tests/extraction/extractors/sliderExtractor.test.ts +0 -293
- package/tests/extraction/extractors/textEntryExtractor.test.ts +0 -133
- package/tests/extraction/extractors/uploadExtractor.test.ts +0 -119
- package/tests/extraction/test-utils.ts +0 -57
- package/tests/iframe/host.test.ts +0 -145
- package/tests/iframe/protocol.test.ts +0 -42
- package/tests/performance/player-benchmarks.bench.ts +0 -191
- package/tests/security/dos-limits.test.ts +0 -56
- package/tests/security/xss-prevention.test.ts +0 -522
- package/tsconfig.json +0 -20
- package/tsconfig.svelte.json +0 -14
package/docs/server-api.md
DELETED
|
@@ -1,691 +0,0 @@
|
|
|
1
|
-
# Backend Scoring API Contract
|
|
2
|
-
|
|
3
|
-
This document defines the API contract for implementing secure server-side scoring with the PIE QTI 2.2 Player.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The PIE QTI 2.2 Player supports both client-side and server-side scoring. For production environments where security is critical, server-side scoring is recommended to:
|
|
8
|
-
|
|
9
|
-
1. **Prevent Answer Exposure** - Keep correct answers and scoring logic hidden from the client
|
|
10
|
-
2. **Prevent Score Tampering** - Calculate scores on the server where they cannot be manipulated
|
|
11
|
-
3. **Filter Sensitive Data** - Control what data is sent to the client based on role and mode
|
|
12
|
-
4. **Audit Responses** - Log all submissions for security and analytics
|
|
13
|
-
|
|
14
|
-
## API Endpoints
|
|
15
|
-
|
|
16
|
-
### 1. Score Response Endpoint
|
|
17
|
-
|
|
18
|
-
**Purpose**: Calculate the score for a candidate's response without exposing correct answers or scoring logic to the client.
|
|
19
|
-
|
|
20
|
-
#### Request
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
POST /api/qti/score
|
|
24
|
-
Content-Type: application/json
|
|
25
|
-
Authorization: Bearer <token> (optional, recommended)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
**Request Body:**
|
|
29
|
-
```typescript
|
|
30
|
-
{
|
|
31
|
-
itemXml: string; // The QTI 2.2 XML for the item
|
|
32
|
-
responses: { // The candidate's responses
|
|
33
|
-
[responseIdentifier: string]: any;
|
|
34
|
-
};
|
|
35
|
-
sessionId?: string; // Optional session identifier for tracking
|
|
36
|
-
candidateId?: string; // Optional candidate identifier
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
**Example:**
|
|
41
|
-
```json
|
|
42
|
-
{
|
|
43
|
-
"itemXml": "<?xml version=\"1.0\"?><assessmentItem>...</assessmentItem>",
|
|
44
|
-
"responses": {
|
|
45
|
-
"RESPONSE": "ChoiceA"
|
|
46
|
-
},
|
|
47
|
-
"sessionId": "sess_abc123",
|
|
48
|
-
"candidateId": "student_456"
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
#### Response
|
|
53
|
-
|
|
54
|
-
**Success Response (200 OK):**
|
|
55
|
-
```typescript
|
|
56
|
-
{
|
|
57
|
-
success: true;
|
|
58
|
-
result: {
|
|
59
|
-
score: number; // Normalized score (0.0 to 1.0 typically)
|
|
60
|
-
maxScore: number; // Maximum possible score
|
|
61
|
-
completed: boolean; // Whether the response is complete
|
|
62
|
-
outcomeValues: { // Outcome variables (filtered for security)
|
|
63
|
-
SCORE: number;
|
|
64
|
-
MAXSCORE: number;
|
|
65
|
-
// Other outcomes based on item definition
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
sessionId?: string; // Echo back session ID if provided
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Example:**
|
|
73
|
-
```json
|
|
74
|
-
{
|
|
75
|
-
"success": true,
|
|
76
|
-
"result": {
|
|
77
|
-
"score": 1.0,
|
|
78
|
-
"maxScore": 1.0,
|
|
79
|
-
"completed": true,
|
|
80
|
-
"outcomeValues": {
|
|
81
|
-
"SCORE": 1.0,
|
|
82
|
-
"MAXSCORE": 1.0,
|
|
83
|
-
"completionStatus": "completed"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"sessionId": "sess_abc123"
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**Error Response (400/500):**
|
|
91
|
-
```typescript
|
|
92
|
-
{
|
|
93
|
-
error: string; // Human-readable error message
|
|
94
|
-
code?: string; // Optional error code for client handling
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### 2. Get Filtered Item Endpoint (Optional)
|
|
99
|
-
|
|
100
|
-
**Purpose**: Return the QTI item XML with correct answers and sensitive information filtered based on the candidate's QTI 2.2 standard role.
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
POST /api/qti/item/filter
|
|
104
|
-
Content-Type: application/json
|
|
105
|
-
Authorization: Bearer <token> (optional, recommended)
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
**Request Body:**
|
|
109
|
-
```typescript
|
|
110
|
-
{
|
|
111
|
-
itemXml: string; // The full QTI 2.2 XML
|
|
112
|
-
role: QTIRole; // 'candidate' | 'scorer' | 'author' | 'tutor' | 'proctor' | 'testConstructor'
|
|
113
|
-
sessionId?: string;
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**Response:**
|
|
118
|
-
```typescript
|
|
119
|
-
{
|
|
120
|
-
success: true;
|
|
121
|
-
filteredXml: string; // XML with correctResponse elements removed
|
|
122
|
-
rubrics: Array<{ // Rubrics visible to this role
|
|
123
|
-
html: string;
|
|
124
|
-
view: string[];
|
|
125
|
-
}>;
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### 3. Session Management Endpoints (Optional)
|
|
130
|
-
|
|
131
|
-
#### Save Session
|
|
132
|
-
```
|
|
133
|
-
POST /api/qti/session/save
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
**Request:**
|
|
137
|
-
```typescript
|
|
138
|
-
{
|
|
139
|
-
sessionId: string;
|
|
140
|
-
itemId: string;
|
|
141
|
-
candidateId: string;
|
|
142
|
-
responses: Record<string, any>;
|
|
143
|
-
sessionState: Record<string, any>;
|
|
144
|
-
timestamp: string;
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
#### Load Session
|
|
149
|
-
```
|
|
150
|
-
GET /api/qti/session/:sessionId
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**Response:**
|
|
154
|
-
```typescript
|
|
155
|
-
{
|
|
156
|
-
sessionId: string;
|
|
157
|
-
itemId: string;
|
|
158
|
-
responses: Record<string, any>;
|
|
159
|
-
sessionState: Record<string, any>;
|
|
160
|
-
lastModified: string;
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Security Considerations
|
|
165
|
-
|
|
166
|
-
### 1. Authentication & Authorization
|
|
167
|
-
|
|
168
|
-
**Recommended: Use JWT-based authentication**
|
|
169
|
-
|
|
170
|
-
```typescript
|
|
171
|
-
// Example middleware check
|
|
172
|
-
import jwt from 'jsonwebtoken';
|
|
173
|
-
|
|
174
|
-
async function authenticateRequest(request: Request): Promise<TokenPayload> {
|
|
175
|
-
const authHeader = request.headers.get('Authorization');
|
|
176
|
-
|
|
177
|
-
if (!authHeader?.startsWith('Bearer ')) {
|
|
178
|
-
throw new Error('Missing or invalid authorization header');
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const token = authHeader.substring(7);
|
|
182
|
-
const payload = jwt.verify(token, process.env.JWT_SECRET);
|
|
183
|
-
|
|
184
|
-
return payload as TokenPayload;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Use in endpoint
|
|
188
|
-
export async function POST({ request }: RequestEvent) {
|
|
189
|
-
const user = await authenticateRequest(request);
|
|
190
|
-
|
|
191
|
-
// Verify user has permission to submit for this item/session
|
|
192
|
-
if (!canAccessItem(user, itemId)) {
|
|
193
|
-
return json({ error: 'Unauthorized' }, { status: 403 });
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// Continue with scoring...
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### 2. Data Filtering
|
|
201
|
-
|
|
202
|
-
**Never send correct answers to the client for candidate role:**
|
|
203
|
-
|
|
204
|
-
```typescript
|
|
205
|
-
function filterItemXml(xml: string, role: QTIRole): string {
|
|
206
|
-
// Remove <correctResponse> elements for candidates
|
|
207
|
-
// QTI 2.2 role-based behavior: candidate role should not see correct answers
|
|
208
|
-
if (role === 'candidate') {
|
|
209
|
-
// Use XML parser to remove correctResponse nodes
|
|
210
|
-
return removeCorrectResponses(xml);
|
|
211
|
-
}
|
|
212
|
-
return xml;
|
|
213
|
-
}
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### 3. Rate Limiting
|
|
217
|
-
|
|
218
|
-
**Prevent abuse with rate limiting:**
|
|
219
|
-
|
|
220
|
-
```typescript
|
|
221
|
-
// Example using express-rate-limit or similar
|
|
222
|
-
import rateLimit from '@fastify/rate-limit';
|
|
223
|
-
|
|
224
|
-
const scoringLimiter = rateLimit({
|
|
225
|
-
max: 100, // 100 requests
|
|
226
|
-
timeWindow: '15 minutes', // per 15 minutes
|
|
227
|
-
cache: 10000, // keep 10k users in memory
|
|
228
|
-
});
|
|
229
|
-
|
|
230
|
-
// Apply to endpoint
|
|
231
|
-
app.post('/api/qti/score', { preHandler: scoringLimiter }, handler);
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### 4. Input Validation
|
|
235
|
-
|
|
236
|
-
**Always validate and sanitize inputs:**
|
|
237
|
-
|
|
238
|
-
```typescript
|
|
239
|
-
import { z } from 'zod';
|
|
240
|
-
|
|
241
|
-
const ScoringRequestSchema = z.object({
|
|
242
|
-
itemXml: z.string().min(1).max(1_000_000), // Limit XML size
|
|
243
|
-
responses: z.record(z.any()),
|
|
244
|
-
sessionId: z.string().uuid().optional(),
|
|
245
|
-
candidateId: z.string().optional(),
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
export async function POST({ request }: RequestEvent) {
|
|
249
|
-
const body = await request.json();
|
|
250
|
-
|
|
251
|
-
// Validate request
|
|
252
|
-
const validation = ScoringRequestSchema.safeParse(body);
|
|
253
|
-
if (!validation.success) {
|
|
254
|
-
return json({
|
|
255
|
-
error: 'Invalid request',
|
|
256
|
-
details: validation.error
|
|
257
|
-
}, { status: 400 });
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
const { itemXml, responses, sessionId } = validation.data;
|
|
261
|
-
// Continue...
|
|
262
|
-
}
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
### 5. Audit Logging
|
|
266
|
-
|
|
267
|
-
**Log all scoring requests for security and analytics:**
|
|
268
|
-
|
|
269
|
-
```typescript
|
|
270
|
-
interface AuditLog {
|
|
271
|
-
timestamp: string;
|
|
272
|
-
candidateId: string;
|
|
273
|
-
sessionId: string;
|
|
274
|
-
itemId: string;
|
|
275
|
-
responses: Record<string, any>;
|
|
276
|
-
score: number;
|
|
277
|
-
ipAddress: string;
|
|
278
|
-
userAgent: string;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
async function auditScoring(log: AuditLog): Promise<void> {
|
|
282
|
-
// Write to secure audit log
|
|
283
|
-
await db.auditLogs.insert(log);
|
|
284
|
-
}
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
## Example Implementation
|
|
288
|
-
|
|
289
|
-
Here's a complete example implementation using SvelteKit:
|
|
290
|
-
|
|
291
|
-
```typescript
|
|
292
|
-
// src/routes/api/qti/score/+server.ts
|
|
293
|
-
import { json, type RequestEvent } from '@sveltejs/kit';
|
|
294
|
-
import { Player } from '@pie-qti/item-player';
|
|
295
|
-
import { z } from 'zod';
|
|
296
|
-
import jwt from 'jsonwebtoken';
|
|
297
|
-
|
|
298
|
-
// Request validation schema
|
|
299
|
-
const ScoringRequestSchema = z.object({
|
|
300
|
-
itemXml: z.string().min(1).max(1_000_000),
|
|
301
|
-
responses: z.record(z.any()),
|
|
302
|
-
sessionId: z.string().optional(),
|
|
303
|
-
candidateId: z.string().optional(),
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
// Authenticate JWT token
|
|
307
|
-
async function authenticate(request: Request) {
|
|
308
|
-
const authHeader = request.headers.get('Authorization');
|
|
309
|
-
|
|
310
|
-
if (!authHeader?.startsWith('Bearer ')) {
|
|
311
|
-
throw new Error('Unauthorized');
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
const token = authHeader.substring(7);
|
|
315
|
-
const payload = jwt.verify(token, process.env.JWT_SECRET!);
|
|
316
|
-
|
|
317
|
-
return payload as { candidateId: string; role: string };
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export async function POST({ request, getClientAddress }: RequestEvent) {
|
|
321
|
-
try {
|
|
322
|
-
// 1. Authenticate (optional, but recommended)
|
|
323
|
-
let user;
|
|
324
|
-
try {
|
|
325
|
-
user = await authenticate(request);
|
|
326
|
-
} catch (err) {
|
|
327
|
-
// If JWT is not configured, allow anonymous for demo purposes
|
|
328
|
-
if (process.env.REQUIRE_AUTH === 'true') {
|
|
329
|
-
return json({ error: 'Unauthorized' }, { status: 401 });
|
|
330
|
-
}
|
|
331
|
-
user = { candidateId: 'anonymous', role: 'candidate' };
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
// 2. Parse and validate request
|
|
335
|
-
const body = await request.json();
|
|
336
|
-
const validation = ScoringRequestSchema.safeParse(body);
|
|
337
|
-
|
|
338
|
-
if (!validation.success) {
|
|
339
|
-
return json(
|
|
340
|
-
{ error: 'Invalid request', details: validation.error },
|
|
341
|
-
{ status: 400 }
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
const { itemXml, responses, sessionId, candidateId } = validation.data;
|
|
346
|
-
|
|
347
|
-
// 3. Verify authorization (optional)
|
|
348
|
-
if (candidateId && candidateId !== user.candidateId && user.role !== 'instructor') {
|
|
349
|
-
return json({ error: 'Forbidden' }, { status: 403 });
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// 4. Create player and score response
|
|
353
|
-
const player = new Player({
|
|
354
|
-
itemXml,
|
|
355
|
-
role: 'scorer', // Use scorer role to get accurate scoring
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
// Set responses
|
|
359
|
-
for (const [identifier, value] of Object.entries(responses)) {
|
|
360
|
-
player.setResponse(identifier, value);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
const scoringResult = player.processResponses();
|
|
364
|
-
|
|
365
|
-
// 5. Audit log (recommended)
|
|
366
|
-
await auditScoring({
|
|
367
|
-
timestamp: new Date().toISOString(),
|
|
368
|
-
candidateId: candidateId || user.candidateId,
|
|
369
|
-
sessionId: sessionId || '',
|
|
370
|
-
itemId: extractItemId(itemXml),
|
|
371
|
-
responses,
|
|
372
|
-
score: scoringResult.score,
|
|
373
|
-
ipAddress: getClientAddress(),
|
|
374
|
-
userAgent: request.headers.get('user-agent') || '',
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
// 6. Return filtered result (remove sensitive outcome values if needed)
|
|
378
|
-
return json({
|
|
379
|
-
success: true,
|
|
380
|
-
result: {
|
|
381
|
-
score: scoringResult.score,
|
|
382
|
-
maxScore: scoringResult.maxScore,
|
|
383
|
-
completed: scoringResult.completed,
|
|
384
|
-
outcomeValues: filterOutcomes(scoringResult.outcomeValues, user.role),
|
|
385
|
-
},
|
|
386
|
-
sessionId,
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
} catch (error: any) {
|
|
390
|
-
console.error('Scoring error:', error);
|
|
391
|
-
|
|
392
|
-
// Don't expose internal errors to client
|
|
393
|
-
return json(
|
|
394
|
-
{ error: 'Internal server error' },
|
|
395
|
-
{ status: 500 }
|
|
396
|
-
);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// Helper: Filter outcome values based on role
|
|
401
|
-
function filterOutcomes(
|
|
402
|
-
outcomes: Record<string, any>,
|
|
403
|
-
role: string
|
|
404
|
-
): Record<string, any> {
|
|
405
|
-
// Always include SCORE and MAXSCORE
|
|
406
|
-
const filtered: Record<string, any> = {
|
|
407
|
-
SCORE: outcomes.SCORE,
|
|
408
|
-
MAXSCORE: outcomes.MAXSCORE,
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
// Include completionStatus for all roles
|
|
412
|
-
if (outcomes.completionStatus) {
|
|
413
|
-
filtered.completionStatus = outcomes.completionStatus;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
// Privileged roles can see all outcomes (QTI 2.2 standard roles)
|
|
417
|
-
if (role === 'scorer' || role === 'author' || role === 'tutor' || role === 'testConstructor') {
|
|
418
|
-
return outcomes;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return filtered;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// Helper: Extract item identifier from XML
|
|
425
|
-
function extractItemId(xml: string): string {
|
|
426
|
-
const match = xml.match(/identifier="([^"]+)"/);
|
|
427
|
-
return match ? match[1] : 'unknown';
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// Helper: Audit logging
|
|
431
|
-
async function auditScoring(log: AuditLog): Promise<void> {
|
|
432
|
-
// Implement your audit logging here
|
|
433
|
-
// Examples: Write to database, send to logging service, etc.
|
|
434
|
-
console.log('Audit log:', log);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
interface AuditLog {
|
|
438
|
-
timestamp: string;
|
|
439
|
-
candidateId: string;
|
|
440
|
-
sessionId: string;
|
|
441
|
-
itemId: string;
|
|
442
|
-
responses: Record<string, any>;
|
|
443
|
-
score: number;
|
|
444
|
-
ipAddress: string;
|
|
445
|
-
userAgent: string;
|
|
446
|
-
}
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
## Configuration Options
|
|
450
|
-
|
|
451
|
-
### Client Configuration
|
|
452
|
-
|
|
453
|
-
The player can be configured to use backend scoring:
|
|
454
|
-
|
|
455
|
-
```typescript
|
|
456
|
-
// Configure player to use backend scoring
|
|
457
|
-
const config = {
|
|
458
|
-
useBackendScoring: true,
|
|
459
|
-
scoringEndpoint: '/api/qti/score', // Customizable endpoint
|
|
460
|
-
authToken: 'Bearer <your-jwt-token>', // Optional
|
|
461
|
-
};
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
### Environment Variables
|
|
465
|
-
|
|
466
|
-
```bash
|
|
467
|
-
# .env file
|
|
468
|
-
JWT_SECRET=your-secret-key-here
|
|
469
|
-
REQUIRE_AUTH=true
|
|
470
|
-
SCORING_RATE_LIMIT=100
|
|
471
|
-
AUDIT_LOG_ENABLED=true
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
## Client Integration
|
|
475
|
-
|
|
476
|
-
### Example: Using Backend Scoring in the Demo
|
|
477
|
-
|
|
478
|
-
```typescript
|
|
479
|
-
// In your Svelte component
|
|
480
|
-
async function submitAnswer() {
|
|
481
|
-
const response = await fetch('/api/qti/score', {
|
|
482
|
-
method: 'POST',
|
|
483
|
-
headers: {
|
|
484
|
-
'Content-Type': 'application/json',
|
|
485
|
-
'Authorization': `Bearer ${authToken}`, // If using JWT
|
|
486
|
-
},
|
|
487
|
-
body: JSON.stringify({
|
|
488
|
-
itemXml: currentItemXml,
|
|
489
|
-
responses: currentResponses,
|
|
490
|
-
sessionId: currentSessionId,
|
|
491
|
-
candidateId: currentUserId,
|
|
492
|
-
}),
|
|
493
|
-
});
|
|
494
|
-
|
|
495
|
-
if (!response.ok) {
|
|
496
|
-
throw new Error('Scoring failed');
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
const result = await response.json();
|
|
500
|
-
|
|
501
|
-
if (result.success) {
|
|
502
|
-
scoringResult = result.result;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
## Customization Guide
|
|
508
|
-
|
|
509
|
-
### Custom Endpoint Paths
|
|
510
|
-
|
|
511
|
-
You can customize the endpoint paths in your implementation:
|
|
512
|
-
|
|
513
|
-
```typescript
|
|
514
|
-
// Default: /api/qti/score
|
|
515
|
-
// Custom: /your-custom-path/score
|
|
516
|
-
|
|
517
|
-
// Update client configuration
|
|
518
|
-
const player = new Player({
|
|
519
|
-
// ... other config
|
|
520
|
-
scoringEndpoint: '/your-custom-path/score',
|
|
521
|
-
});
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
### Adding Custom Security Headers
|
|
525
|
-
|
|
526
|
-
```typescript
|
|
527
|
-
// Add CSRF protection
|
|
528
|
-
export async function POST({ request, cookies }: RequestEvent) {
|
|
529
|
-
const csrfToken = request.headers.get('X-CSRF-Token');
|
|
530
|
-
const storedToken = cookies.get('csrf-token');
|
|
531
|
-
|
|
532
|
-
if (csrfToken !== storedToken) {
|
|
533
|
-
return json({ error: 'Invalid CSRF token' }, { status: 403 });
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// Continue with scoring...
|
|
537
|
-
}
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
### Database Integration
|
|
541
|
-
|
|
542
|
-
```typescript
|
|
543
|
-
// Save responses to database before scoring
|
|
544
|
-
async function saveResponse(data: {
|
|
545
|
-
candidateId: string;
|
|
546
|
-
itemId: string;
|
|
547
|
-
responses: Record<string, any>;
|
|
548
|
-
sessionId: string;
|
|
549
|
-
}) {
|
|
550
|
-
await db.responses.create({
|
|
551
|
-
data: {
|
|
552
|
-
...data,
|
|
553
|
-
timestamp: new Date(),
|
|
554
|
-
},
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
```
|
|
558
|
-
|
|
559
|
-
## Testing
|
|
560
|
-
|
|
561
|
-
### Example Test Cases
|
|
562
|
-
|
|
563
|
-
```typescript
|
|
564
|
-
import { describe, it, expect } from 'vitest';
|
|
565
|
-
|
|
566
|
-
describe('Scoring API', () => {
|
|
567
|
-
it('should score correct response', async () => {
|
|
568
|
-
const response = await fetch('/api/qti/score', {
|
|
569
|
-
method: 'POST',
|
|
570
|
-
body: JSON.stringify({
|
|
571
|
-
itemXml: SAMPLE_ITEM_XML,
|
|
572
|
-
responses: { RESPONSE: 'ChoiceA' },
|
|
573
|
-
}),
|
|
574
|
-
});
|
|
575
|
-
|
|
576
|
-
const result = await response.json();
|
|
577
|
-
expect(result.success).toBe(true);
|
|
578
|
-
expect(result.result.score).toBe(1.0);
|
|
579
|
-
});
|
|
580
|
-
|
|
581
|
-
it('should require authentication when enabled', async () => {
|
|
582
|
-
const response = await fetch('/api/qti/score', {
|
|
583
|
-
method: 'POST',
|
|
584
|
-
body: JSON.stringify({
|
|
585
|
-
itemXml: SAMPLE_ITEM_XML,
|
|
586
|
-
responses: { RESPONSE: 'ChoiceA' },
|
|
587
|
-
}),
|
|
588
|
-
});
|
|
589
|
-
|
|
590
|
-
expect(response.status).toBe(401);
|
|
591
|
-
});
|
|
592
|
-
|
|
593
|
-
it('should validate request schema', async () => {
|
|
594
|
-
const response = await fetch('/api/qti/score', {
|
|
595
|
-
method: 'POST',
|
|
596
|
-
body: JSON.stringify({
|
|
597
|
-
// Missing itemXml
|
|
598
|
-
responses: { RESPONSE: 'ChoiceA' },
|
|
599
|
-
}),
|
|
600
|
-
});
|
|
601
|
-
|
|
602
|
-
expect(response.status).toBe(400);
|
|
603
|
-
});
|
|
604
|
-
});
|
|
605
|
-
```
|
|
606
|
-
|
|
607
|
-
## Performance Considerations
|
|
608
|
-
|
|
609
|
-
### Caching
|
|
610
|
-
|
|
611
|
-
For items that don't change frequently:
|
|
612
|
-
|
|
613
|
-
```typescript
|
|
614
|
-
import { LRUCache } from 'lru-cache';
|
|
615
|
-
|
|
616
|
-
const playerCache = new LRUCache<string, Player>({
|
|
617
|
-
max: 500, // Cache up to 500 parsed items
|
|
618
|
-
ttl: 1000 * 60 * 60, // 1 hour
|
|
619
|
-
});
|
|
620
|
-
|
|
621
|
-
// Use cached player instance
|
|
622
|
-
const cacheKey = hashItemXml(itemXml);
|
|
623
|
-
let player = playerCache.get(cacheKey);
|
|
624
|
-
|
|
625
|
-
if (!player) {
|
|
626
|
-
player = new Player({ itemXml, role: 'scorer' });
|
|
627
|
-
playerCache.set(cacheKey, player);
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
// Set responses and score
|
|
631
|
-
for (const [identifier, value] of Object.entries(responses)) {
|
|
632
|
-
player.setResponse(identifier, value);
|
|
633
|
-
}
|
|
634
|
-
const result = player.processResponses();
|
|
635
|
-
```
|
|
636
|
-
|
|
637
|
-
### Connection Pooling
|
|
638
|
-
|
|
639
|
-
For database operations, use connection pooling to improve performance.
|
|
640
|
-
|
|
641
|
-
## Compliance & Privacy
|
|
642
|
-
|
|
643
|
-
### GDPR Considerations
|
|
644
|
-
|
|
645
|
-
When implementing scoring APIs in production:
|
|
646
|
-
|
|
647
|
-
1. **Data Minimization** - Only store necessary response data
|
|
648
|
-
2. **Right to Erasure** - Implement endpoints to delete candidate data
|
|
649
|
-
3. **Data Portability** - Allow candidates to export their response data
|
|
650
|
-
4. **Audit Trail** - Log all data access for compliance
|
|
651
|
-
|
|
652
|
-
### Example: Data Deletion Endpoint
|
|
653
|
-
|
|
654
|
-
```typescript
|
|
655
|
-
export async function DELETE({ request, params }: RequestEvent) {
|
|
656
|
-
const { candidateId } = params;
|
|
657
|
-
const user = await authenticate(request);
|
|
658
|
-
|
|
659
|
-
// Verify authorization
|
|
660
|
-
if (user.candidateId !== candidateId && user.role !== 'admin') {
|
|
661
|
-
return json({ error: 'Forbidden' }, { status: 403 });
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
// Delete all candidate data
|
|
665
|
-
await db.responses.deleteMany({ where: { candidateId } });
|
|
666
|
-
await db.sessions.deleteMany({ where: { candidateId } });
|
|
667
|
-
await db.auditLogs.deleteMany({ where: { candidateId } });
|
|
668
|
-
|
|
669
|
-
return json({ success: true });
|
|
670
|
-
}
|
|
671
|
-
```
|
|
672
|
-
|
|
673
|
-
## Support & Documentation
|
|
674
|
-
|
|
675
|
-
For questions or issues with backend scoring integration:
|
|
676
|
-
|
|
677
|
-
- **Documentation**: See the main PIE QTI 2.2 Player README
|
|
678
|
-
- **GitHub Issues**: https://github.com/pie-framework/pie-transform/issues
|
|
679
|
-
- **Examples**: See the `example` package for working implementations
|
|
680
|
-
|
|
681
|
-
## Summary
|
|
682
|
-
|
|
683
|
-
This API contract provides a secure foundation for server-side scoring with the PIE QTI 2.2 Player. Key features:
|
|
684
|
-
|
|
685
|
-
- ✅ **Security**: JWT authentication, input validation, rate limiting
|
|
686
|
-
- ✅ **Flexibility**: Customizable endpoints, middleware, and security policies
|
|
687
|
-
- ✅ **Privacy**: Data filtering, audit logging, GDPR compliance
|
|
688
|
-
- ✅ **Performance**: Caching strategies, connection pooling
|
|
689
|
-
- ✅ **Testing**: Example test cases and validation
|
|
690
|
-
|
|
691
|
-
You have full control over authentication, authorization, and data handling, allowing you to integrate the player into your existing security infrastructure.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Fixture sourcing & licensing policy
|
|
2
|
-
|
|
3
|
-
This conformance suite is intended to be **redistributable** with this repository.
|
|
4
|
-
|
|
5
|
-
## What we will include in-repo
|
|
6
|
-
- **Minimal, purpose-built QTI XML** authored by us to exercise specific features/operators.
|
|
7
|
-
- **Upstream fixtures only when**:
|
|
8
|
-
- the upstream repository explicitly permits redistribution (e.g., MIT/Apache-2.0/BSD), and
|
|
9
|
-
- we record provenance in `manifest.json`.
|
|
10
|
-
|
|
11
|
-
## What we will NOT include in-repo
|
|
12
|
-
- Vendor content packages or item banks without explicit redistribution rights.
|
|
13
|
-
- 1EdTech/IMS certification test packages or other member-only assets.
|
|
14
|
-
- Anything with unclear or missing licensing.
|
|
15
|
-
|
|
16
|
-
## Required metadata for any non-trivial fixture
|
|
17
|
-
Add `manifest.json` with:
|
|
18
|
-
- `source` (project name or “internal”)
|
|
19
|
-
- `upstreamUrl` (if applicable)
|
|
20
|
-
- `license` (SPDX identifier if known)
|
|
21
|
-
- `notes` (what QTI feature/operator/bug it covers)
|
|
22
|
-
|
|
23
|
-
## Review checklist for new fixtures
|
|
24
|
-
- Is licensing clear and compatible?
|
|
25
|
-
- Is the fixture minimal (no extra interactions/assets)?
|
|
26
|
-
- Does `cases.json` assert only what matters (avoid brittle assertions)?
|
|
27
|
-
- Does it have deterministic behavior (seed where needed)?
|
|
28
|
-
|
|
29
|
-
|