@citolab/qti-components 7.0.5 → 7.0.6-next.1
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/cdn/chunk-2F5323DC.js +8 -0
- package/cdn/chunk-2WPNLHGH.js +43 -0
- package/cdn/chunk-3M77CJJH.js +8 -0
- package/cdn/chunk-4DFVJE2A.js +48 -0
- package/cdn/chunk-4HKDXRGE.js +5 -0
- package/cdn/chunk-5WCOPF7O.js +73 -0
- package/cdn/chunk-D4K2EXYX.js +8 -0
- package/cdn/chunk-II7AGB2E.js +11 -0
- package/cdn/chunk-KUOLGIA5.js +1 -0
- package/cdn/chunk-KXRA4DBZ.js +8 -0
- package/cdn/chunk-L4TDHAKL.js +24 -0
- package/cdn/chunk-LY27H7YF.js +1 -0
- package/cdn/chunk-M6AATWPS.js +59 -0
- package/cdn/{chunks/chunk-UIEC4LXR.js → chunk-MFWSHIPH.js} +1 -1
- package/cdn/chunk-NAARXANC.js +11 -0
- package/cdn/chunk-OEBYNBRS.js +129 -0
- package/cdn/chunk-RBATSYIS.js +43 -0
- package/cdn/chunk-RM352RXQ.js +5 -0
- package/cdn/{chunks/chunk-CFXQCNG6.js → chunk-SQDSHH6N.js} +18 -2
- package/cdn/chunk-V2RMP73O.js +1 -0
- package/cdn/chunk-WI7KK7NI.js +8 -0
- package/cdn/chunk-YHB534QY.js +8 -0
- package/cdn/chunk-YXST4IEX.js +5 -0
- package/cdn/qti-components/index.js +131 -116
- package/cdn/qti-item/core/index.global.js +149 -0
- package/cdn/qti-item/core/index.js +5 -0
- package/cdn/qti-loader/index.js +1 -23
- package/cdn/qti-test/components/index.global.js +1 -36
- package/cdn/qti-test/components/index.js +1 -3598
- package/cdn/qti-test/components/styles.js +1 -17
- package/cdn/qti-test/components/test-component.abstract.js +1 -1
- package/cdn/qti-test/components/test-item-link.js +1 -24
- package/cdn/qti-test/components/test-next.js +1 -24
- package/cdn/qti-test/components/test-next.spec.global.js +25 -60
- package/cdn/qti-test/components/test-next.spec.js +247 -4749
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -3
- package/cdn/qti-test/components/test-prev.js +1 -24
- package/cdn/qti-test/components/test-view.js +1 -11
- package/cdn/qti-test/core/index.global.js +205 -0
- package/cdn/qti-test/core/index.js +1 -0
- package/cdn/qti-transformers/index.js +1 -23
- package/dist/{chunks/chunk-Y6UWSECL.js → chunk-2CHF3TMY.js} +2 -2
- package/dist/chunk-2CHF3TMY.js.map +1 -0
- package/dist/{chunks/chunk-ZEFOMZNY.js → chunk-2GKDJDI5.js} +3 -3
- package/dist/chunk-2GKDJDI5.js.map +1 -0
- package/dist/{chunks/chunk-XDMSEAYC.js → chunk-2OA7E3E7.js} +1 -1
- package/dist/chunk-2OA7E3E7.js.map +1 -0
- package/dist/{chunks/chunk-PUBGXXTM.js → chunk-3F3DCHHM.js} +4 -4
- package/dist/chunk-3F3DCHHM.js.map +1 -0
- package/dist/{chunks/chunk-6YE2KJ4C.js → chunk-44VE5POH.js} +1 -1
- package/dist/{chunks/chunk-D3RGDWKP.js → chunk-4CSM2PCC.js} +1 -1
- package/dist/chunk-4CSM2PCC.js.map +1 -0
- package/dist/{chunks/chunk-ELDMXTUQ.js → chunk-4YG2FPKK.js} +1 -1
- package/dist/chunk-4YG2FPKK.js.map +1 -0
- package/dist/{chunks/chunk-W4B23OIP.js → chunk-4YR7ZPE3.js} +4 -4
- package/dist/chunk-4YR7ZPE3.js.map +1 -0
- package/dist/{chunks/chunk-XDFXD3BI.js → chunk-E3656TSN.js} +2 -2
- package/dist/chunk-E3656TSN.js.map +1 -0
- package/dist/{chunks/chunk-HWA4A3SR.js → chunk-ERLGA6TC.js} +4 -4
- package/dist/chunk-ERLGA6TC.js.map +1 -0
- package/dist/{chunks/chunk-3ROZMGAN.js → chunk-EXJQ3ZUE.js} +4 -4
- package/dist/chunk-EXJQ3ZUE.js.map +1 -0
- package/dist/chunk-KI3A6ZT6.js +50 -0
- package/dist/chunk-KI3A6ZT6.js.map +1 -0
- package/dist/{chunks/chunk-LKINC6JO.js → chunk-KVFH5VBC.js} +6 -6
- package/dist/chunk-KVFH5VBC.js.map +1 -0
- package/dist/chunk-LJU3MHXE.js +43 -0
- package/dist/chunk-LJU3MHXE.js.map +1 -0
- package/dist/chunk-MAC76UNI.js +1 -0
- package/dist/chunk-NUXEGEMP.js +65 -0
- package/dist/chunk-NUXEGEMP.js.map +1 -0
- package/dist/chunk-O3GIZH57.js +121 -0
- package/dist/chunk-O3GIZH57.js.map +1 -0
- package/dist/{qti-test/qti-test.js → chunk-QNR4WQAC.js} +307 -239
- package/dist/chunk-QNR4WQAC.js.map +1 -0
- package/dist/chunk-SLMQZKDH.js +568 -0
- package/dist/chunk-SLMQZKDH.js.map +1 -0
- package/dist/chunk-TAQAVEQ2.js +72 -0
- package/dist/chunk-TAQAVEQ2.js.map +1 -0
- package/dist/chunk-TLPISJ3Z.js +78 -0
- package/dist/chunk-TLPISJ3Z.js.map +1 -0
- package/dist/{chunks/chunk-4O5F7WV7.js → chunk-UB5K44DB.js} +1 -1
- package/dist/chunk-UB5K44DB.js.map +1 -0
- package/dist/chunk-UDWEOEOS.js +50 -0
- package/dist/chunk-UDWEOEOS.js.map +1 -0
- package/dist/qti-components/index.d.ts +2 -2
- package/dist/qti-components/index.js +12 -285
- package/dist/qti-components/index.js.map +1 -1
- package/dist/qti-components-jsx.d.ts +83 -83
- package/dist/qti-item/{components/item-container.d.ts → core/index.d.ts} +22 -1
- package/dist/{chunks/chunk-LROTNPC2.js → qti-item/core/index.js} +20 -9
- package/dist/qti-item/core/index.js.map +1 -0
- package/dist/qti-loader/index.d.ts +1 -1
- package/dist/qti-loader/index.js +6 -287
- package/dist/qti-loader/index.js.map +1 -1
- package/dist/{qti-simple-choice-DxWcdKHi.d.ts → qti-simple-choice-DB7hqAMS.d.ts} +1 -1
- package/dist/qti-test/components/index.d.ts +2 -4
- package/dist/qti-test/components/index.js +24 -4135
- package/dist/qti-test/components/index.js.map +1 -1
- package/dist/qti-test/components/styles.js +7 -22
- package/dist/qti-test/components/styles.js.map +1 -1
- package/dist/qti-test/components/test-component.abstract.d.ts +2 -3
- package/dist/qti-test/components/test-component.abstract.js +7 -145
- package/dist/qti-test/components/test-component.abstract.js.map +1 -1
- package/dist/qti-test/components/test-item-link.d.ts +2 -3
- package/dist/qti-test/components/test-item-link.js +9 -198
- package/dist/qti-test/components/test-item-link.js.map +1 -1
- package/dist/qti-test/components/test-next.d.ts +2 -3
- package/dist/qti-test/components/test-next.js +9 -205
- package/dist/qti-test/components/test-next.js.map +1 -1
- package/dist/qti-test/components/test-next.spec.d.ts +3 -7
- package/dist/qti-test/components/test-next.spec.js +140 -11152
- package/dist/qti-test/components/test-next.spec.js.map +1 -1
- package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +2 -3
- package/dist/qti-test/components/test-paging-buttons-stamp.js +8 -214
- package/dist/qti-test/components/test-paging-buttons-stamp.js.map +1 -1
- package/dist/qti-test/components/test-prev.d.ts +2 -3
- package/dist/qti-test/components/test-prev.js +9 -205
- package/dist/qti-test/components/test-prev.js.map +1 -1
- package/dist/qti-test/components/test-view.d.ts +2 -3
- package/dist/qti-test/components/test-view.js +8 -205
- package/dist/qti-test/components/test-view.js.map +1 -1
- package/dist/qti-test/core/index.d.ts +121 -0
- package/dist/qti-test/core/index.js +25 -0
- package/dist/qti-transformers/index.js +6 -287
- package/dist/qti-transformers/index.js.map +1 -1
- package/dist/test-component.abstract-DWJ0XNiI.d.ts +108 -0
- package/dist/{index-Cvrd4KQA.d.ts → test.context-DKSpQHyg.d.ts} +40 -56
- package/dist/{test-base-BJwG9Ie8.d.ts → test.context-K2w-1mWi.d.ts} +19 -29
- package/dist/vscode.html-custom-data.json +21 -21
- package/package.json +70 -75
- package/cdn/chunks/chunk-4UJBK6JO.js +0 -1
- package/cdn/chunks/chunk-5O3Z7TDV.js +0 -1
- package/cdn/chunks/chunk-65LFT33L.js +0 -8
- package/cdn/chunks/chunk-6D25UFJR.js +0 -8
- package/cdn/chunks/chunk-6UGPNL7M.js +0 -1
- package/cdn/chunks/chunk-CSUKVUZF.js +0 -3
- package/cdn/chunks/chunk-CSY3WI5A.js +0 -1
- package/cdn/chunks/chunk-DAZR7RUI.js +0 -0
- package/cdn/chunks/chunk-EOPEMJS3.js +0 -0
- package/cdn/chunks/chunk-G5O7EN45.js +0 -5
- package/cdn/chunks/chunk-GEFUIFM7.js +0 -0
- package/cdn/chunks/chunk-JLNHEMQG.js +0 -1
- package/cdn/chunks/chunk-LPWIM7QJ.js +0 -902
- package/cdn/chunks/chunk-M3YRM3AV.js +0 -1
- package/cdn/chunks/chunk-M6BOWL2U.js +0 -1
- package/cdn/chunks/chunk-P5IE36FO.js +0 -8
- package/cdn/chunks/chunk-PXH5KN5O.js +0 -1
- package/cdn/chunks/chunk-RBEI6NIF.js +0 -1
- package/cdn/chunks/chunk-SMKIYFFI.js +0 -1
- package/cdn/chunks/chunk-SRLMW23F.js +0 -0
- package/cdn/chunks/chunk-T3YDLD2H.js +0 -11
- package/cdn/chunks/chunk-T6IXJ4W4.js +0 -1
- package/cdn/chunks/chunk-TFAUBGP2.js +0 -0
- package/cdn/chunks/chunk-V44O3GTW.js +0 -0
- package/cdn/chunks/chunk-V6B54FQW.js +0 -5
- package/cdn/chunks/chunk-V6KX6BQN.js +0 -1
- package/cdn/chunks/chunk-VYANBI35.js +0 -1
- package/cdn/chunks/chunk-XUJ7TXHW.js +0 -1
- package/cdn/chunks/chunk-ZIZLFFSG.js +0 -0
- package/cdn/index.css +0 -1
- package/cdn/index.global.js +0 -277
- package/cdn/index.js +0 -4503
- package/cdn/qti-item/components/index.css +0 -1
- package/cdn/qti-item/components/index.global.js +0 -149
- package/cdn/qti-item/components/index.js +0 -3549
- package/cdn/qti-item/components/item-container.css +0 -1
- package/cdn/qti-item/components/item-container.global.js +0 -149
- package/cdn/qti-item/components/item-container.js +0 -3549
- package/cdn/qti-item/index.css +0 -1
- package/cdn/qti-item/index.global.js +0 -149
- package/cdn/qti-item/index.js +0 -3549
- package/cdn/qti-item/qti-item.global.js +0 -114
- package/cdn/qti-item/qti-item.js +0 -1
- package/cdn/qti-test/components/index.css +0 -1
- package/cdn/qti-test/components/test-container.css +0 -1
- package/cdn/qti-test/components/test-container.global.js +0 -149
- package/cdn/qti-test/components/test-container.js +0 -3549
- package/cdn/qti-test/components/test-next.spec.css +0 -1
- package/cdn/qti-test/context/index.global.js +0 -58
- package/cdn/qti-test/context/index.js +0 -1
- package/cdn/qti-test/context/test.context.global.js +0 -58
- package/cdn/qti-test/context/test.context.js +0 -1
- package/cdn/qti-test/index.css +0 -1
- package/cdn/qti-test/index.global.js +0 -242
- package/cdn/qti-test/index.js +0 -3598
- package/cdn/qti-test/mixins/index.global.js +0 -1
- package/cdn/qti-test/mixins/index.js +0 -23
- package/cdn/qti-test/mixins/test-loader.mixin.global.js +0 -1
- package/cdn/qti-test/mixins/test-loader.mixin.js +0 -23
- package/cdn/qti-test/mixins/test-navigation.mixin.global.js +0 -1
- package/cdn/qti-test/mixins/test-navigation.mixin.js +0 -1
- package/cdn/qti-test/mixins/test-view.mixin.global.js +0 -1
- package/cdn/qti-test/mixins/test-view.mixin.js +0 -1
- package/cdn/qti-test/qti-assessment-test/index.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/index.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-assessment-section.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/qti-assessment-section.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-assessment-test.global.js +0 -170
- package/cdn/qti-test/qti-assessment-test/qti-assessment-test.js +0 -1
- package/cdn/qti-test/qti-assessment-test/qti-test-part.global.js +0 -114
- package/cdn/qti-test/qti-assessment-test/qti-test-part.js +0 -1
- package/cdn/qti-test/qti-test.global.js +0 -170
- package/cdn/qti-test/qti-test.js +0 -23
- package/cdn/qti-test/test-base.global.js +0 -170
- package/cdn/qti-test/test-base.js +0 -1
- package/dist/chunks/chunk-3G2DDBJW.js +0 -44
- package/dist/chunks/chunk-3G2DDBJW.js.map +0 -1
- package/dist/chunks/chunk-3NLCJYSX.js +0 -1
- package/dist/chunks/chunk-3OXGDCSU.js +0 -6253
- package/dist/chunks/chunk-3OXGDCSU.js.map +0 -1
- package/dist/chunks/chunk-3ROZMGAN.js.map +0 -1
- package/dist/chunks/chunk-4O5F7WV7.js.map +0 -1
- package/dist/chunks/chunk-AAQCM2FP.js +0 -56
- package/dist/chunks/chunk-AAQCM2FP.js.map +0 -1
- package/dist/chunks/chunk-D3RGDWKP.js.map +0 -1
- package/dist/chunks/chunk-DJLE6EV2.js +0 -36
- package/dist/chunks/chunk-DJLE6EV2.js.map +0 -1
- package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
- package/dist/chunks/chunk-EW5CTHAD.js +0 -1
- package/dist/chunks/chunk-HWA4A3SR.js.map +0 -1
- package/dist/chunks/chunk-IKZWK2C5.js +0 -1
- package/dist/chunks/chunk-IKZWK2C5.js.map +0 -1
- package/dist/chunks/chunk-IP7JSYO6.js +0 -1
- package/dist/chunks/chunk-IP7JSYO6.js.map +0 -1
- package/dist/chunks/chunk-JE6BMXZU.js +0 -94
- package/dist/chunks/chunk-JE6BMXZU.js.map +0 -1
- package/dist/chunks/chunk-JSPJGWGT.js +0 -20
- package/dist/chunks/chunk-JSPJGWGT.js.map +0 -1
- package/dist/chunks/chunk-LKINC6JO.js.map +0 -1
- package/dist/chunks/chunk-LROTNPC2.js.map +0 -1
- package/dist/chunks/chunk-MTMT2RMF.js +0 -63
- package/dist/chunks/chunk-MTMT2RMF.js.map +0 -1
- package/dist/chunks/chunk-NDJZGJUR.js +0 -65
- package/dist/chunks/chunk-NDJZGJUR.js.map +0 -1
- package/dist/chunks/chunk-OE2LFIH2.js +0 -1
- package/dist/chunks/chunk-OE2LFIH2.js.map +0 -1
- package/dist/chunks/chunk-OJ2XGDWK.js +0 -1
- package/dist/chunks/chunk-OJ2XGDWK.js.map +0 -1
- package/dist/chunks/chunk-PUBGXXTM.js.map +0 -1
- package/dist/chunks/chunk-QRCUNRP5.js +0 -75
- package/dist/chunks/chunk-QRCUNRP5.js.map +0 -1
- package/dist/chunks/chunk-S6JJYCO7.js +0 -51
- package/dist/chunks/chunk-S6JJYCO7.js.map +0 -1
- package/dist/chunks/chunk-U3AALKEP.js +0 -1
- package/dist/chunks/chunk-U3AALKEP.js.map +0 -1
- package/dist/chunks/chunk-UCQFSRYF.js +0 -34
- package/dist/chunks/chunk-UCQFSRYF.js.map +0 -1
- package/dist/chunks/chunk-URGVQ64M.js +0 -1
- package/dist/chunks/chunk-URGVQ64M.js.map +0 -1
- package/dist/chunks/chunk-V4FXK4TP.js +0 -128
- package/dist/chunks/chunk-V4FXK4TP.js.map +0 -1
- package/dist/chunks/chunk-W4B23OIP.js.map +0 -1
- package/dist/chunks/chunk-XDFXD3BI.js.map +0 -1
- package/dist/chunks/chunk-XDMSEAYC.js.map +0 -1
- package/dist/chunks/chunk-XPDS72XY.js +0 -29
- package/dist/chunks/chunk-XPDS72XY.js.map +0 -1
- package/dist/chunks/chunk-Y6UWSECL.js.map +0 -1
- package/dist/chunks/chunk-ZEFOMZNY.js.map +0 -1
- package/dist/index.d.ts +0 -19
- package/dist/index.js +0 -11153
- package/dist/index.js.map +0 -1
- package/dist/qti-item/components/index.d.ts +0 -3
- package/dist/qti-item/components/index.js +0 -3856
- package/dist/qti-item/components/index.js.map +0 -1
- package/dist/qti-item/components/item-container.js +0 -3856
- package/dist/qti-item/components/item-container.js.map +0 -1
- package/dist/qti-item/index.d.ts +0 -4
- package/dist/qti-item/index.js +0 -3869
- package/dist/qti-item/index.js.map +0 -1
- package/dist/qti-item/qti-item.d.ts +0 -25
- package/dist/qti-item/qti-item.js +0 -26
- package/dist/qti-item/qti-item.js.map +0 -1
- package/dist/qti-test/components/test-container.d.ts +0 -37
- package/dist/qti-test/components/test-container.js +0 -3782
- package/dist/qti-test/components/test-container.js.map +0 -1
- package/dist/qti-test/context/index.d.ts +0 -6
- package/dist/qti-test/context/index.js +0 -9
- package/dist/qti-test/context/index.js.map +0 -1
- package/dist/qti-test/context/test.context.d.ts +0 -6
- package/dist/qti-test/context/test.context.js +0 -9
- package/dist/qti-test/context/test.context.js.map +0 -1
- package/dist/qti-test/index.d.ts +0 -14
- package/dist/qti-test/index.js +0 -4746
- package/dist/qti-test/index.js.map +0 -1
- package/dist/qti-test/mixins/index.d.ts +0 -8
- package/dist/qti-test/mixins/index.js +0 -350
- package/dist/qti-test/mixins/index.js.map +0 -1
- package/dist/qti-test/mixins/test-loader.mixin.d.ts +0 -8
- package/dist/qti-test/mixins/test-loader.mixin.js +0 -240
- package/dist/qti-test/mixins/test-loader.mixin.js.map +0 -1
- package/dist/qti-test/mixins/test-navigation.mixin.d.ts +0 -22
- package/dist/qti-test/mixins/test-navigation.mixin.js +0 -64
- package/dist/qti-test/mixins/test-navigation.mixin.js.map +0 -1
- package/dist/qti-test/mixins/test-view.mixin.d.ts +0 -6
- package/dist/qti-test/mixins/test-view.mixin.js +0 -50
- package/dist/qti-test/mixins/test-view.mixin.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/index.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/index.js +0 -221
- package/dist/qti-test/qti-assessment-test/index.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js +0 -85
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.js +0 -73
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.d.ts +0 -6
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.js +0 -54
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.js.map +0 -1
- package/dist/qti-test/qti-assessment-test/qti-test-part.d.ts +0 -19
- package/dist/qti-test/qti-assessment-test/qti-test-part.js +0 -62
- package/dist/qti-test/qti-assessment-test/qti-test-part.js.map +0 -1
- package/dist/qti-test/qti-test.d.ts +0 -68
- package/dist/qti-test/qti-test.js.map +0 -1
- package/dist/qti-test/test-base.d.ts +0 -6
- package/dist/qti-test/test-base.js +0 -137
- package/dist/qti-test/test-base.js.map +0 -1
- /package/cdn/{chunks/chunk-6DMSHH5X.js → chunk-22HAPLRD.js} +0 -0
- /package/cdn/{chunks/chunk-EHK76KRT.js → chunk-GPDDPZFH.js} +0 -0
- /package/cdn/{chunks/chunk-5FCXUJAG.js → chunk-LVW3MHTI.js} +0 -0
- /package/cdn/{chunks/chunk-T4HD2C4F.js → chunk-VI2WKTN4.js} +0 -0
- /package/dist/{chunks/chunk-3NLCJYSX.js.map → chunk-44VE5POH.js.map} +0 -0
- /package/dist/{chunks/chunk-6YE2KJ4C.js.map → chunk-MAC76UNI.js.map} +0 -0
- /package/dist/{chunks/chunk-EW5CTHAD.js.map → qti-test/core/index.js.map} +0 -0
|
@@ -989,8 +989,6 @@ export type TestElementProps = {
|
|
|
989
989
|
"onqti-interaction-response"?: (e: CustomEvent<CustomEvent>) => void;
|
|
990
990
|
};
|
|
991
991
|
|
|
992
|
-
export type QtiItemProps = {};
|
|
993
|
-
|
|
994
992
|
export type ItemContainerProps = {
|
|
995
993
|
/** URL of the item to load */
|
|
996
994
|
"item-url"?: string;
|
|
@@ -1000,6 +998,8 @@ export type ItemContainerProps = {
|
|
|
1000
998
|
itemXML?: string;
|
|
1001
999
|
};
|
|
1002
1000
|
|
|
1001
|
+
export type QtiItemProps = {};
|
|
1002
|
+
|
|
1003
1003
|
export type QtiAssessmentItemRefProps = {
|
|
1004
1004
|
/** */
|
|
1005
1005
|
category?: string | undefined;
|
|
@@ -1069,11 +1069,6 @@ export type QtiTestPartProps = {
|
|
|
1069
1069
|
"onqti-test-part-connected"?: (e: CustomEvent<Event>) => void;
|
|
1070
1070
|
};
|
|
1071
1071
|
|
|
1072
|
-
export type QtiTestProps = {
|
|
1073
|
-
/** */
|
|
1074
|
-
context?: TestContext;
|
|
1075
|
-
};
|
|
1076
|
-
|
|
1077
1072
|
export type TestNextProps = {
|
|
1078
1073
|
/** */
|
|
1079
1074
|
role?: string;
|
|
@@ -1124,15 +1119,6 @@ export type TestItemLinkProps = {
|
|
|
1124
1119
|
"onqti-request-test-item"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1125
1120
|
};
|
|
1126
1121
|
|
|
1127
|
-
export type TestContainerProps = {
|
|
1128
|
-
/** URL of the item to load */
|
|
1129
|
-
"test-url"?: string;
|
|
1130
|
-
/** A parsed HTML document */
|
|
1131
|
-
testDoc?: DocumentFragment;
|
|
1132
|
-
/** The raw XML string */
|
|
1133
|
-
testXML?: string;
|
|
1134
|
-
};
|
|
1135
|
-
|
|
1136
1122
|
export type TestPagingButtonsStampProps = {
|
|
1137
1123
|
/** */
|
|
1138
1124
|
"max-displayed-items"?: number;
|
|
@@ -1148,6 +1134,20 @@ export type TestPagingButtonsStampProps = {
|
|
|
1148
1134
|
"onqti-request-test-item"?: (e: CustomEvent<CustomEvent>) => void;
|
|
1149
1135
|
};
|
|
1150
1136
|
|
|
1137
|
+
export type QtiTestProps = {
|
|
1138
|
+
/** */
|
|
1139
|
+
context?: TestContext;
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
export type TestContainerProps = {
|
|
1143
|
+
/** URL of the item to load */
|
|
1144
|
+
"test-url"?: string;
|
|
1145
|
+
/** A parsed HTML document */
|
|
1146
|
+
testDoc?: DocumentFragment;
|
|
1147
|
+
/** The raw XML string */
|
|
1148
|
+
testXML?: string;
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
1151
|
export type CustomElements = {
|
|
1152
1152
|
/**
|
|
1153
1153
|
*
|
|
@@ -1923,10 +1923,12 @@ export type CustomElements = {
|
|
|
1923
1923
|
"test-element": Partial<TestElementProps & BaseProps & BaseEvents>;
|
|
1924
1924
|
|
|
1925
1925
|
/**
|
|
1926
|
-
* `<
|
|
1927
|
-
*
|
|
1928
|
-
*
|
|
1929
|
-
*
|
|
1926
|
+
* `<item-container>` is a custom element designed for hosting the qti-assessment-item.
|
|
1927
|
+
* The `qti-assessment-item` will be placed inside the shadow DOM of this element.
|
|
1928
|
+
* The element loads the item from the provided URL and renders it inside the shadow DOM.
|
|
1929
|
+
*
|
|
1930
|
+
* ### Styling
|
|
1931
|
+
* Add a class to the element for styling.
|
|
1930
1932
|
*
|
|
1931
1933
|
* ```html
|
|
1932
1934
|
* <qti-item>
|
|
@@ -1936,15 +1938,13 @@ export type CustomElements = {
|
|
|
1936
1938
|
* ---
|
|
1937
1939
|
*
|
|
1938
1940
|
*/
|
|
1939
|
-
"
|
|
1941
|
+
"item-container": Partial<ItemContainerProps & BaseProps & BaseEvents>;
|
|
1940
1942
|
|
|
1941
1943
|
/**
|
|
1942
|
-
* `<item
|
|
1943
|
-
*
|
|
1944
|
-
*
|
|
1945
|
-
*
|
|
1946
|
-
* ### Styling
|
|
1947
|
-
* Add a class to the element for styling.
|
|
1944
|
+
* `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.
|
|
1945
|
+
* It can also host some functionalities to interact with the item like scoring, showing feedback, etc.
|
|
1946
|
+
* Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.
|
|
1947
|
+
* See `<item-container>` for more details.
|
|
1948
1948
|
*
|
|
1949
1949
|
* ```html
|
|
1950
1950
|
* <qti-item>
|
|
@@ -1954,7 +1954,7 @@ export type CustomElements = {
|
|
|
1954
1954
|
* ---
|
|
1955
1955
|
*
|
|
1956
1956
|
*/
|
|
1957
|
-
"item
|
|
1957
|
+
"qti-item": Partial<QtiItemProps & BaseProps & BaseEvents>;
|
|
1958
1958
|
|
|
1959
1959
|
/**
|
|
1960
1960
|
*
|
|
@@ -1996,6 +1996,61 @@ export type CustomElements = {
|
|
|
1996
1996
|
*/
|
|
1997
1997
|
"qti-test-part": Partial<QtiTestPartProps & BaseProps & BaseEvents>;
|
|
1998
1998
|
|
|
1999
|
+
/**
|
|
2000
|
+
* Represents a custom element for navigating to the next test item.
|
|
2001
|
+
* ---
|
|
2002
|
+
*
|
|
2003
|
+
*
|
|
2004
|
+
* ### **Events:**
|
|
2005
|
+
* - **on-test-switch-view**
|
|
2006
|
+
* - **qti-request-test-item**
|
|
2007
|
+
*/
|
|
2008
|
+
"test-next": Partial<TestNextProps & BaseProps & BaseEvents>;
|
|
2009
|
+
|
|
2010
|
+
/**
|
|
2011
|
+
* Represents a custom element for navigating to the previous test item.
|
|
2012
|
+
* ---
|
|
2013
|
+
*
|
|
2014
|
+
*
|
|
2015
|
+
* ### **Events:**
|
|
2016
|
+
* - **on-test-switch-view**
|
|
2017
|
+
* - **qti-request-test-item**
|
|
2018
|
+
*/
|
|
2019
|
+
"test-prev": Partial<TestPrevProps & BaseProps & BaseEvents>;
|
|
2020
|
+
|
|
2021
|
+
/**
|
|
2022
|
+
*
|
|
2023
|
+
* ---
|
|
2024
|
+
*
|
|
2025
|
+
*
|
|
2026
|
+
* ### **Events:**
|
|
2027
|
+
* - **on-test-switch-view**
|
|
2028
|
+
* - **qti-request-test-item**
|
|
2029
|
+
*/
|
|
2030
|
+
"test-view": Partial<TestViewProps & BaseProps & BaseEvents>;
|
|
2031
|
+
|
|
2032
|
+
/**
|
|
2033
|
+
*
|
|
2034
|
+
* ---
|
|
2035
|
+
*
|
|
2036
|
+
*
|
|
2037
|
+
* ### **Events:**
|
|
2038
|
+
* - **on-test-switch-view**
|
|
2039
|
+
* - **qti-request-test-item**
|
|
2040
|
+
*/
|
|
2041
|
+
"test-item-link": Partial<TestItemLinkProps & BaseProps & BaseEvents>;
|
|
2042
|
+
|
|
2043
|
+
/**
|
|
2044
|
+
*
|
|
2045
|
+
* ---
|
|
2046
|
+
*
|
|
2047
|
+
*
|
|
2048
|
+
* ### **Events:**
|
|
2049
|
+
* - **on-test-switch-view**
|
|
2050
|
+
* - **qti-request-test-item**
|
|
2051
|
+
*/
|
|
2052
|
+
"test-paging-buttons-stamp": Partial<TestPagingButtonsStampProps & BaseProps & BaseEvents>;
|
|
2053
|
+
|
|
1999
2054
|
/**
|
|
2000
2055
|
* `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.
|
|
2001
2056
|
*
|
|
@@ -2045,50 +2100,6 @@ export type CustomElements = {
|
|
|
2045
2100
|
*/
|
|
2046
2101
|
"qti-test": Partial<QtiTestProps & BaseProps & BaseEvents>;
|
|
2047
2102
|
|
|
2048
|
-
/**
|
|
2049
|
-
* Represents a custom element for navigating to the next test item.
|
|
2050
|
-
* ---
|
|
2051
|
-
*
|
|
2052
|
-
*
|
|
2053
|
-
* ### **Events:**
|
|
2054
|
-
* - **on-test-switch-view**
|
|
2055
|
-
* - **qti-request-test-item**
|
|
2056
|
-
*/
|
|
2057
|
-
"test-next": Partial<TestNextProps & BaseProps & BaseEvents>;
|
|
2058
|
-
|
|
2059
|
-
/**
|
|
2060
|
-
* Represents a custom element for navigating to the previous test item.
|
|
2061
|
-
* ---
|
|
2062
|
-
*
|
|
2063
|
-
*
|
|
2064
|
-
* ### **Events:**
|
|
2065
|
-
* - **on-test-switch-view**
|
|
2066
|
-
* - **qti-request-test-item**
|
|
2067
|
-
*/
|
|
2068
|
-
"test-prev": Partial<TestPrevProps & BaseProps & BaseEvents>;
|
|
2069
|
-
|
|
2070
|
-
/**
|
|
2071
|
-
*
|
|
2072
|
-
* ---
|
|
2073
|
-
*
|
|
2074
|
-
*
|
|
2075
|
-
* ### **Events:**
|
|
2076
|
-
* - **on-test-switch-view**
|
|
2077
|
-
* - **qti-request-test-item**
|
|
2078
|
-
*/
|
|
2079
|
-
"test-view": Partial<TestViewProps & BaseProps & BaseEvents>;
|
|
2080
|
-
|
|
2081
|
-
/**
|
|
2082
|
-
*
|
|
2083
|
-
* ---
|
|
2084
|
-
*
|
|
2085
|
-
*
|
|
2086
|
-
* ### **Events:**
|
|
2087
|
-
* - **on-test-switch-view**
|
|
2088
|
-
* - **qti-request-test-item**
|
|
2089
|
-
*/
|
|
2090
|
-
"test-item-link": Partial<TestItemLinkProps & BaseProps & BaseEvents>;
|
|
2091
|
-
|
|
2092
2103
|
/**
|
|
2093
2104
|
* `<test-container>` is a custom element designed for hosting the qti-assessment-item.
|
|
2094
2105
|
* The `qti-assessment-test` will be placed inside the shadow DOM of this element.
|
|
@@ -2103,15 +2114,4 @@ export type CustomElements = {
|
|
|
2103
2114
|
*
|
|
2104
2115
|
*/
|
|
2105
2116
|
"test-container": Partial<TestContainerProps & BaseProps & BaseEvents>;
|
|
2106
|
-
|
|
2107
|
-
/**
|
|
2108
|
-
*
|
|
2109
|
-
* ---
|
|
2110
|
-
*
|
|
2111
|
-
*
|
|
2112
|
-
* ### **Events:**
|
|
2113
|
-
* - **on-test-switch-view**
|
|
2114
|
-
* - **qti-request-test-item**
|
|
2115
|
-
*/
|
|
2116
|
-
"test-paging-buttons-stamp": Partial<TestPagingButtonsStampProps & BaseProps & BaseEvents>;
|
|
2117
2117
|
};
|
|
@@ -37,4 +37,25 @@ declare global {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.
|
|
42
|
+
* It can also host some functionalities to interact with the item like scoring, showing feedback, etc.
|
|
43
|
+
* Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.
|
|
44
|
+
* See `<item-container>` for more details.
|
|
45
|
+
*
|
|
46
|
+
* ```html
|
|
47
|
+
* <qti-item>
|
|
48
|
+
* <item-container class="m-4 bg-white" item-url="./path/to/item.xml"></item-container>
|
|
49
|
+
* </qti-item>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare class QtiItem extends LitElement {
|
|
53
|
+
render(): lit_html.TemplateResult<1>;
|
|
54
|
+
}
|
|
55
|
+
declare global {
|
|
56
|
+
interface HTMLElementTagNameMap {
|
|
57
|
+
'qti-item': QtiItem;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { QtiItem };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
item_default
|
|
3
|
-
} from "
|
|
4
|
-
import {
|
|
5
|
-
watch
|
|
6
|
-
} from "./chunk-ELDMXTUQ.js";
|
|
3
|
+
} from "../../chunk-2CHF3TMY.js";
|
|
7
4
|
import {
|
|
8
5
|
qtiTransformItem
|
|
9
|
-
} from "
|
|
6
|
+
} from "../../chunk-2OA7E3E7.js";
|
|
7
|
+
import {
|
|
8
|
+
watch
|
|
9
|
+
} from "../../chunk-4YG2FPKK.js";
|
|
10
10
|
import {
|
|
11
11
|
__decorateClass
|
|
12
|
-
} from "
|
|
12
|
+
} from "../../chunk-44VE5POH.js";
|
|
13
13
|
|
|
14
|
-
// src/lib/qti-item/components/item-container.ts
|
|
14
|
+
// src/lib/qti-item/core/components/item-container.ts
|
|
15
15
|
import { LitElement, html } from "lit";
|
|
16
16
|
import { customElement, property, state } from "lit/decorators.js";
|
|
17
17
|
import { until } from "lit/directives/until.js";
|
|
@@ -88,7 +88,18 @@ ItemContainer = __decorateClass([
|
|
|
88
88
|
customElement("item-container")
|
|
89
89
|
], ItemContainer);
|
|
90
90
|
|
|
91
|
+
// src/lib/qti-item/core/qti-item.ts
|
|
92
|
+
import { html as html2, LitElement as LitElement2 } from "lit";
|
|
93
|
+
import { customElement as customElement2 } from "lit/decorators.js";
|
|
94
|
+
var QtiItem = class extends LitElement2 {
|
|
95
|
+
render() {
|
|
96
|
+
return html2`<slot></slot>`;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
QtiItem = __decorateClass([
|
|
100
|
+
customElement2("qti-item")
|
|
101
|
+
], QtiItem);
|
|
91
102
|
export {
|
|
92
|
-
|
|
103
|
+
QtiItem
|
|
93
104
|
};
|
|
94
|
-
//# sourceMappingURL=
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/qti-item/core/components/item-container.ts","../../../src/lib/qti-item/core/qti-item.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\nimport { watch } from '../../../decorators/watch';\nimport itemCss from '../../../../item.css?inline';\nimport { qtiTransformItem } from '../../../qti-transformers';\n\n/**\n * `<item-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-item` will be placed inside the shadow DOM of this element.\n * The element loads the item from the provided URL and renders it inside the shadow DOM.\n *\n * ### Styling\n * Add a class to the element for styling.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('item-container')\nexport class ItemContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'item-url' })\n itemURL: string = null;\n\n /** A parsed HTML document */\n @state()\n itemDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n itemXML: string = null;\n\n /** Template content if provided */\n private templateContent = null;\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const api = await qtiTransformItem().load(this.itemURL);\n this.itemDoc = api.htmlDoc();\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('itemXML', { waitUntilFirstUpdate: true })\n protected handleItemXMLChange() {\n if (!this.itemXML) return;\n try {\n this.itemDoc = qtiTransformItem().parse(this.itemXML).htmlDoc();\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.initializeTemplateContent();\n this.applyStyles();\n if (this.itemURL) {\n this.handleItemURLChange();\n }\n if (this.itemXML) {\n this.handleItemXMLChange();\n }\n }\n\n private initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.templateContent = template ? template.content : html``;\n }\n\n private applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n render() {\n return html`\n ${this.templateContent}\n <slot></slot>\n ${until(this.itemDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-container': ItemContainer;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n/**\n * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.\n * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.\n * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.\n * See `<item-container>` for more details.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('qti-item')\nexport class QtiItem extends LitElement {\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,YAAY,YAAY;AACjC,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,aAAa;AAoBf,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC;AAAA;AAGL,mBAAkB;AAIlB,mBAA4B;AAI5B,mBAAkB;AAGlB;AAAA,SAAQ,kBAAkB;AAAA;AAAA,EAG1B,MAAgB,sBAAsB;AACpC,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,YAAM,MAAM,MAAM,iBAAiB,EAAE,KAAK,KAAK,OAAO;AACtD,WAAK,UAAU,IAAI,QAAQ;AAAA,IAC7B,SAAS,OAAO;AACd,cAAQ,MAAM,iCAAiC,KAAK;AAAA,IACtD;AAAA,EACF;AAAA,EAGU,sBAAsB;AAC9B,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,WAAK,UAAU,iBAAiB,EAAE,MAAM,KAAK,OAAO,EAAE,QAAQ;AAAA,IAChE,SAAS,OAAO;AACd,cAAQ,MAAM,sBAAsB,KAAK;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,SAAK,0BAA0B;AAC/B,SAAK,YAAY;AACjB,QAAI,KAAK,SAAS;AAChB,WAAK,oBAAoB;AAAA,IAC3B;AACA,QAAI,KAAK,SAAS;AAChB,WAAK,oBAAoB;AAAA,IAC3B;AAAA,EACF;AAAA,EAEQ,4BAA4B;AAClC,UAAM,WAAW,KAAK,cAAc,UAAU;AAC9C,SAAK,kBAAkB,WAAW,SAAS,UAAU;AAAA,EACvD;AAAA,EAEQ,cAAc;AACpB,UAAM,QAAQ,IAAI,cAAc;AAChC,UAAM,YAAY,YAAO;AACzB,SAAK,WAAW,qBAAqB,CAAC,KAAK;AAAA,EAC7C;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,QACH,KAAK,eAAe;AAAA;AAAA,QAEpB,MAAM,KAAK,SAAS,6BAA6B,CAAC;AAAA;AAAA,EAExD;AACF;AAhEE;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW,CAAC;AAAA,GAFtC,cAGX;AAIA;AAAA,EADC,MAAM;AAAA,GANI,cAOX;AAIA;AAAA,EADC,MAAM;AAAA,GAVI,cAWX;AAMgB;AAAA,EADf,MAAM,WAAW,EAAE,sBAAsB,KAAK,CAAC;AAAA,GAhBrC,cAiBK;AAWN;AAAA,EADT,MAAM,WAAW,EAAE,sBAAsB,KAAK,CAAC;AAAA,GA3BrC,cA4BD;AA5BC,gBAAN;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB;;;ACtBb,SAAS,QAAAA,OAAM,cAAAC,mBAAkB;AACjC,SAAS,iBAAAC,sBAAqB;AAevB,IAAM,UAAN,cAAsBC,YAAW;AAAA,EACtC,SAAS;AACP,WAAOC;AAAA,EACT;AACF;AAJa,UAAN;AAAA,EADNC,eAAc,UAAU;AAAA,GACZ;","names":["html","LitElement","customElement","LitElement","html","customElement"]}
|
package/dist/qti-loader/index.js
CHANGED
|
@@ -1,290 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<xsl:apply-templates select="@*|node()"/>
|
|
8
|
-
</xsl:copy>
|
|
9
|
-
</xsl:template>
|
|
10
|
-
|
|
11
|
-
<!-- remove existing namespaces -->
|
|
12
|
-
<xsl:template match="*">
|
|
13
|
-
<!-- remove element prefix -->
|
|
14
|
-
<xsl:element name="{local-name()}">
|
|
15
|
-
<!-- process attributes -->
|
|
16
|
-
<xsl:for-each select="@*">
|
|
17
|
-
<!-- remove attribute prefix -->
|
|
18
|
-
<xsl:attribute name="{local-name()}">
|
|
19
|
-
<xsl:value-of select="."/>
|
|
20
|
-
</xsl:attribute>
|
|
21
|
-
</xsl:for-each>
|
|
22
|
-
<xsl:apply-templates/>
|
|
23
|
-
</xsl:element>
|
|
24
|
-
</xsl:template>
|
|
25
|
-
</xsl:stylesheet>`;
|
|
26
|
-
function extendElementName(xmlFragment, tagName, extension) {
|
|
27
|
-
xmlFragment.querySelectorAll(tagName).forEach((element) => {
|
|
28
|
-
const newTagName = `${tagName}-${extension}`;
|
|
29
|
-
const newElement = createElementWithNewTagName(element, newTagName);
|
|
30
|
-
element.replaceWith(newElement);
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
function extendElementsWithClass(xmlFragment, classNamePattern) {
|
|
34
|
-
xmlFragment.querySelectorAll("*").forEach((element) => {
|
|
35
|
-
const classList = element.classList;
|
|
36
|
-
if (classList) {
|
|
37
|
-
classList.forEach((className) => {
|
|
38
|
-
if (className.startsWith(`${classNamePattern}:`)) {
|
|
39
|
-
const suffix = className.slice(`${classNamePattern}:`.length);
|
|
40
|
-
const newTagName = `${element.nodeName}-${suffix}`;
|
|
41
|
-
const newElement = createElementWithNewTagName(element, newTagName);
|
|
42
|
-
element.replaceWith(newElement);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function createElementWithNewTagName(element, newTagName) {
|
|
49
|
-
const newElement = document.createElement(newTagName);
|
|
50
|
-
for (const attr of element.attributes) {
|
|
51
|
-
newElement.setAttribute(attr.name, attr.value);
|
|
52
|
-
}
|
|
53
|
-
while (element.firstChild) {
|
|
54
|
-
newElement.appendChild(element.firstChild);
|
|
55
|
-
}
|
|
56
|
-
return newElement;
|
|
57
|
-
}
|
|
58
|
-
function itemsFromTest(xmlFragment) {
|
|
59
|
-
const items = [];
|
|
60
|
-
xmlFragment.querySelectorAll("qti-assessment-item-ref").forEach((el) => {
|
|
61
|
-
const identifier = el.getAttribute("identifier");
|
|
62
|
-
const href = el.getAttribute("href");
|
|
63
|
-
const category = el.getAttribute("category");
|
|
64
|
-
items.push({ identifier, href, category });
|
|
65
|
-
});
|
|
66
|
-
return items;
|
|
67
|
-
}
|
|
68
|
-
var currentRequest = null;
|
|
69
|
-
function loadXML(url, cancelPreviousRequest = false) {
|
|
70
|
-
if (cancelPreviousRequest && currentRequest !== null) {
|
|
71
|
-
currentRequest.abort();
|
|
72
|
-
}
|
|
73
|
-
return new Promise((resolve, reject) => {
|
|
74
|
-
const xhr = new XMLHttpRequest();
|
|
75
|
-
currentRequest = xhr;
|
|
76
|
-
xhr.open("GET", url, true);
|
|
77
|
-
xhr.responseType = "document";
|
|
78
|
-
xhr.onload = () => {
|
|
79
|
-
if (xhr.status >= 200 && xhr.status < 300) {
|
|
80
|
-
resolve(xhr.responseXML);
|
|
81
|
-
} else {
|
|
82
|
-
reject(xhr.statusText);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
xhr.onerror = () => {
|
|
86
|
-
reject(xhr.statusText);
|
|
87
|
-
};
|
|
88
|
-
xhr.send();
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function parseXML(xmlDocument) {
|
|
92
|
-
const parser = new DOMParser();
|
|
93
|
-
const xmlFragment = parser.parseFromString(xmlDocument, "text/xml");
|
|
94
|
-
return xmlFragment;
|
|
95
|
-
}
|
|
96
|
-
function toHTML(xmlFragment) {
|
|
97
|
-
const processor = new XSLTProcessor();
|
|
98
|
-
const xsltDocument = new DOMParser().parseFromString(xmlToHTML, "text/xml");
|
|
99
|
-
processor.importStylesheet(xsltDocument);
|
|
100
|
-
const itemHTMLFragment = processor.transformToFragment(xmlFragment, document);
|
|
101
|
-
return itemHTMLFragment;
|
|
102
|
-
}
|
|
103
|
-
function setLocation(xmlFragment, location) {
|
|
104
|
-
if (!location.endsWith("/")) {
|
|
105
|
-
location += "/";
|
|
106
|
-
}
|
|
107
|
-
xmlFragment.querySelectorAll("[src],[href],[primary-path]").forEach((elWithSrc) => {
|
|
108
|
-
let attr = "";
|
|
109
|
-
if (elWithSrc.getAttribute("src")) {
|
|
110
|
-
attr = "src";
|
|
111
|
-
}
|
|
112
|
-
if (elWithSrc.getAttribute("href")) {
|
|
113
|
-
attr = "href";
|
|
114
|
-
}
|
|
115
|
-
if (elWithSrc.getAttribute("primary-path")) {
|
|
116
|
-
attr = "primary-path";
|
|
117
|
-
}
|
|
118
|
-
const attrValue = elWithSrc.getAttribute(attr)?.trim();
|
|
119
|
-
if (!attrValue.startsWith("data:") && !attrValue.startsWith("http")) {
|
|
120
|
-
const newSrcValue = location + encodeURI(attrValue);
|
|
121
|
-
elWithSrc.setAttribute(attr, newSrcValue);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
function convertCDATAtoComment(xmlFragment) {
|
|
126
|
-
const cdataElements = xmlFragment.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value');
|
|
127
|
-
cdataElements.forEach((element) => {
|
|
128
|
-
const commentText = document.createComment(element.textContent);
|
|
129
|
-
element.replaceChild(commentText, element.firstChild);
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
function stripStyleSheets(xmlFragment) {
|
|
133
|
-
xmlFragment.querySelectorAll("qti-stylesheet").forEach((stylesheet) => stylesheet.remove());
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// src/lib/qti-transformers/qti-transform-item.ts
|
|
137
|
-
var qtiTransformItem = () => {
|
|
138
|
-
let xmlFragment;
|
|
139
|
-
const api = {
|
|
140
|
-
async load(uri, cancelPreviousRequest = false) {
|
|
141
|
-
return new Promise((resolve) => {
|
|
142
|
-
loadXML(uri, cancelPreviousRequest).then((xml2) => {
|
|
143
|
-
xmlFragment = xml2;
|
|
144
|
-
api.path(uri.substring(0, uri.lastIndexOf("/")));
|
|
145
|
-
return resolve(api);
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
},
|
|
149
|
-
parse(xmlString) {
|
|
150
|
-
xmlFragment = parseXML(xmlString);
|
|
151
|
-
return api;
|
|
152
|
-
},
|
|
153
|
-
path: (location) => {
|
|
154
|
-
setLocation(xmlFragment, location);
|
|
155
|
-
return api;
|
|
156
|
-
},
|
|
157
|
-
fn(fn) {
|
|
158
|
-
fn(xmlFragment);
|
|
159
|
-
return api;
|
|
160
|
-
},
|
|
161
|
-
pciHooks(uri) {
|
|
162
|
-
const attributes = ["hook", "module"];
|
|
163
|
-
const documentPath = uri.substring(0, uri.lastIndexOf("/"));
|
|
164
|
-
for (const attribute of attributes) {
|
|
165
|
-
const srcAttributes = xmlFragment.querySelectorAll("[" + attribute + "]");
|
|
166
|
-
srcAttributes.forEach((node) => {
|
|
167
|
-
const srcValue = node.getAttribute(attribute);
|
|
168
|
-
if (!srcValue.startsWith("data:") && !srcValue.startsWith("http")) {
|
|
169
|
-
node.setAttribute("base-url", uri);
|
|
170
|
-
node.setAttribute(
|
|
171
|
-
"module",
|
|
172
|
-
documentPath + "/" + encodeURI(srcValue + (srcValue.endsWith(".js") ? "" : ".js"))
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
return api;
|
|
178
|
-
},
|
|
179
|
-
extendElementName: (tagName, extension) => {
|
|
180
|
-
extendElementName(xmlFragment, tagName, extension);
|
|
181
|
-
return api;
|
|
182
|
-
},
|
|
183
|
-
extendElementsWithClass: (param = "extend") => {
|
|
184
|
-
extendElementsWithClass(xmlFragment, param);
|
|
185
|
-
return api;
|
|
186
|
-
},
|
|
187
|
-
customInteraction(baseRef, baseItem) {
|
|
188
|
-
const qtiCustomInteraction = xmlFragment.querySelector("qti-custom-interaction");
|
|
189
|
-
const qtiCustomInteractionObject = qtiCustomInteraction.querySelector("object");
|
|
190
|
-
qtiCustomInteraction.setAttribute("data-base-ref", baseRef);
|
|
191
|
-
qtiCustomInteraction.setAttribute("data-base-item", baseRef + baseItem);
|
|
192
|
-
qtiCustomInteraction.setAttribute("data", qtiCustomInteractionObject.getAttribute("data"));
|
|
193
|
-
qtiCustomInteraction.setAttribute("width", qtiCustomInteractionObject.getAttribute("width"));
|
|
194
|
-
qtiCustomInteraction.setAttribute("height", qtiCustomInteractionObject.getAttribute("height"));
|
|
195
|
-
qtiCustomInteraction.removeChild(qtiCustomInteractionObject);
|
|
196
|
-
return api;
|
|
197
|
-
},
|
|
198
|
-
convertCDATAtoComment() {
|
|
199
|
-
convertCDATAtoComment(xmlFragment);
|
|
200
|
-
return api;
|
|
201
|
-
},
|
|
202
|
-
stripStyleSheets() {
|
|
203
|
-
stripStyleSheets(xmlFragment);
|
|
204
|
-
return api;
|
|
205
|
-
},
|
|
206
|
-
html() {
|
|
207
|
-
return new XMLSerializer().serializeToString(toHTML(xmlFragment));
|
|
208
|
-
},
|
|
209
|
-
xml() {
|
|
210
|
-
return new XMLSerializer().serializeToString(xmlFragment);
|
|
211
|
-
},
|
|
212
|
-
htmlDoc() {
|
|
213
|
-
return toHTML(xmlFragment);
|
|
214
|
-
},
|
|
215
|
-
xmlDoc() {
|
|
216
|
-
return xmlFragment;
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
return api;
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
// src/lib/qti-transformers/qti-transform-manifest.ts
|
|
223
|
-
var qtiTransformManifest = () => {
|
|
224
|
-
let xmlFragment;
|
|
225
|
-
const api = {
|
|
226
|
-
async load(uri) {
|
|
227
|
-
return new Promise((resolve) => {
|
|
228
|
-
loadXML(uri).then((xml2) => {
|
|
229
|
-
xmlFragment = xml2;
|
|
230
|
-
return resolve(api);
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
},
|
|
234
|
-
parse(xmlString) {
|
|
235
|
-
xmlFragment = parseXML(xmlString);
|
|
236
|
-
},
|
|
237
|
-
assessmentTest() {
|
|
238
|
-
const el = xmlFragment.querySelector('resource[type="imsqti_test_xmlv3p0"]');
|
|
239
|
-
return { href: el.getAttribute("href"), identifier: el.getAttribute("identifier") };
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
return api;
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
// src/lib/qti-transformers/qti-transform-test.ts
|
|
246
|
-
var qtiTransformTest = () => {
|
|
247
|
-
let xmlFragment;
|
|
248
|
-
const api = {
|
|
249
|
-
async load(uri) {
|
|
250
|
-
return new Promise((resolve, _) => {
|
|
251
|
-
loadXML(uri).then((xml2) => {
|
|
252
|
-
xmlFragment = xml2;
|
|
253
|
-
api.path(uri.substring(0, uri.lastIndexOf("/")));
|
|
254
|
-
return resolve(api);
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
},
|
|
258
|
-
parse(xmlString) {
|
|
259
|
-
xmlFragment = parseXML(xmlString);
|
|
260
|
-
return api;
|
|
261
|
-
},
|
|
262
|
-
path: (location) => {
|
|
263
|
-
setLocation(xmlFragment, location);
|
|
264
|
-
return api;
|
|
265
|
-
},
|
|
266
|
-
fn(fn) {
|
|
267
|
-
fn(xmlFragment);
|
|
268
|
-
return api;
|
|
269
|
-
},
|
|
270
|
-
items() {
|
|
271
|
-
return itemsFromTest(xmlFragment);
|
|
272
|
-
},
|
|
273
|
-
html() {
|
|
274
|
-
return new XMLSerializer().serializeToString(toHTML(xmlFragment));
|
|
275
|
-
},
|
|
276
|
-
xml() {
|
|
277
|
-
return new XMLSerializer().serializeToString(xmlFragment);
|
|
278
|
-
},
|
|
279
|
-
htmlDoc() {
|
|
280
|
-
return toHTML(xmlFragment);
|
|
281
|
-
},
|
|
282
|
-
xmlDoc() {
|
|
283
|
-
return xmlFragment;
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
return api;
|
|
287
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
qtiTransformItem,
|
|
3
|
+
qtiTransformManifest,
|
|
4
|
+
qtiTransformTest
|
|
5
|
+
} from "../chunk-2OA7E3E7.js";
|
|
6
|
+
import "../chunk-44VE5POH.js";
|
|
288
7
|
|
|
289
8
|
// src/lib/qti-loader/qti-loader.ts
|
|
290
9
|
var getManifestInfo = async (manifestURL) => {
|