@citolab/qti-components 7.3.22 → 7.4.0
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/index.global.js +1 -1
- package/cdn/index.js +5485 -1
- package/custom-elements.json +29837 -0
- package/dist/chunks/chunk-6K4ROGDD.js +364 -0
- package/dist/chunks/chunk-6K4ROGDD.js.map +1 -0
- package/dist/chunks/chunk-GUDRSXIP.js +189 -0
- package/dist/chunks/chunk-GUDRSXIP.js.map +1 -0
- package/dist/chunks/{chunk-WFUXZ4UT.js → chunk-JDY5GL7E.js} +13 -1
- package/dist/chunks/{chunk-WFUXZ4UT.js.map → chunk-JDY5GL7E.js.map} +1 -1
- package/dist/chunks/{chunk-LF6SO3JU.js → chunk-LN74Z5QM.js} +653 -450
- package/dist/chunks/chunk-LN74Z5QM.js.map +1 -0
- package/dist/chunks/{chunk-ELDMXTUQ.js → chunk-O5N4DCU6.js} +7 -2
- package/dist/chunks/chunk-O5N4DCU6.js.map +1 -0
- package/dist/chunks/chunk-TJ6ZOT7A.js +2235 -0
- package/dist/chunks/chunk-TJ6ZOT7A.js.map +1 -0
- package/dist/computed-item.context-DpK-sS0T.d.ts +19 -0
- package/dist/{exports/config.context.d.ts → config.context-CmQ9L62n.d.ts} +1 -4
- package/dist/custom-elements.json +29837 -0
- package/dist/index.d.ts +8 -39
- package/dist/index.js +34 -104
- package/{cdn/chunks/chunk-5TDBMEY5.js → dist/item.css} +7 -24
- package/dist/qti-assessment-item-D77dJ1Ot.d.ts +104 -0
- package/dist/qti-components/index.d.ts +1238 -19
- package/dist/qti-components/index.js +6 -14
- package/dist/qti-components-jsx.d.ts +4463 -0
- package/dist/qti-item/index.d.ts +113 -0
- package/dist/qti-item/index.js +16 -0
- package/dist/qti-loader/index.d.ts +2 -6
- package/dist/qti-loader/index.js +24 -5
- package/dist/qti-loader/index.js.map +1 -1
- package/dist/qti-test/index.d.ts +593 -0
- package/dist/qti-test/index.js +62 -0
- package/dist/qti-transformers/index.d.ts +38 -2
- package/dist/qti-transformers/index.js +1 -2
- package/dist/test.context-L609DNAz.d.ts +58 -0
- package/dist/variables-Vgyr6yyW.d.ts +58 -0
- package/dist/vscode.css-custom-data.json +11 -0
- package/dist/vscode.html-custom-data.json +1135 -0
- package/package.json +74 -113
- package/cdn/chunks/chunk-2BSPQRNR.js +0 -6
- package/cdn/chunks/chunk-3CVBBZDT.js +0 -17
- package/cdn/chunks/chunk-3IBGLVHA.js +0 -1
- package/cdn/chunks/chunk-3YQMAZEO.js +0 -29
- package/cdn/chunks/chunk-5UQLGV7F.js +0 -5
- package/cdn/chunks/chunk-5WLHU3FH.js +0 -8
- package/cdn/chunks/chunk-6SGFGN34.js +0 -8
- package/cdn/chunks/chunk-6XVY32RS.js +0 -1
- package/cdn/chunks/chunk-7ME56ODO.js +0 -1
- package/cdn/chunks/chunk-CZDMOYYF.js +0 -1
- package/cdn/chunks/chunk-DNBBQ7LY.js +0 -1
- package/cdn/chunks/chunk-DP5FVJRS.js +0 -21
- package/cdn/chunks/chunk-E6IOJ4MV.js +0 -23
- package/cdn/chunks/chunk-G76Y52EL.js +0 -1471
- package/cdn/chunks/chunk-HCXHHI6V.js +0 -18
- package/cdn/chunks/chunk-HDMF4QZO.js +0 -48
- package/cdn/chunks/chunk-HKWYQB5Z.js +0 -37
- package/cdn/chunks/chunk-J5P2GBPV.js +0 -1
- package/cdn/chunks/chunk-KWPDTFYH.js +0 -1
- package/cdn/chunks/chunk-LIUOA3YV.js +0 -1
- package/cdn/chunks/chunk-LO2NM3CE.js +0 -1
- package/cdn/chunks/chunk-MD33BNWM.js +0 -1
- package/cdn/chunks/chunk-MRQ46JRY.js +0 -8
- package/cdn/chunks/chunk-NJP4VZB3.js +0 -8
- package/cdn/chunks/chunk-O4RAJ3LM.js +0 -25
- package/cdn/chunks/chunk-OSLUHYFD.js +0 -8
- package/cdn/chunks/chunk-P6SSTAJ2.js +0 -1
- package/cdn/chunks/chunk-PP62N3C4.js +0 -8
- package/cdn/chunks/chunk-PU7OABT3.js +0 -1
- package/cdn/chunks/chunk-PUI3LIFH.js +0 -0
- package/cdn/chunks/chunk-QBAXWCYQ.js +0 -5
- package/cdn/chunks/chunk-QEFO63QX.js +0 -8
- package/cdn/chunks/chunk-QQCGUVEV.js +0 -1
- package/cdn/chunks/chunk-QQR6POPY.js +0 -1
- package/cdn/chunks/chunk-RGNFAPWY.js +0 -2
- package/cdn/chunks/chunk-S5QDLZ6J.js +0 -1
- package/cdn/chunks/chunk-SEM2PEP6.js +0 -5
- package/cdn/chunks/chunk-SVVO2SFS.js +0 -1
- package/cdn/chunks/chunk-TCHROQU3.js +0 -1
- package/cdn/chunks/chunk-UMDZKG6K.js +0 -1
- package/cdn/chunks/chunk-VEG7LKS3.js +0 -48
- package/cdn/chunks/chunk-WCCTDLQ4.js +0 -8
- package/cdn/chunks/chunk-X4FA36TC.js +0 -1
- package/cdn/chunks/chunk-XJ2CFTZP.js +0 -1
- package/cdn/chunks/chunk-XUJ7TXHW.js +0 -1
- package/cdn/chunks/chunk-YCBNF5QU.js +0 -17
- package/cdn/chunks/chunk-YHLQ2JQ2.js +0 -1
- package/cdn/chunks/chunk-ZPCQH3EY.js +0 -10
- package/cdn/exports/computed-item.context.js +0 -1
- package/cdn/exports/computed.context.js +0 -1
- package/cdn/exports/config.context.js +0 -1
- package/cdn/exports/expression-result.js +0 -0
- package/cdn/exports/interaction.interface.js +0 -0
- package/cdn/exports/interaction.js +0 -1
- package/cdn/exports/item.context.js +0 -1
- package/cdn/exports/qti-assessment-item.context.js +0 -1
- package/cdn/exports/qti-condition-expression.js +0 -1
- package/cdn/exports/qti-expression.js +0 -1
- package/cdn/exports/qti-test.js +0 -0
- package/cdn/exports/qti.context.js +0 -1
- package/cdn/exports/session.context.js +0 -1
- package/cdn/exports/test.context.js +0 -1
- package/cdn/exports/variables.js +0 -0
- package/cdn/qti-components/index.js +0 -1
- package/cdn/qti-item/components/item-container.js +0 -1
- package/cdn/qti-item/components/item-correct-response-mode.js +0 -10
- package/cdn/qti-item/components/item-show-candidate-correction.js +0 -8
- package/cdn/qti-item/components/item-show-correct-response.js +0 -1
- package/cdn/qti-item/components/print-item-variables.js +0 -1
- package/cdn/qti-item/components/styles.js +0 -1
- package/cdn/qti-item/core/index.js +0 -1
- package/cdn/qti-loader/index.js +0 -1
- package/cdn/qti-test/components/index.js +0 -1
- package/cdn/qti-test/components/styles.js +0 -1
- package/cdn/qti-test/components/test-check-item.js +0 -1
- package/cdn/qti-test/components/test-container.js +0 -1
- package/cdn/qti-test/components/test-end-attempt.js +0 -1
- package/cdn/qti-test/components/test-item-link.js +0 -1
- package/cdn/qti-test/components/test-navigation.js +0 -1
- package/cdn/qti-test/components/test-next.js +0 -1
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +0 -1
- package/cdn/qti-test/components/test-prev.js +0 -1
- package/cdn/qti-test/components/test-print-context.js +0 -1
- package/cdn/qti-test/components/test-print-item-variables.js +0 -1
- package/cdn/qti-test/components/test-scoring-buttons.js +0 -1
- package/cdn/qti-test/components/test-scoring-feedback.js +0 -1
- package/cdn/qti-test/components/test-section-buttons-stamp.js +0 -1
- package/cdn/qti-test/components/test-section-link.js +0 -1
- package/cdn/qti-test/components/test-show-correct-response.js +0 -1
- package/cdn/qti-test/components/test-stamp.js +0 -1
- package/cdn/qti-test/components/test-view-toggle.js +0 -1
- package/cdn/qti-test/components/test-view.js +0 -1
- package/cdn/qti-test/core/index.js +0 -1
- package/cdn/qti-transformers/index.js +0 -1
- package/dist/chunks/chunk-22IRJWWY.js +0 -10
- package/dist/chunks/chunk-22IRJWWY.js.map +0 -1
- package/dist/chunks/chunk-36G5MQKR.js +0 -85
- package/dist/chunks/chunk-36G5MQKR.js.map +0 -1
- package/dist/chunks/chunk-4OGJBG35.js +0 -8
- package/dist/chunks/chunk-4OGJBG35.js.map +0 -1
- package/dist/chunks/chunk-5KCXO2RP.js +0 -36
- package/dist/chunks/chunk-5KCXO2RP.js.map +0 -1
- package/dist/chunks/chunk-5ZHHNEDA.js +0 -30
- package/dist/chunks/chunk-5ZHHNEDA.js.map +0 -1
- package/dist/chunks/chunk-7K44TDQO.js +0 -91
- package/dist/chunks/chunk-7K44TDQO.js.map +0 -1
- package/dist/chunks/chunk-7OMJMXHK.js +0 -50
- package/dist/chunks/chunk-7OMJMXHK.js.map +0 -1
- package/dist/chunks/chunk-AZIKAG7K.js +0 -8
- package/dist/chunks/chunk-AZIKAG7K.js.map +0 -1
- package/dist/chunks/chunk-BLBSZDQ4.js +0 -52
- package/dist/chunks/chunk-BLBSZDQ4.js.map +0 -1
- package/dist/chunks/chunk-CJADUWEC.js +0 -10
- package/dist/chunks/chunk-CJADUWEC.js.map +0 -1
- package/dist/chunks/chunk-CP34TICQ.js +0 -45
- package/dist/chunks/chunk-CP34TICQ.js.map +0 -1
- package/dist/chunks/chunk-CTESMSQO.js +0 -56
- package/dist/chunks/chunk-CTESMSQO.js.map +0 -1
- package/dist/chunks/chunk-DZAMXOSC.js +0 -30
- package/dist/chunks/chunk-DZAMXOSC.js.map +0 -1
- package/dist/chunks/chunk-E6V3JHVT.js +0 -31
- package/dist/chunks/chunk-E6V3JHVT.js.map +0 -1
- package/dist/chunks/chunk-EJZQSOHU.js +0 -85
- package/dist/chunks/chunk-EJZQSOHU.js.map +0 -1
- package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
- package/dist/chunks/chunk-EMVOKXSA.js +0 -84
- package/dist/chunks/chunk-EMVOKXSA.js.map +0 -1
- package/dist/chunks/chunk-ERYHQVOT.js +0 -8
- package/dist/chunks/chunk-ERYHQVOT.js.map +0 -1
- package/dist/chunks/chunk-ETLOKJAG.js +0 -94
- package/dist/chunks/chunk-ETLOKJAG.js.map +0 -1
- package/dist/chunks/chunk-FL72PF4D.js +0 -19
- package/dist/chunks/chunk-FL72PF4D.js.map +0 -1
- package/dist/chunks/chunk-GAHXUFMQ.js +0 -93
- package/dist/chunks/chunk-GAHXUFMQ.js.map +0 -1
- package/dist/chunks/chunk-H2JE6IVU.js +0 -15
- package/dist/chunks/chunk-H2JE6IVU.js.map +0 -1
- package/dist/chunks/chunk-H6KHXSIO.js +0 -8
- package/dist/chunks/chunk-H6KHXSIO.js.map +0 -1
- package/dist/chunks/chunk-HFAUM56X.js +0 -208
- package/dist/chunks/chunk-HFAUM56X.js.map +0 -1
- package/dist/chunks/chunk-JQ6HWGRY.js +0 -22
- package/dist/chunks/chunk-JQ6HWGRY.js.map +0 -1
- package/dist/chunks/chunk-KG5Z2CKO.js +0 -86
- package/dist/chunks/chunk-KG5Z2CKO.js.map +0 -1
- package/dist/chunks/chunk-KSXNC564.js +0 -43
- package/dist/chunks/chunk-KSXNC564.js.map +0 -1
- package/dist/chunks/chunk-LF6SO3JU.js.map +0 -1
- package/dist/chunks/chunk-NJNQOQUU.js +0 -8
- package/dist/chunks/chunk-NJNQOQUU.js.map +0 -1
- package/dist/chunks/chunk-ODHS7HDB.js +0 -94
- package/dist/chunks/chunk-ODHS7HDB.js.map +0 -1
- package/dist/chunks/chunk-QCB6P7DH.js +0 -146
- package/dist/chunks/chunk-QCB6P7DH.js.map +0 -1
- package/dist/chunks/chunk-QU7KR7VX.js +0 -367
- package/dist/chunks/chunk-QU7KR7VX.js.map +0 -1
- package/dist/chunks/chunk-TU6COU44.js +0 -82
- package/dist/chunks/chunk-TU6COU44.js.map +0 -1
- package/dist/chunks/chunk-TUKEQ36K.js +0 -60
- package/dist/chunks/chunk-TUKEQ36K.js.map +0 -1
- package/dist/chunks/chunk-TWYN56XO.js +0 -92
- package/dist/chunks/chunk-TWYN56XO.js.map +0 -1
- package/dist/chunks/chunk-UHQVQBCL.js +0 -89
- package/dist/chunks/chunk-UHQVQBCL.js.map +0 -1
- package/dist/chunks/chunk-WFFIUFJJ.js +0 -28
- package/dist/chunks/chunk-WFFIUFJJ.js.map +0 -1
- package/dist/chunks/chunk-WN6TJQI2.js +0 -103
- package/dist/chunks/chunk-WN6TJQI2.js.map +0 -1
- package/dist/chunks/chunk-WPEFNKMC.js +0 -923
- package/dist/chunks/chunk-WPEFNKMC.js.map +0 -1
- package/dist/chunks/chunk-YPMZLHGG.js +0 -52
- package/dist/chunks/chunk-YPMZLHGG.js.map +0 -1
- package/dist/chunks/chunk-YWEWSQJR.js +0 -40
- package/dist/chunks/chunk-YWEWSQJR.js.map +0 -1
- package/dist/chunks/chunk-ZGSNDSK3.js +0 -1
- package/dist/chunks/chunk-ZGSNDSK3.js.map +0 -1
- package/dist/exports/computed-item.context.d.ts +0 -29
- package/dist/exports/computed-item.context.js +0 -8
- package/dist/exports/computed-item.context.js.map +0 -1
- package/dist/exports/computed.context.d.ts +0 -42
- package/dist/exports/computed.context.js +0 -8
- package/dist/exports/computed.context.js.map +0 -1
- package/dist/exports/config.context.js +0 -8
- package/dist/exports/config.context.js.map +0 -1
- package/dist/exports/expression-result.d.ts +0 -19
- package/dist/exports/expression-result.js +0 -1
- package/dist/exports/expression-result.js.map +0 -1
- package/dist/exports/interaction.d.ts +0 -8
- package/dist/exports/interaction.interface.d.ts +0 -13
- package/dist/exports/interaction.interface.js +0 -1
- package/dist/exports/interaction.interface.js.map +0 -1
- package/dist/exports/interaction.js +0 -12
- package/dist/exports/interaction.js.map +0 -1
- package/dist/exports/item.context.d.ts +0 -8
- package/dist/exports/item.context.js +0 -8
- package/dist/exports/item.context.js.map +0 -1
- package/dist/exports/qti-assessment-item.context.d.ts +0 -14
- package/dist/exports/qti-assessment-item.context.js +0 -8
- package/dist/exports/qti-assessment-item.context.js.map +0 -1
- package/dist/exports/qti-condition-expression.d.ts +0 -15
- package/dist/exports/qti-condition-expression.js +0 -11
- package/dist/exports/qti-condition-expression.js.map +0 -1
- package/dist/exports/qti-expression.d.ts +0 -8
- package/dist/exports/qti-expression.js +0 -10
- package/dist/exports/qti-expression.js.map +0 -1
- package/dist/exports/qti-test.d.ts +0 -40
- package/dist/exports/qti-test.js +0 -1
- package/dist/exports/qti-test.js.map +0 -1
- package/dist/exports/qti.context.d.ts +0 -14
- package/dist/exports/qti.context.js +0 -8
- package/dist/exports/qti.context.js.map +0 -1
- package/dist/exports/session.context.d.ts +0 -26
- package/dist/exports/session.context.js +0 -10
- package/dist/exports/session.context.js.map +0 -1
- package/dist/exports/test.context.d.ts +0 -21
- package/dist/exports/test.context.js +0 -10
- package/dist/exports/test.context.js.map +0 -1
- package/dist/exports/variables.d.ts +0 -8
- package/dist/exports/variables.js +0 -1
- package/dist/exports/variables.js.map +0 -1
- package/dist/qti-item/components/item-container.d.ts +0 -40
- package/dist/qti-item/components/item-container.js +0 -11
- package/dist/qti-item/components/item-container.js.map +0 -1
- package/dist/qti-item/components/item-correct-response-mode.d.ts +0 -17
- package/dist/qti-item/components/item-correct-response-mode.js +0 -62
- package/dist/qti-item/components/item-correct-response-mode.js.map +0 -1
- package/dist/qti-item/components/item-show-candidate-correction.d.ts +0 -34
- package/dist/qti-item/components/item-show-candidate-correction.js +0 -88
- package/dist/qti-item/components/item-show-candidate-correction.js.map +0 -1
- package/dist/qti-item/components/item-show-correct-response.d.ts +0 -33
- package/dist/qti-item/components/item-show-correct-response.js +0 -10
- package/dist/qti-item/components/item-show-correct-response.js.map +0 -1
- package/dist/qti-item/components/print-item-variables.d.ts +0 -23
- package/dist/qti-item/components/print-item-variables.js +0 -9
- package/dist/qti-item/components/print-item-variables.js.map +0 -1
- package/dist/qti-item/components/styles.d.ts +0 -8
- package/dist/qti-item/components/styles.js +0 -14
- package/dist/qti-item/components/styles.js.map +0 -1
- package/dist/qti-item/core/index.d.ts +0 -51
- package/dist/qti-item/core/index.js +0 -26
- package/dist/qti-response-declaration-DKr08ANy.d.ts +0 -1397
- package/dist/qti-test/components/index.d.ts +0 -33
- package/dist/qti-test/components/index.js +0 -87
- package/dist/qti-test/components/styles.d.ts +0 -8
- package/dist/qti-test/components/styles.js +0 -14
- package/dist/qti-test/components/styles.js.map +0 -1
- package/dist/qti-test/components/test-check-item.d.ts +0 -16
- package/dist/qti-test/components/test-check-item.js +0 -9
- package/dist/qti-test/components/test-check-item.js.map +0 -1
- package/dist/qti-test/components/test-container.d.ts +0 -39
- package/dist/qti-test/components/test-container.js +0 -11
- package/dist/qti-test/components/test-container.js.map +0 -1
- package/dist/qti-test/components/test-end-attempt.d.ts +0 -16
- package/dist/qti-test/components/test-end-attempt.js +0 -9
- package/dist/qti-test/components/test-end-attempt.js.map +0 -1
- package/dist/qti-test/components/test-item-link.d.ts +0 -18
- package/dist/qti-test/components/test-item-link.js +0 -9
- package/dist/qti-test/components/test-item-link.js.map +0 -1
- package/dist/qti-test/components/test-navigation.d.ts +0 -73
- package/dist/qti-test/components/test-navigation.js +0 -13
- package/dist/qti-test/components/test-navigation.js.map +0 -1
- package/dist/qti-test/components/test-next.d.ts +0 -48
- package/dist/qti-test/components/test-next.js +0 -12
- package/dist/qti-test/components/test-next.js.map +0 -1
- package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +0 -23
- package/dist/qti-test/components/test-paging-buttons-stamp.js +0 -9
- package/dist/qti-test/components/test-paging-buttons-stamp.js.map +0 -1
- package/dist/qti-test/components/test-prev.d.ts +0 -46
- package/dist/qti-test/components/test-prev.js +0 -12
- package/dist/qti-test/components/test-prev.js.map +0 -1
- package/dist/qti-test/components/test-print-context.d.ts +0 -25
- package/dist/qti-test/components/test-print-context.js +0 -9
- package/dist/qti-test/components/test-print-context.js.map +0 -1
- package/dist/qti-test/components/test-print-item-variables.d.ts +0 -27
- package/dist/qti-test/components/test-print-item-variables.js +0 -9
- package/dist/qti-test/components/test-print-item-variables.js.map +0 -1
- package/dist/qti-test/components/test-scoring-buttons.d.ts +0 -32
- package/dist/qti-test/components/test-scoring-buttons.js +0 -9
- package/dist/qti-test/components/test-scoring-buttons.js.map +0 -1
- package/dist/qti-test/components/test-scoring-feedback.d.ts +0 -27
- package/dist/qti-test/components/test-scoring-feedback.js +0 -9
- package/dist/qti-test/components/test-scoring-feedback.js.map +0 -1
- package/dist/qti-test/components/test-section-buttons-stamp.d.ts +0 -23
- package/dist/qti-test/components/test-section-buttons-stamp.js +0 -9
- package/dist/qti-test/components/test-section-buttons-stamp.js.map +0 -1
- package/dist/qti-test/components/test-section-link.d.ts +0 -18
- package/dist/qti-test/components/test-section-link.js +0 -9
- package/dist/qti-test/components/test-section-link.js.map +0 -1
- package/dist/qti-test/components/test-show-correct-response.d.ts +0 -39
- package/dist/qti-test/components/test-show-correct-response.js +0 -10
- package/dist/qti-test/components/test-show-correct-response.js.map +0 -1
- package/dist/qti-test/components/test-stamp.d.ts +0 -31
- package/dist/qti-test/components/test-stamp.js +0 -9
- package/dist/qti-test/components/test-stamp.js.map +0 -1
- package/dist/qti-test/components/test-view-toggle.d.ts +0 -19
- package/dist/qti-test/components/test-view-toggle.js +0 -9
- package/dist/qti-test/components/test-view-toggle.js.map +0 -1
- package/dist/qti-test/components/test-view.d.ts +0 -24
- package/dist/qti-test/components/test-view.js +0 -10
- package/dist/qti-test/components/test-view.js.map +0 -1
- package/dist/qti-test/core/index.d.ts +0 -105
- package/dist/qti-test/core/index.js +0 -36
- package/dist/qti-test/core/index.js.map +0 -1
- package/dist/qti-test-feedback-CZsbp6z4.d.ts +0 -91
- package/dist/qti-transform-item-C9WtMeDR.d.ts +0 -39
- /package/dist/qti-item/{core/index.js.map → index.js.map} +0 -0
- /package/dist/qti-test/{components/index.js.map → index.js.map} +0 -0
package/package.json
CHANGED
|
@@ -21,56 +21,83 @@
|
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20.0.0"
|
|
23
23
|
},
|
|
24
|
-
"version": "7.
|
|
24
|
+
"version": "7.4.0",
|
|
25
25
|
"type": "module",
|
|
26
|
-
"main": "dist/index.js",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"sideEffects": [
|
|
29
|
+
"./dist/qti-components/*.js",
|
|
30
|
+
"./dist/qti-item/components/*.js",
|
|
31
|
+
"./dist/qti-test/components/*.js",
|
|
32
|
+
"./cdn/*.js",
|
|
33
|
+
"./src/**/*.css",
|
|
34
|
+
"./src/**/qti-*.ts",
|
|
35
|
+
"./src/**/test-*.ts",
|
|
36
|
+
"./src/**/item-*.ts"
|
|
37
|
+
],
|
|
27
38
|
"exports": {
|
|
28
|
-
".":
|
|
29
|
-
|
|
30
|
-
"import": "./dist/
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"import": "./dist/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./qti-components": {
|
|
44
|
+
"types": "./dist/qti-components/index.d.ts",
|
|
45
|
+
"import": "./dist/qti-components/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./qti-item": {
|
|
48
|
+
"types": "./dist/qti-item/index.d.ts",
|
|
49
|
+
"import": "./dist/qti-item/index.js"
|
|
31
50
|
},
|
|
32
|
-
"./qti-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"type": "./dist/qti-test/components/*.d.ts",
|
|
36
|
-
"import": "./dist/qti-test/components/*"
|
|
51
|
+
"./qti-test": {
|
|
52
|
+
"types": "./dist/qti-test/index.d.ts",
|
|
53
|
+
"import": "./dist/qti-test/index.js"
|
|
37
54
|
},
|
|
38
|
-
"./qti-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
55
|
+
"./qti-loader": {
|
|
56
|
+
"types": "./dist/qti-loader/index.d.ts",
|
|
57
|
+
"import": "./dist/qti-loader/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./qti-transformers": {
|
|
60
|
+
"types": "./dist/qti-transformers/index.d.ts",
|
|
61
|
+
"import": "./dist/qti-transformers/index.js"
|
|
42
62
|
},
|
|
43
|
-
"./qti-loader": "./dist/qti-loader/index.js",
|
|
44
|
-
"./qti-transformers": "./dist/qti-transformers/index.js",
|
|
45
63
|
"./react": "./dist/qti-components-jsx.d.ts",
|
|
46
|
-
"./item.css": "./dist/item.css"
|
|
64
|
+
"./item.css": "./dist/item.css",
|
|
65
|
+
"./cdn/*": "./cdn/*",
|
|
66
|
+
"./package.json": "./package.json"
|
|
47
67
|
},
|
|
48
68
|
"files": [
|
|
49
69
|
"dist",
|
|
50
|
-
"cdn"
|
|
70
|
+
"cdn",
|
|
71
|
+
"custom-elements.json"
|
|
51
72
|
],
|
|
52
73
|
"scripts": {
|
|
53
|
-
"storybook": "
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
74
|
+
"storybook": "run-p storybook:dev cem:watch",
|
|
75
|
+
"watch": "nodemon --watch src --ext ts,css --exec \"run-s tsup cem css && yalc push\"",
|
|
76
|
+
"publish": "run-s clean ci build test lint stylelint publint attw np",
|
|
77
|
+
"-----------------------cmds--": "-",
|
|
78
|
+
"pre-commit": "run-s lint stylelint madge",
|
|
79
|
+
"pre-push": "run-s clean ci build test lint stylelint publint attw",
|
|
80
|
+
"pkgr-release": "run-s tsup css cem test",
|
|
81
|
+
"build-storybook": "npm run cem && storybook build",
|
|
82
|
+
"-----------------------scripts--": "-",
|
|
83
|
+
"build": "run-p cem css tsup",
|
|
84
|
+
"storybook:dev": "storybook dev -p 6006",
|
|
85
|
+
"cem": "cem analyze && cp custom-elements.json ./dist",
|
|
86
|
+
"cem:watch": "cem analyze --watch && cp custom-elements.json ./dist",
|
|
87
|
+
"css": "postcss src/item.css -d dist -m",
|
|
88
|
+
"ci": "npm ci",
|
|
89
|
+
"np": "np",
|
|
90
|
+
"tsup": "tsup",
|
|
91
|
+
"publint": "publint",
|
|
63
92
|
"lint": "eslint src/**/*.ts",
|
|
64
|
-
"cem": "wireit",
|
|
65
|
-
"css": "wireit",
|
|
66
93
|
"act": "act --container-architecture linux/arm64 -W .github/workflows/pkgr-release.yml",
|
|
67
|
-
"vite": "vite",
|
|
68
94
|
"stylelint": "stylelint \"src/**/*.css\"",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
95
|
+
"test": "vitest run",
|
|
96
|
+
"attw": "attw --profile esm-only --pack --exclude-entrypoints ./item.css ./react",
|
|
71
97
|
"chromatic": "node chromatic-runner.cjs",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
98
|
+
"prepare": "husky",
|
|
99
|
+
"clean": "rm -rf dist cdn",
|
|
100
|
+
"madge": "madge --circular --extensions ts src"
|
|
74
101
|
},
|
|
75
102
|
"peerDependencies": {
|
|
76
103
|
"@heximal/templates": "^0.1.5",
|
|
@@ -79,7 +106,7 @@
|
|
|
79
106
|
},
|
|
80
107
|
"devDependencies": {
|
|
81
108
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
82
|
-
"@chromatic-com/storybook": "^4.
|
|
109
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
83
110
|
"@commitlint/cli": "^19.8.1",
|
|
84
111
|
"@commitlint/config-conventional": "^19.8.1",
|
|
85
112
|
"@custom-elements-manifest/analyzer": "^0.10.4",
|
|
@@ -87,12 +114,12 @@
|
|
|
87
114
|
"@heximal/templates": "0.1.5",
|
|
88
115
|
"@lit/context": "^1.1.5",
|
|
89
116
|
"@open-wc/lit-helpers": "^0.7.0",
|
|
90
|
-
"@storybook/addon-a11y": "^9.
|
|
91
|
-
"@storybook/addon-docs": "^9.
|
|
92
|
-
"@storybook/addon-links": "^9.
|
|
93
|
-
"@storybook/addon-themes": "^9.
|
|
94
|
-
"@storybook/addon-vitest": "^9.
|
|
95
|
-
"@storybook/web-components-vite": "^9.
|
|
117
|
+
"@storybook/addon-a11y": "^9.1.5",
|
|
118
|
+
"@storybook/addon-docs": "^9.1.5",
|
|
119
|
+
"@storybook/addon-links": "^9.1.5",
|
|
120
|
+
"@storybook/addon-themes": "^9.1.5",
|
|
121
|
+
"@storybook/addon-vitest": "^9.1.5",
|
|
122
|
+
"@storybook/web-components-vite": "^9.1.5",
|
|
96
123
|
"@swc/core": "^1.12.1",
|
|
97
124
|
"@testing-library/dom": "^10.4.0",
|
|
98
125
|
"@types/dom-view-transitions": "^1.0.6",
|
|
@@ -118,14 +145,16 @@
|
|
|
118
145
|
"eslint-plugin-lit-a11y": "^5.0.1",
|
|
119
146
|
"eslint-plugin-react": "^7.37.5",
|
|
120
147
|
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
|
|
121
|
-
"eslint-plugin-storybook": "^9.
|
|
148
|
+
"eslint-plugin-storybook": "^9.1.5",
|
|
122
149
|
"eslint-plugin-wc": "^3.0.1",
|
|
123
150
|
"fast-xml-parser": "^5.2.5",
|
|
124
151
|
"globals": "^16.2.0",
|
|
125
152
|
"globby": "^14.1.0",
|
|
126
153
|
"husky": "^9.1.7",
|
|
127
154
|
"lit": "^3.3.0",
|
|
155
|
+
"nodemon": "^3.1.10",
|
|
128
156
|
"np": "^10.2.0",
|
|
157
|
+
"npm-run-all": "^4.1.5",
|
|
129
158
|
"path-browserify": "^1.0.1",
|
|
130
159
|
"pkg-pr-new": "^0.0.51",
|
|
131
160
|
"playwright": "^1.53.0",
|
|
@@ -136,9 +165,10 @@
|
|
|
136
165
|
"postcss-nesting": "^13.0.2",
|
|
137
166
|
"prettier": "3.5.3",
|
|
138
167
|
"prettier-v2": "npm:prettier@2.8.8",
|
|
168
|
+
"publint": "^0.3.12",
|
|
139
169
|
"remark-gfm": "^4.0.1",
|
|
140
170
|
"shadow-dom-testing-library": "^1.12.0",
|
|
141
|
-
"storybook": "^9.
|
|
171
|
+
"storybook": "^9.1.5",
|
|
142
172
|
"storybook-addon-tag-badges": "^2.0.1",
|
|
143
173
|
"stylelint": "^16.20.0",
|
|
144
174
|
"stylelint-config-standard": "^38.0.0",
|
|
@@ -159,75 +189,6 @@
|
|
|
159
189
|
"url": "https://github.com/Citolab/qti-components/issues"
|
|
160
190
|
},
|
|
161
191
|
"homepage": "https://github.com/Citolab/qti-components#readme",
|
|
162
|
-
"wireit": {
|
|
163
|
-
"storybook": {
|
|
164
|
-
"command": "storybook dev -p 6006",
|
|
165
|
-
"dependencies": [
|
|
166
|
-
"storybook:cem:watch"
|
|
167
|
-
]
|
|
168
|
-
},
|
|
169
|
-
"yalc": {
|
|
170
|
-
"command": "yalc push",
|
|
171
|
-
"dependencies": [
|
|
172
|
-
"build"
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
"build": {
|
|
176
|
-
"command": "tsup",
|
|
177
|
-
"dependencies": [
|
|
178
|
-
"cem",
|
|
179
|
-
"css"
|
|
180
|
-
],
|
|
181
|
-
"files": [
|
|
182
|
-
"src/**/*.css",
|
|
183
|
-
"src/**/*.ts",
|
|
184
|
-
"tsconfig.json",
|
|
185
|
-
"package.json",
|
|
186
|
-
"tsup.config.ts"
|
|
187
|
-
]
|
|
188
|
-
},
|
|
189
|
-
"cem": {
|
|
190
|
-
"command": "cem analyze && cp ./custom-elements.json ./dist/"
|
|
191
|
-
},
|
|
192
|
-
"test": {
|
|
193
|
-
"command": "vitest run"
|
|
194
|
-
},
|
|
195
|
-
"test-storybook": {
|
|
196
|
-
"command": "vitest --project=stories"
|
|
197
|
-
},
|
|
198
|
-
"css": {
|
|
199
|
-
"command": "postcss src/item.css -d dist -m"
|
|
200
|
-
},
|
|
201
|
-
"build-storybook": {
|
|
202
|
-
"command": "storybook build",
|
|
203
|
-
"dependencies": [
|
|
204
|
-
"cem"
|
|
205
|
-
]
|
|
206
|
-
},
|
|
207
|
-
"storybook:docs": {
|
|
208
|
-
"command": "storybook dev --docs -c .storybook-docs",
|
|
209
|
-
"dependencies": [
|
|
210
|
-
"storybook:cem:watch"
|
|
211
|
-
]
|
|
212
|
-
},
|
|
213
|
-
"storybook:docs:build": {
|
|
214
|
-
"command": "storybook build --docs -c .storybook-docs --output-dir docs",
|
|
215
|
-
"dependencies": [
|
|
216
|
-
"cem"
|
|
217
|
-
]
|
|
218
|
-
},
|
|
219
|
-
"storybook:cem:watch": {
|
|
220
|
-
"command": "cem analyze --watch",
|
|
221
|
-
"service": {
|
|
222
|
-
"readyWhen": {
|
|
223
|
-
"lineMatches": "Created new manifest."
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
"attw": {
|
|
228
|
-
"command": "attw --profile esm-only --pack --exclude-entrypoints ./item.css ./react"
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
192
|
"overrides": {
|
|
232
193
|
"storybook": "$storybook"
|
|
233
194
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-XJ2CFTZP.js";import{c as n}from"./chunk-O4RAJ3LM.js";import{a as o,d as p,i as c}from"./chunk-HKWYQB5Z.js";import{a as u}from"./chunk-QQCGUVEV.js";import{b as l}from"./chunk-3YQMAZEO.js";import{a as s}from"./chunk-LO2NM3CE.js";var a=class extends c{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(t=>{switch(console.debug("getVariables",t.tagName.toLowerCase()),t.tagName.toLowerCase()){case"qti-base-value":return{baseType:t.getAttribute("base-type"),value:t.textContent.trim(),cardinality:"single"};case"qti-variable":{let i=t.getAttribute("identifier")||"";return i==="QTI_CONTEXT"?this.qtiContext?.QTI_CONTEXT?{identifier:"QTI_CONTEXT",baseType:"record",value:this.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}:(console.warn("QTI_CONTEXT not available"),{identifier:"QTI_CONTEXT",baseType:"record",value:this.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}):this.context.variables.find(r=>r.identifier===i)||null}case"qti-multiple":{let e=t.getResult();return console.debug("values",e),e?.length>0?{identifier:"",baseType:e[0].baseType,value:e.map(r=>r.value),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{let e=t.getResult();return e?.length>0?{identifier:"",baseType:e[0].baseType,value:e.map(r=>r.value),cardinality:"ordered",type:"response"}:null}case"qti-correct":{let i=t.getAttribute("identifier")||"",e=this.context.variables.find(r=>r.identifier===i)||null;return{baseType:e.baseType,value:e.correctResponse,cardinality:e.cardinality}}default:{try{return{baseType:"integer",value:t.getResult()?.toString()||null,cardinality:"single"}}catch{console.warn("default not sufficient")}return null}}}).filter(t=>t!==null)}static{this.styles=o`
|
|
2
|
-
slot {
|
|
3
|
-
display: none;
|
|
4
|
-
}
|
|
5
|
-
`}render(){return p`<pre>${JSON.stringify(this.result,null,2)}</pre>
|
|
6
|
-
<slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};s([n()],a.prototype,"result",2),s([l({context:u,subscribe:!0}),n()],a.prototype,"context",2),s([l({context:d,subscribe:!0}),n()],a.prototype,"qtiContext",2);export{a};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-HKWYQB5Z.js";var o=r`
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
cursor: pointer;
|
|
5
|
-
padding: 0.5rem 1rem;
|
|
6
|
-
border-radius: 0.25rem;
|
|
7
|
-
user-select: none;
|
|
8
|
-
`,t=r`
|
|
9
|
-
background-color: lightgray;
|
|
10
|
-
${o};
|
|
11
|
-
`,n=r`
|
|
12
|
-
cursor: not-allowed;
|
|
13
|
-
opacity: 0.8;
|
|
14
|
-
`,s=r`
|
|
15
|
-
${o};
|
|
16
|
-
border: 1px solid gray;
|
|
17
|
-
`;export{o as a,t as b,n as c,s as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-DP5FVJRS.js";import{b as a}from"./chunk-CZDMOYYF.js";import{a as m}from"./chunk-O4RAJ3LM.js";import{d as o,g as r,i as n}from"./chunk-HKWYQB5Z.js";import{b as i}from"./chunk-3YQMAZEO.js";import{a as s}from"./chunk-LO2NM3CE.js";var t=class extends n{createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector("template");if(!e){this.myTemplate=null;return}this.myTemplate=l(e)}_switchView(e){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:e}))}firstUpdated(e){this.addEventListener("click",()=>{this.sessionContext?.view==="scorer"?this._switchView("candidate"):this._switchView("scorer")})}render(){return o`${this.myTemplate?this.myTemplate({view:this.sessionContext?.view}):r}`}};s([i({context:a,subscribe:!0})],t.prototype,"sessionContext",2),t=s([m("test-view-toggle")],t);export{t as a};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var a=class extends Event{constructor(e,s,o,t){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=s,this.callback=o,this.subscribe=t??!1}};var d=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,s=!1){let o=s||!Object.is(e,this.o);this.o=e,o&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(let[s,{disposer:o}]of this.subscriptions)s(this.o,o)},e!==void 0&&(this.value=e)}addCallback(e,s,o){if(!o)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:s});let{disposer:t}=this.subscriptions.get(e);e(this.value,t)}clearCallbacks(){this.subscriptions.clear()}};var l=class extends Event{constructor(e,s){super("context-provider",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=s}},h=class extends d{constructor(e,s,o){super(s.context!==void 0?s.initialValue:o),this.onContextRequest=t=>{if(t.context!==this.context)return;let i=t.contextTarget??t.composedPath()[0];i!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,i,t.subscribe))},this.onProviderRequest=t=>{if(t.context!==this.context||(t.contextTarget??t.composedPath()[0])===this.host)return;let i=new Set;for(let[n,{consumerHost:c}]of this.subscriptions)i.has(n)||(i.add(n),c.dispatchEvent(new a(this.context,c,n,!0)));t.stopPropagation()},this.host=e,s.context!==void 0?this.context=s.context:this.context=s,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new l(this.context,this.host))}};function x({context:r}){return(e,s)=>{let o=new WeakMap;if(typeof s=="object")return{get(){return e.get.call(this)},set(t){return o.get(this).setValue(t),e.set.call(this,t)},init(t){return o.set(this,new h(this,{context:r,initialValue:t})),t}};{e.constructor.addInitializer(n=>{o.set(n,new h(n,{context:r}))});let t=Object.getOwnPropertyDescriptor(e,s),i;if(t===void 0){let n=new WeakMap;i={get(){return n.get(this)},set(c){o.get(this).setValue(c),n.set(this,c)},configurable:!0,enumerable:!0}}else{let n=t.set;i={...t,set(c){o.get(this).setValue(c),n?.call(this,c)}}}return void Object.defineProperty(e,s,i)}}}var u=class{constructor(e,s,o,t){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(i,n)=>{this.unsubscribe&&(this.unsubscribe!==n&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=i,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(i,n)),this.unsubscribe=n},this.host=e,s.context!==void 0){let i=s;this.context=i.context,this.callback=i.callback,this.subscribe=i.subscribe??!1}else this.context=s,this.callback=o,this.subscribe=t??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new a(this.context,this.host,this.t,this.subscribe))}};function b({context:r,subscribe:e}){return(s,o)=>{typeof o=="object"?o.addInitializer(function(){new u(this,{context:r,callback:t=>{s.set.call(this,t)},subscribe:e})}):s.constructor.addInitializer(t=>{new u(t,{context:r,callback:i=>{t[o]=i},subscribe:e})})}}export{x as a,b};
|
|
2
|
-
/*! Bundled license information:
|
|
3
|
-
|
|
4
|
-
@lit/context/lib/context-request-event.js:
|
|
5
|
-
@lit/context/lib/value-notifier.js:
|
|
6
|
-
@lit/context/lib/controllers/context-provider.js:
|
|
7
|
-
@lit/context/lib/controllers/context-consumer.js:
|
|
8
|
-
@lit/context/lib/create-context.js:
|
|
9
|
-
@lit/context/lib/context-root.js:
|
|
10
|
-
(**
|
|
11
|
-
* @license
|
|
12
|
-
* Copyright 2021 Google LLC
|
|
13
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
14
|
-
*)
|
|
15
|
-
|
|
16
|
-
@lit/context/lib/decorators/provide.js:
|
|
17
|
-
(**
|
|
18
|
-
* @license
|
|
19
|
-
* Copyright 2017 Google LLC
|
|
20
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*)
|
|
22
|
-
|
|
23
|
-
@lit/context/lib/decorators/consume.js:
|
|
24
|
-
(**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2022 Google LLC
|
|
27
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*)
|
|
29
|
-
*/
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as P}from"./chunk-DP5FVJRS.js";import{g as S}from"./chunk-G76Y52EL.js";import{a as V}from"./chunk-E6IOJ4MV.js";import{a as R,b as M}from"./chunk-CZDMOYYF.js";import{a as w,b as x}from"./chunk-QQR6POPY.js";import{a as E,b as o}from"./chunk-O4RAJ3LM.js";import{a as L,d,i as p}from"./chunk-HKWYQB5Z.js";import{a as I,b as _}from"./chunk-3YQMAZEO.js";import{a as i}from"./chunk-LO2NM3CE.js";var k=(e=>(e.ITEM_NOT_FOUND="item-not-found",e.SECTION_NOT_FOUND="section-not-found",e.LOAD_ERROR="load-error",e.NETWORK_ERROR="network-error",e.TIMEOUT_ERROR="timeout-error",e))(k||{}),D=m=>{class c extends m{constructor(...t){super(...t);this.navigate=null;this.cacheTransform=!1;this.requestTimeout=3e4;this.showLoadingIndicators=!0;this.postLoadTransformCallback=null;this._navigationInProgress=!1;this._activeRequests=[];this._lastError=null;this._lastNavigationRequestId=null;this._targetNavigation=null;this.addEventListener("qti-request-navigation",async({detail:e})=>{if(!e?.id)return;let s=`nav_${Date.now()}_${Math.random()}`;this._lastNavigationRequestId=s;try{if(this._navigationInProgress=!0,this._lastError=null,this._dispatchStatusEvent({loading:!0,type:e.type,id:e.id}),this._cancelActiveRequests(),this._targetNavigation={type:e.type,id:e.id},e.type==="item"?await this._navigateToItem(e.id):e.type==="section"&&await this._navigateToSection(e.id),this._lastNavigationRequestId!==s){console.log("Navigation was superseded by a newer request");return}}catch(u){if(this._lastNavigationRequestId===s){let a=this._normalizeError(u,e.type,e.id);this._lastError=a,this._dispatchErrorEvent(a),console.error(`Navigation error (${a.type}):`,a.message,a.details)}}finally{this._lastNavigationRequestId===s&&(this._navigationInProgress=!1,this._dispatchStatusEvent({loading:!1,type:e.type,id:e.id}))}}),this.addEventListener("qti-assessment-test-connected",e=>{this._testElement=e.detail,this._initializeNavigation()})}_initializeNavigation(){let t;this.navigate==="section"&&(t=this._testElement.querySelector("qti-assessment-section")?.identifier),this.navigate==="item"&&(t=this.sessionContext.navItemRefId??this._testElement.querySelector("qti-assessment-item-ref")?.identifier),t&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:this.navigate==="section"?"section":"item",id:t},bubbles:!0,composed:!0}))}navigateTo(t,e){e||(t==="section"&&(e=this._testElement?.querySelector("qti-assessment-section")?.identifier),t==="item"&&(e=this._testElement?.querySelector("qti-assessment-item-ref")?.identifier)),this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}async _navigateToItem(t){let e=this._testElement?.querySelector(`qti-assessment-item-ref[identifier="${t}"]`);if(!e)throw{type:"item-not-found",message:`Item with identifier "${t}" not found.`,itemId:t};let s=e.closest("qti-test-part")?.identifier,u=e.closest("qti-assessment-section")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:u,navItemRefId:t,navItemLoading:!0};try{await this._loadItems([t])}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}async _navigateToSection(t){let e=this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`);if(!e)throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};let s=e.closest("qti-test-part")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:t,navItemRefId:null,navItemLoading:!0};try{let u=this._getSectionItemIds(t);await this._loadItems(u)}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}_normalizeError(t,e,s){return t&&t.type&&Object.values(k).includes(t.type)?t:t instanceof DOMException&&t.name==="AbortError"?{type:"network-error",message:"Navigation was cancelled because a new navigation was requested.",details:t}:t.name==="TimeoutError"||t.message&&t.message.includes("timeout")?{type:"timeout-error",message:"Request timed out. Please check your network connection.",details:t}:t instanceof TypeError&&t.message.includes("network")?{type:"network-error",message:"A network error occurred. Please check your connection.",details:t}:{type:"load-error",message:`Failed to load ${e}: ${s}`,details:t,itemId:e==="item"?s:void 0,sectionId:e==="section"?s:void 0}}_dispatchErrorEvent(t){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:t,bubbles:!0,composed:!0}))}_dispatchStatusEvent(t){this.showLoadingIndicators&&this.dispatchEvent(new CustomEvent("qti-navigation-status",{detail:t,bubbles:!0,composed:!0}))}_cancelActiveRequests(){this._activeRequests.length>0&&(console.info(`Cancelling ${this._activeRequests.length} pending requests`),this._activeRequests.forEach(t=>{t&&t.readyState!==4&&t.abort()}),this._activeRequests=[])}async _loadItems(t){if(!this._testElement||t.length===0)return;let e=t.map(a=>this._testElement.querySelector(`qti-assessment-item-ref[identifier="${a}"]`)),s=e.reduce((a,v,l)=>(v||a.push(t[l]),a),[]);if(s.length>0)throw{type:"item-not-found",message:`One or more items not found: ${s.join(", ")}`,details:{missingItems:s}};this._clearLoadedItems();let u=e.map(async a=>{if(!a)return null;let v=new Promise((l,b)=>{setTimeout(()=>{b({name:"TimeoutError",message:`Request for item ${a.identifier} timed out after ${this.requestTimeout}ms`})},this.requestTimeout)});try{let{promise:l,request:b}=V(this.cacheTransform).load(a.href);b instanceof XMLHttpRequest&&this._activeRequests.push(b);let N=await Promise.race([l,v]),A=N;return console.log(`Loaded item 123: ${a.identifier}`),this.postLoadTransformCallback&&(A=await this.postLoadTransformCallback(N,a)),{itemRef:a,doc:A.htmlDoc(),request:b}}catch(l){if(l instanceof DOMException&&l.name==="AbortError"||l&&l.name==="TimeoutError")return console.log(`Request for item ${a.identifier} was ${l.name==="TimeoutError"?"timed out":"aborted"}`),null;throw l.itemId=a.identifier,l}});try{let v=(await Promise.all(u)).filter(l=>l!==null);if(v.forEach(({itemRef:l,doc:b})=>{l&&b&&(l.xmlDoc=b)}),this._activeRequests=[],requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:v.map(({itemRef:l})=>({identifier:l?.identifier,element:l})),bubbles:!0,composed:!0}))}),v.length===0&&t.length>0)throw{type:"load-error",message:"All item requests failed to load",details:{itemIds:t}};return v}catch(a){throw console.error("Error loading items:",a),a}}_getSectionItemIds(t){if(!this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`))throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};return Array.from(this._testElement.querySelectorAll(`qti-assessment-section[identifier="${t}"] > qti-assessment-item-ref`)).map(s=>s.identifier)}_clearLoadedItems(){let t=this._testElement?.querySelectorAll("qti-assessment-test qti-assessment-item-ref");Array.from(t||[]).forEach(e=>{e.xmlDoc=null})}retryNavigation(){if(this._lastError){let t=this._lastError.itemId?"item":"section",e=this._lastError.itemId||this._lastError.sectionId;e&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}else this._targetNavigation&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:this._targetNavigation,bubbles:!0,composed:!0}))}}return i([o({type:String})],c.prototype,"navigate",2),i([o({type:Boolean,attribute:"cache-transform"})],c.prototype,"cacheTransform",2),i([o({type:Number})],c.prototype,"requestTimeout",2),i([o({type:Boolean})],c.prototype,"showLoadingIndicators",2),i([o({type:Function})],c.prototype,"postLoadTransformCallback",2),c};var $=m=>{class c extends m{constructor(...n){super(...n),this.sessionContext={...this.sessionContext,view:"candidate"},this.addEventListener("on-test-switch-view",t=>{this.sessionContext={...this.sessionContext,view:t.detail},this._updateElementView()}),this.addEventListener("qti-assessment-test-connected",()=>{this._updateElementView()}),this.addEventListener("qti-assessment-item-connected",t=>{this._updateElementView(),this._setCorrectResponseVisibility(t.detail)})}willUpdate(n){super.willUpdate(n),n.has("sessionContext")&&this._updateElementView()}_updateElementView(){if(this._testElement){Array.from(this._testElement.querySelectorAll("[view]")).forEach(s=>{s.classList.toggle("show",s.getAttribute("view")===this.sessionContext.view)});let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this.sessionContext.navItemRefId}"]`)?.assessmentItem;e&&e.showCorrectResponse(this.sessionContext.view==="scorer")}}_setCorrectResponseVisibility(n){n.showCorrectResponse(this.sessionContext.view==="scorer")}}return c};var q=class extends p{constructor(){super();this.testContext=w;this.sessionContext=R;this._updateItemInTestContext=r=>{let n=r._context,t=n.identifier,e=n.variables,s=this.testContext.items.find(u=>u?.identifier===t);if(!s){console.warn(`Item IDs between assessment.xml and item.xml should match: ${t} is not found!`);return}s.variables?.length===1?this._updateItemVariablesInTestContext(t,e):r.variables=[...s.variables||[]]};this.addEventListener("qti-assessment-test-connected",r=>{if(this.testContext=w,this.sessionContext=R,this.testContext&&this.testContext.items.length>0)return;this._testElement=r.detail;let n=Array.from(this._testElement.querySelectorAll("qti-assessment-item-ref")).map(t=>({href:t.href,identifier:t.identifier,category:t.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}));this.testContext={...this.testContext,items:n}}),this.addEventListener("qti-assessment-item-connected",r=>{let n=r.detail,t=n.closest("qti-assessment-item-ref")?.identifier;t&&(n.assessmentItemRefId=t),this._updateItemInTestContext(r.detail)}),this.addEventListener("qti-item-context-updated",r=>{this._updateItemVariablesInTestContext(r.detail.itemContext.identifier,r.detail.itemContext.variables)})}updateItemVariables(r,n){let t=this.testContext.items.find(s=>s.identifier===r);t&&(t.variables=t.variables.map(s=>{let u=n.find(a=>a.identifier===s.identifier);return u?{...s,...u}:s}));let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${r}"]`);e&&e.assessmentItem&&e.assessmentItem&&(e.assessmentItem.variables=n)}_updateItemVariablesInTestContext(r,n){this.testContext={...this.testContext,items:this.testContext.items.map(t=>t.identifier!==r?t:{...t,variables:n.map(e=>{let s=t.variables.find(u=>u.identifier===e.identifier);return s?{...s,...e}:e})})},this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}};i([o({attribute:!1,type:Object}),I({context:x})],q.prototype,"testContext",2),i([o({attribute:!1,type:Object}),I({context:M})],q.prototype,"sessionContext",2);var B=m=>{class c extends m{constructor(...n){super(...n),this.addEventListener("qti-register-variable",t=>{this.testContext={...this.testContext,testOutcomeVariables:[...this.testContext.testOutcomeVariables||[],t.detail.variable]},t.stopPropagation()}),this.addEventListener("qti-set-outcome-value",t=>{let{outcomeIdentifier:e,value:s}=t.detail;this.updateOutcomeVariable(e,s),t.stopPropagation()})}outcomeProcessing(){let n=this.querySelector("qti-outcome-processing");return n?(n?.process(),!0):!1}updateOutcomeVariable(n,t){let e=this.getOutcome(n);if(!e){console.warn(`Can not set qti-outcome-identifier: ${n}, it is not available`);return}this.testContext={...this.testContext,testOutcomeVariables:this.testContext.testOutcomeVariables?.map(s=>s.identifier!==n?s:{...s,value:e.cardinality==="single"?t:[...s.value,t]})}}getOutcome(n){return this.getVariable(n)}getVariable(n){return this.testContext.testOutcomeVariables?.find(t=>t.identifier===n)||null}}return c};var T=class extends D($(B(q))){async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}))}render(){return d`<slot></slot>`}};T=i([E("qti-test")],T);var H={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},f=class extends p{constructor(){super(...arguments);this.weigths=new Map}createRenderRoot(){return this}get assessmentItem(){return this.renderRoot?.querySelector("qti-assessment-item")}async connectedCallback(){super.connectedCallback();let r=this.getRootNode().host.closest("qti-test").querySelector("template[item-ref]");r&&(this.myTemplate=P(r)),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-item-ref-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href,category:this.category}}))}render(){return this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}};i([o({type:String})],f.prototype,"category",2),i([o({type:String})],f.prototype,"identifier",2),i([o({type:Boolean,converter:H})],f.prototype,"required",2),i([o({type:Boolean,converter:H})],f.prototype,"fixed",2),i([o({type:String})],f.prototype,"href",2),i([o({type:Object,attribute:!1})],f.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",f);var O={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},h=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){this._title=this.getAttribute("title")||"",super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}))}render(){return d`<slot name="qti-rubric-block"></slot><slot></slot>`}};i([o({type:String})],h.prototype,"identifier",2),i([o({type:String})],h.prototype,"required",2),i([o({type:Boolean,converter:O})],h.prototype,"fixed",2),i([o({type:Boolean,converter:O})],h.prototype,"visible",2),i([o({type:Boolean,converter:O,attribute:"keep-together"})],h.prototype,"keepTogether",2),i([_({context:x,subscribe:!0})],h.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",h);var y=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],y.prototype,"identifier",2),i([o({type:String})],y.prototype,"title",1),i([_({context:x,subscribe:!0})],y.prototype,"_testContext",2),y=i([E("qti-assessment-test")],y);var g=class extends p{constructor(){super(...arguments);this.identifier="";this.class="";this.navigationMode="nonlinear";this.submissionMode="individual";this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],g.prototype,"identifier",2),i([o({type:String})],g.prototype,"class",2),i([o({type:String,attribute:"navigation-mode"})],g.prototype,"navigationMode",2),i([o({type:String,attribute:"submission-mode"})],g.prototype,"submissionMode",2),g=i([E("qti-test-part")],g);customElements.get("qti-test-part")||customElements.define("qti-test-part",g);var C=class extends S{render(){return d``}};C.styles=L`
|
|
2
|
-
:host {
|
|
3
|
-
color: gray;
|
|
4
|
-
}
|
|
5
|
-
`,C=i([E("qti-test-feedback")],C);export{T as a,f as b,h as c,y as d,g as e,C as f};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as m,c as n}from"./chunk-3CVBBZDT.js";import{a as l,b as o}from"./chunk-O4RAJ3LM.js";import{a as s,d as i,i as r}from"./chunk-HKWYQB5Z.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends r{constructor(){super();this.itemId=null;this.addEventListener("click",()=>this._requestItem(this.itemId))}_requestItem(a){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:a}}))}render(){return i` <slot></slot> `}};t.styles=s`
|
|
2
|
-
:host {
|
|
3
|
-
${m};
|
|
4
|
-
}
|
|
5
|
-
:host([disabled]) {
|
|
6
|
-
${n};
|
|
7
|
-
}
|
|
8
|
-
`,e([o({type:String,attribute:"item-id"})],t.prototype,"itemId",2),t=e([l("test-item-link")],t);export{t as a};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as u,c as h}from"./chunk-3CVBBZDT.js";import{a as p}from"./chunk-XUJ7TXHW.js";import{a as c}from"./chunk-P6SSTAJ2.js";import{a,b as l}from"./chunk-O4RAJ3LM.js";import{a as m,d as r,i as d}from"./chunk-HKWYQB5Z.js";import{b as n}from"./chunk-3YQMAZEO.js";import{a as s}from"./chunk-LO2NM3CE.js";var t=class extends d{constructor(){super();this._internalDisabled=!0;this.addEventListener("click",e=>{e.preventDefault(),this._internalDisabled||this._requestItem(this.sectionItems[this.itemIndex-1].identifier)})}_handleTestElementChange(e,o){o&&(this._internalDisabled=!1)}willUpdate(e){if(!this.computedContext)return;let o=this.computedContext?.testParts.find(i=>i.active);o&&(this.sectionItems=o.sections.flatMap(i=>i.items),this.itemIndex=this.sectionItems.findIndex(i=>i.active),this.checkDisabled())}checkDisabled(){this._internalDisabled=!this.computedContext||this.itemIndex===0||this.itemIndex===-1}_requestItem(e){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:e}}))}render(){return r`<slot></slot>`}};t.styles=m`
|
|
2
|
-
:host {
|
|
3
|
-
${u};
|
|
4
|
-
}
|
|
5
|
-
:host([disabled]) {
|
|
6
|
-
${h};
|
|
7
|
-
}
|
|
8
|
-
`,s([l({type:Boolean,reflect:!0,attribute:"disabled"})],t.prototype,"_internalDisabled",2),s([n({context:c,subscribe:!0})],t.prototype,"computedContext",2),s([p("computedContext")],t.prototype,"_handleTestElementChange",1),t=s([a("test-prev")],t);export{t as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-P6SSTAJ2.js";import{a as p,c}from"./chunk-O4RAJ3LM.js";import{d as m,i as r}from"./chunk-HKWYQB5Z.js";import{b as o}from"./chunk-3YQMAZEO.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends r{render(){return m` <small><pre>${JSON.stringify(this.computedContext,null,2)}</pre></small> `}};e([c(),o({context:l,subscribe:!0})],t.prototype,"computedContext",2),t=e([p("test-print-context")],t);export{t as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Symbol("configContext");export{t as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n={view:"candidate"},o=Symbol("testContext");export{n as a,o as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-DP5FVJRS.js";import{a as l}from"./chunk-P6SSTAJ2.js";import{a as p}from"./chunk-O4RAJ3LM.js";import{d as m,i as a}from"./chunk-HKWYQB5Z.js";import{b as n}from"./chunk-3YQMAZEO.js";import{a as r}from"./chunk-LO2NM3CE.js";var t=class extends a{createRenderRoot(){return this}constructor(){super(),this._internals=this.attachInternals(),this._internals.ariaLabel="pagination"}connectedCallback(){super.connectedCallback();let e=this.querySelector("template");this.myTemplate=s(e)}render(){if(!this.computedContext)return m``;let e=this.computedContext.testParts.flatMap(o=>o.sections);return m` ${e.map(o=>this.myTemplate({item:o}))} `}};r([n({context:l,subscribe:!0})],t.prototype,"computedContext",2),t=r([p("test-section-buttons-stamp")],t);export{t as a};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{f as $,g as U,h as E}from"./chunk-HKWYQB5Z.js";var w=["this"],W=["+","-","!"],F=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],C={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},A=13;var Q=["==","!=","<=",">=","||","&&","??","|>"],J=["===","!=="],n;(function(e){e[e.STRING=1]="STRING",e[e.IDENTIFIER=2]="IDENTIFIER",e[e.DOT=3]="DOT",e[e.COMMA=4]="COMMA",e[e.COLON=5]="COLON",e[e.INTEGER=6]="INTEGER",e[e.DECIMAL=7]="DECIMAL",e[e.OPERATOR=8]="OPERATOR",e[e.GROUPER=9]="GROUPER",e[e.KEYWORD=10]="KEYWORD",e[e.ARROW=11]="ARROW"})(n||(n={}));var v=(e,t,r=0)=>({kind:e,value:t,precedence:r}),Z=e=>e===9||e===10||e===13||e===32,H=e=>e===95||e===36||(e&=-33,65<=e&&e<=90),K=e=>H(e)||x(e),tt=e=>w.indexOf(e)!==-1,et=e=>e===34||e===39,x=e=>48<=e&&e<=57,rt=e=>e===43||e===45||e===42||e===47||e===33||e===38||e===37||e===60||e===61||e===62||e===63||e===94||e===124,st=e=>e===40||e===41||e===91||e===93||e===123||e===125,it=e=>e.replace(/\\(.)/g,(t,r)=>{switch(r){case"n":return`
|
|
2
|
-
`;case"r":return"\r";case"t":return" ";case"b":return"\b";case"f":return"\f";default:return r}}),N=class{#i;#a=-1;#s=0;#e;constructor(t){this.#i=t,this.#t()}nextToken(){for(;Z(this.#e);)this.#t(!0);if(et(this.#e))return this.#u();if(H(this.#e))return this.#l();if(x(this.#e))return this.#c();if(this.#e===46)return this.#o();if(this.#e===44)return this.#p();if(this.#e===58)return this.#h();if(rt(this.#e))return this.#d();if(st(this.#e))return this.#m();if(this.#t(),this.#e!==void 0)throw new Error(`Expected end of input, got ${this.#e}`)}#t(t){this.#a++,this.#a<this.#i.length?(this.#e=this.#i.charCodeAt(this.#a),t===!0&&(this.#s=this.#a)):this.#e=void 0}#r(t=0){let r=this.#i.substring(this.#s,this.#a+t);return t===0&&this.#n(),r}#n(){this.#s=this.#a}#u(){let t="unterminated string",r=this.#e;for(this.#t(!0);this.#e!==r;){if(this.#e===void 0)throw new Error(t);if(this.#e===92&&(this.#t(),this.#e===void 0))throw new Error(t);this.#t()}let s=v(n.STRING,it(this.#r()));return this.#t(),s}#l(){do this.#t();while(K(this.#e));let t=this.#r(),r=tt(t)?n.KEYWORD:n.IDENTIFIER;return v(r,t)}#c(){do this.#t();while(x(this.#e));return this.#e===46?this.#o():v(n.INTEGER,this.#r())}#o(){return this.#t(),x(this.#e)?this.#f():(this.#n(),v(n.DOT,".",A))}#p(){return this.#t(!0),v(n.COMMA,",")}#h(){return this.#t(!0),v(n.COLON,":")}#f(){do this.#t();while(x(this.#e));return v(n.DECIMAL,this.#r())}#d(){this.#t();let t=this.#r(2);if(J.indexOf(t)!==-1)this.#t(),this.#t();else{if(t=this.#r(1),t==="=>")return this.#t(),v(n.ARROW,t);Q.indexOf(t)!==-1&&this.#t()}return t=this.#r(),v(n.OPERATOR,t,C[t])}#m(){let t=String.fromCharCode(this.#e),r=v(n.GROUPER,t,C[t]);return this.#t(!0),r}};var k=(e,t)=>new y(e,t).parse(),y=class{#i;#a;#s;#e;#t;constructor(t,r){this.#a=new N(t),this.#s=r}parse(){return this.#r(),this.#n()}#r(t,r){if(!this._matches(t,r))throw new Error(`Expected kind ${t} (${r}), was ${this.#e?.kind} (${this.#e?.value})`);let s=this.#a.nextToken();this.#e=s,this.#i=s?.kind,this.#t=s?.value}_matches(t,r){return!(t&&this.#i!==t||r&&this.#t!==r)}#n(){if(!this.#e)return this.#s.empty();let t=this.#o();return t===void 0?void 0:this.#u(t,0)}#u(t,r){if(t===void 0)throw new Error("Expected left to be defined.");for(;this.#e;)if(this._matches(n.GROUPER,"(")){let s=this.#E();t=this.#s.invoke(t,void 0,s)}else if(this._matches(n.GROUPER,"[")){let s=this.#g();t=this.#s.index(t,s)}else if(this._matches(n.DOT)){this.#r();let s=this.#o();t=this.#l(t,s)}else{if(this._matches(n.KEYWORD))break;if(this._matches(n.OPERATOR)&&this.#e.precedence>=r)t=this.#t==="?"?this.#p(t):this.#c(t,this.#e);else break}return t}#l(t,r){if(r===void 0)throw new Error("expected identifier");if(r.type==="ID")return this.#s.getter(t,r.value);if(r.type==="Invoke"&&r.receiver.type==="ID"){let s=r.receiver;return this.#s.invoke(t,s.value,r.arguments)}else throw new Error(`expected identifier: ${r}`)}#c(t,r){if(F.indexOf(r.value)===-1)throw new Error(`unknown operator: ${r.value}`);this.#r();let s=this.#o();for(;(this.#i===n.OPERATOR||this.#i===n.DOT||this.#i===n.GROUPER)&&this.#e.precedence>r.precedence;)s=this.#u(s,this.#e.precedence);return this.#s.binary(t,r.value,s)}#o(){if(this._matches(n.OPERATOR)){let t=this.#t;if(this.#r(),t==="+"||t==="-"){if(this._matches(n.INTEGER))return this.#R(t);if(this._matches(n.DECIMAL))return this.#O(t)}if(W.indexOf(t)===-1)throw new Error(`unexpected token: ${t}`);let r=this.#u(this.#h(),A);return this.#s.unary(t,r)}return this.#h()}#p(t){this.#r(n.OPERATOR,"?");let r=this.#n();this.#r(n.COLON);let s=this.#n();return this.#s.ternary(t,r,s)}#h(){switch(this.#i){case n.KEYWORD:let t=this.#t;if(t==="this")return this.#r(),this.#s.id(t);throw w.indexOf(t)!==-1?new Error(`unexpected keyword: ${t}`):new Error(`unrecognized keyword: ${t}`);case n.IDENTIFIER:return this.#m();case n.STRING:return this.#y();case n.INTEGER:return this.#R();case n.DECIMAL:return this.#O();case n.GROUPER:return this.#t==="("?this.#x():this.#t==="{"?this.#d():this.#t==="["?this.#f():void 0;case n.COLON:throw new Error('unexpected token ":"');default:return}}#f(){let t=[];do{if(this.#r(),this._matches(n.GROUPER,"]"))break;t.push(this.#n())}while(this._matches(n.COMMA));return this.#r(n.GROUPER,"]"),this.#s.list(t)}#d(){let t={};do{if(this.#r(),this._matches(n.GROUPER,"}"))break;let r=this.#t;(this._matches(n.STRING)||this._matches(n.IDENTIFIER))&&this.#r(),this.#r(n.COLON),t[r]=this.#n()}while(this._matches(n.COMMA));return this.#r(n.GROUPER,"}"),this.#s.map(t)}#m(){let t=this.#t;if(t==="true")return this.#r(),this.#s.literal(!0);if(t==="false")return this.#r(),this.#s.literal(!1);if(t==="null")return this.#r(),this.#s.literal(null);if(t==="undefined")return this.#r(),this.#s.literal(void 0);let r=this.#v(),s=this.#E();return s?this.#s.invoke(r,void 0,s):r}#v(){if(!this._matches(n.IDENTIFIER))throw new Error(`expected identifier: ${this.#t}`);let t=this.#t;return this.#r(),this.#s.id(t)}#E(){if(!this._matches(n.GROUPER,"("))return;let t=[];do{if(this.#r(),this._matches(n.GROUPER,")"))break;let r=this.#n();t.push(r)}while(this._matches(n.COMMA));return this.#r(n.GROUPER,")"),t}#g(){this.#r();let t=this.#n();return this.#r(n.GROUPER,"]"),t}#x(){let t=this.#E();if(this._matches(n.ARROW)){this.#r();let r=this.#n(),s=t?.map(i=>i.value)??[];return this.#s.arrowFunction(s,r)}else return this.#s.paren(t[0])}#y(){let t=this.#s.literal(this.#t);return this.#r(),t}#R(t=""){let r=this.#s.literal(parseInt(`${t}${this.#t}`,10));return this.#r(),r}#O(t=""){let r=this.#s.literal(parseFloat(`${t}${this.#t}`));return this.#r(),r}};var{hasOwn:B,fromEntries:nt}=Object,at={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"||":(e,t)=>e||t,"&&":(e,t)=>e&&t,"??":(e,t)=>e??t,"|":(e,t)=>t(e),"|>":(e,t)=>t(e)},ot={"+":e=>e,"-":e=>-e,"!":e=>!e},_=class{empty(){return{type:"Empty",evaluate(t){return t},getIds(t){return t}}}literal(t){return{type:"Literal",value:t,evaluate(r){return this.value},getIds(r){return r}}}id(t){return{type:"ID",value:t,evaluate(r){return this.value==="this"?r:r?.[this.value]},getIds(r){return r.push(this.value),r}}}unary(t,r){let s=ot[t];return{type:"Unary",operator:t,child:r,evaluate(i){return s(this.child.evaluate(i))},getIds(i){return this.child.getIds(i)}}}binary(t,r,s){let i=at[r];return{type:"Binary",operator:r,left:t,right:s,evaluate(o){if(this.operator==="="){if(this.left.type!=="ID"&&this.left.type!=="Getter"&&this.left.type!=="Index")throw new Error(`Invalid assignment target: ${this.left}`);let a=this.right.evaluate(o),l,u;return this.left.type==="Getter"?(l=this.left.receiver.evaluate(o),u=this.left.name):this.left.type==="Index"?(l=this.left.receiver.evaluate(o),u=this.left.argument.evaluate(o)):this.left.type==="ID"&&(l=o,u=this.left.value),l===void 0?void 0:l[u]=a}return i(this.left.evaluate(o),this.right.evaluate(o))},getIds(o){return this.left.getIds(o),this.right.getIds(o),o}}}getter(t,r){return{type:"Getter",receiver:t,name:r,evaluate(s){return this.receiver.evaluate(s)?.[this.name]},getIds(s){return this.receiver.getIds(s),s}}}invoke(t,r,s){if(r!=null&&typeof r!="string")throw new Error("method not a string");return{type:"Invoke",receiver:t,method:r,arguments:s,evaluate(i){let o=this.receiver.evaluate(i),a=this.method?o:i?.this??i,l=this.method?o?.[r]:o,c=(this.arguments??[]).map(h=>h?.evaluate(i));return l?.apply?.(a,c)},getIds(i){return this.receiver.getIds(i),this.arguments?.forEach(o=>o?.getIds(i)),i}}}paren(t){return t}index(t,r){return{type:"Index",receiver:t,argument:r,evaluate(s){return this.receiver.evaluate(s)?.[this.argument.evaluate(s)]},getIds(s){return this.receiver.getIds(s),s}}}ternary(t,r,s){return{type:"Ternary",condition:t,trueExpr:r,falseExpr:s,evaluate(i){return this.condition.evaluate(i)?this.trueExpr.evaluate(i):this.falseExpr.evaluate(i)},getIds(i){return this.condition.getIds(i),this.trueExpr.getIds(i),this.falseExpr.getIds(i),i}}}map(t){return{type:"Map",entries:t,evaluate(r){let s={};if(t&&this.entries)for(let i in t){let o=this.entries[i];o&&(s[i]=o.evaluate(r))}return s},getIds(r){if(t&&this.entries)for(let s in t){let i=this.entries[s];i&&i.getIds(r)}return r}}}list(t){return{type:"List",items:t,evaluate(r){return this.items?.map(s=>s?.evaluate(r))},getIds(r){return this.items?.forEach(s=>s?.getIds(r)),r}}}arrowFunction(t,r){return{type:"ArrowFunction",params:t,body:r,evaluate(s){let i=this.params,o=this.body;return function(...a){let l=nt(i.map((c,h)=>[c,a[h]])),u=new Proxy(s??{},{set(c,h,d){return B(l,h)&&(l[h]=d),c[h]=d},get(c,h){return B(l,h)?l[h]:c[h]}});return o.evaluate(u)}},getIds(s){return this.body.getIds(s).filter(i=>!this.params.includes(i))}}}};var D=null,Y={boundAttributeSuffix:E.M,marker:E.P,markerMatch:E.A,HTML_RESULT:E.C,getTemplateHtml:E.L,overrideDirectiveResolve:(e,t)=>class extends e{_$AS(r,s){return t(this,s)}},patchDirectiveResolve:(e,t)=>{if(e.prototype._$AS.name!==t.name){D??=e.prototype._$AS.name;for(let r=e.prototype;r!==Object.prototype;r=Object.getPrototypeOf(r))if(r.hasOwnProperty(D))return void(r[D]=t);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass(e,t){e._$litDirective$=t},getAttributePartCommittedValue:(e,t,r)=>{let s=$;return e.j=i=>s=i,e._$AI(t,e,r),s},connectedDisconnectable:e=>({...e,_$AU:!0}),resolveDirective:E.V,AttributePart:E.H,PropertyPart:E.B,BooleanAttributePart:E.N,EventPart:E.U,ElementPart:E.F,TemplateInstance:E.R,isIterable:E.D,ChildPart:E.I};var{AttributePart:ut,PropertyPart:ht,BooleanAttributePart:lt,EventPart:ct}=Y,M=new _,S=new Map,z=e=>e.replace(/-(-|\w)/g,(t,r)=>r.toUpperCase()),P=(e,t)=>{let r=S.get(e);if(r===void 0){if(S.has(e))return;if(e=e.trim(),e.startsWith("{{")&&e.endsWith("}}")){let s=e.substring(2,e.length-2).trim();r=new y(s,M).parse(),S.set(e,r)}}return r?.evaluate(t)},pt=(e,t,r,s)=>{let i=e.getAttribute("if");if(i!==null&&P(i,t))return b(e,t,r,s)},V=/(?<!\\){{(.*?)(?:(?<!\\)}})/g,j=e=>/(?:\\{{)|(?:\\}})/g.test(e),I=e=>e.replaceAll(/\\{{/g,"{{").replace(/\\}}/g,"}}"),ft=(e,t,r,s)=>{let i=e.getAttribute("repeat");if(i!==null){let o=P(i,t);if(!o[Symbol.iterator])return U;let a=T(e),l=-1,u=[];for(let c of o){l++;let h=Object.create(t);h.item=c,h.index=l,h.this=t.this??t;let d=[];for(let m of a.parts){let f=m.update(h,r,s);m.type===1?d.push(...f):d.push(f)}let p={_$litType$:a,values:d};u.push(p)}return u}},q={if:pt,repeat:ft},St=(e,t=q,r={},s)=>{let o=T(e).renderers;if(s){let l=T(s).renderers,u=o.super;u!==void 0?r={...o,...r,super:(c,h,d)=>(d={...l,...d,super:(p,m,f)=>b(s,p,m,f)},u(c,h,d))}:(r={...l,...o,...r},e=s)}else r={...o,...r};return a=>b(e,a,t,r)};var b=(e,t,r=q,s={})=>{let i=T(e),o=[];for(let l of i.parts){let u=l.update(t,r,s);l.type===1?o.push(...u):o.push(u)}return{_$litType$:i,values:o}},X=new Map,T=e=>{let t=X.get(e);return t===void 0&&X.set(e,t=dt(e)),t},dt=e=>{let t={h:void 0,el:e.cloneNode(!0),parts:[],renderers:{}},r=document.createTreeWalker(t.el.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s=r.currentNode,i=-1,o=[];for(;(s=r.nextNode())!==null;)if(s.nodeType===Node.COMMENT_NODE)i++;else if(s.nodeType===Node.ELEMENT_NODE){i++;let a=s;if(a.tagName==="TEMPLATE"){let u=a.getAttribute("type"),c=a.getAttribute("name"),h=a.getAttribute("call");if(h!==null||u!==null||c!==null){a.parentNode.insertBefore(document.createComment(""),a),o.push(a);let d;if(h!==null){let p=h.trim(),m=p.startsWith("{{")&&p.endsWith("}}");d=(f,O,R)=>{let g=a.getAttribute("data"),G=g===null?void 0:P(g,f);return(m?P(p,f):R[h])?.(G,O,R)}}else u!==null?d=(p,m,f)=>{let O=m[u];return O?.(a,p,m,f)}:(c==="super"?t.renderers.super=(p,m,f)=>{let O=f.super,R=T(a);return f={...f,...R.renderers},O(p,m,f)}:t.renderers[c]=(p,m,f)=>b(a,p,m,f),d=(p,m,f)=>{let O=f[c];return O?.(p,m,f)});t.parts.push({type:2,index:i,update:d});continue}}let l=a.getAttributeNames();for(let u of l){let c=a.getAttribute(u),h=c.split(V);if(h.length===1){j(c)&&a.setAttribute(u,I(c));continue}a.removeAttribute(u);let d=u,p=ut,m=u[0];m==="."?(d=z(u.substring(1)),p=ht):m==="?"?(d=u.substring(1),p=lt):m==="@"&&(d=z(u.substring(1)),p=ct);let f=[I(h[0])],O=[];for(let R=1;R<h.length;R+=2){let g=h[R];O.push(k(g,M)),f.push(I(h[R+1]))}t.parts.push({type:1,index:i,name:d,strings:f,ctor:p,update:(R,g,G)=>O.map(L=>L.evaluate(R))})}}else if(s.nodeType===Node.TEXT_NODE){let a=s,l=a.textContent,u=l.split(V);u.length>1?a.textContent=I(u[0]):j(l)&&(a.textContent=I(l));for(let c=1;c<u.length;c+=2){let h=u[c],d=k(h,M);t.parts.push({type:2,index:++i,update:(m,f)=>d.evaluate(m)});let p=new Text(u[c+1].replace("\\{{","{{"));a.parentNode.insertBefore(p,a.nextSibling),a.parentNode.insertBefore(document.createComment(""),a.nextSibling),a=p,r.currentNode=p}}for(let a of o)a.remove();return t};export{St as a};
|
|
3
|
-
/*! Bundled license information:
|
|
4
|
-
|
|
5
|
-
@heximal/expressions/lib/constants.js:
|
|
6
|
-
@heximal/expressions/lib/tokenizer.js:
|
|
7
|
-
@heximal/expressions/lib/parser.js:
|
|
8
|
-
@heximal/expressions/lib/ast_factory.js:
|
|
9
|
-
@heximal/expressions/lib/eval.js:
|
|
10
|
-
(*
|
|
11
|
-
* @license
|
|
12
|
-
* Portions Copyright (c) 2013, the Dart project authors.
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
lit-html/node/private-ssr-support.js:
|
|
16
|
-
(**
|
|
17
|
-
* @license
|
|
18
|
-
* Copyright 2019 Google LLC
|
|
19
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
-
*)
|
|
21
|
-
*/
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var v=String.raw,k=v`<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
2
|
-
<xsl:output method="html" version="5.0" encoding="UTF-8" indent="yes" />
|
|
3
|
-
<xsl:template match="@*|node()">
|
|
4
|
-
<xsl:copy>
|
|
5
|
-
<xsl:apply-templates select="@*|node()"/>
|
|
6
|
-
</xsl:copy>
|
|
7
|
-
</xsl:template>
|
|
8
|
-
|
|
9
|
-
<!-- remove existing namespaces -->
|
|
10
|
-
<xsl:template match="*">
|
|
11
|
-
<!-- remove element prefix -->
|
|
12
|
-
<xsl:element name="{local-name()}">
|
|
13
|
-
<!-- process attributes -->
|
|
14
|
-
<xsl:for-each select="@*">
|
|
15
|
-
<!-- remove attribute prefix -->
|
|
16
|
-
<xsl:attribute name="{local-name()}">
|
|
17
|
-
<xsl:value-of select="."/>
|
|
18
|
-
</xsl:attribute>
|
|
19
|
-
</xsl:for-each>
|
|
20
|
-
<xsl:apply-templates/>
|
|
21
|
-
</xsl:element>
|
|
22
|
-
</xsl:template>
|
|
23
|
-
</xsl:stylesheet>`;function I(s,t,e){s.querySelectorAll(t).forEach(n=>{let r=`${t}-${e}`,o=C(n,r);n.replaceWith(o)})}function w(s,t){s.querySelectorAll("*").forEach(e=>{let n=e.classList;n&&n.forEach(r=>{if(r.startsWith(`${t}:`)){let o=r.slice(`${t}:`.length),l=`${e.nodeName}-${o}`,m=C(e,l);e.replaceWith(m)}})})}function C(s,t){let e=document.createElement(t);for(let n of s.attributes)e.setAttribute(n.name,n.value);for(;s.firstChild;)e.appendChild(s.firstChild);return e}function D(s){let t=[];return s.querySelectorAll("qti-assessment-item-ref").forEach(e=>{let n=e.getAttribute("identifier"),r=e.getAttribute("href"),o=e.getAttribute("category");t.push({identifier:n,href:r,category:o})}),t}function S(s){let t=new XMLHttpRequest;return{promise:new Promise((n,r)=>{t.open("GET",s,!0),t.responseType="document",t.onload=()=>{t.status>=200&&t.status<300?n(t.responseXML):r(t.statusText)},t.onerror=()=>{r(t.statusText)},t.send()}),xhr:t}}function M(s){return new DOMParser().parseFromString(s,"text/xml")}function T(s){let t=new XSLTProcessor,e=new DOMParser().parseFromString(k,"text/xml");return t.importStylesheet(e),t.transformToFragment(s,document)}function L(s,t){t.endsWith("/")||(t+="/"),s.querySelectorAll("[src],[href],[primary-path]").forEach(e=>{let n="";e.getAttribute("src")&&(n="src"),e.getAttribute("href")&&(n="href"),e.getAttribute("primary-path")&&(n="primary-path");let r=e.getAttribute(n)?.trim();if(!/^(data:|https?:|blob:)/.test(r)){let o=t+encodeURI(r);e.setAttribute(n,o)}})}function E(s){s.querySelectorAll('qti-custom-operator[class="js.org"] > qti-base-value').forEach(e=>{let n=document.createComment(e.textContent);e.replaceChild(n,e.firstChild)})}function X(s){s.querySelectorAll("qti-stylesheet").forEach(t=>t.remove())}function P(s){switch(s){case"qti-choice-interaction":case"qti-order-interaction":return"qti-simple-choice";case"qti-inline-choice-interaction":return"qti-inline-choice";case"qti-match-interaction":return["qti-simple-match-set:first-of-type qti-simple-associable-choice","qti-simple-match-set:last-of-type > qti-simple-associable-choice"];case"qti-gap-match-interaction":return"qti-gap-text";case"qti-associate-interaction":return"qti-simple-associable-choice";default:}}var z=(s=!1)=>{let t,e="",n={load(r){e=r;let o=encodeURI(r);if(s&&sessionStorage.getItem(o))return{promise:Promise.resolve(n.parse(sessionStorage.getItem(o))),request:null};let{promise:l,xhr:m}=S(r);return{promise:new Promise(y=>{l.then(a=>(t=a,n.shuffleInteractions(),s&&sessionStorage.setItem(o,new XMLSerializer().serializeToString(t)),y(n)))}),request:m}},parse(r){return t=M(r),n},path:r=>(L(t,r),e=null,n),fn(r){return r(t),n},pciHooks(r){let o=["hook","module"],l=r.substring(0,r.lastIndexOf("/"));for(let m of o)t.querySelectorAll("["+m+"]").forEach(y=>{let a=y.getAttribute(m);!a.startsWith("data:")&&!a.startsWith("http")&&(y.setAttribute("base-url",r),y.setAttribute("module",l+"/"+encodeURI(a+(a.endsWith(".js")?"":".js"))))});return n},async configurePci(r,o,l="qti-portable-custom-interaction"){let m=[],q=t.querySelectorAll(l),y=await o(r,"/modules/module_resolution.js"),a=await o(r,"/modules/fallback_module_resolution.js");if(q.length>0)for(let A of Array.from(q)){A.setAttribute("data-base-url",r);let c=A.getAttribute("custom-interaction-type-identifier");c&&m.includes(c)&&(c=c+m.length,A.setAttribute("custom-interaction-type-identifier",c),m.push(c)),c&&m.push(c);let h=A.querySelector("qti-interaction-modules");if(h&&h.getAttribute("primary-configuration")){let x=h.getAttribute("primary-configuration");if(x)try{let u=await o(r,`/${x}`),b=Array.from(h.querySelectorAll("qti-interaction-module"));for(let i of b){let f=i.getAttribute("id");if(f&&u.paths&&u.paths[f]){let g=u.paths[f],d=Array.isArray(g)?g[0]:g;if(i.setAttribute("primary-path",d),a&&a.paths&&a.paths[f]){let p=a.paths[f];Array.isArray(p)?i.setAttribute("fallback-path",p[0]):i.setAttribute("fallback-path",p)}}}if(u.paths){for(let i in u.paths)if(!h.querySelector(`qti-interaction-module[id="${i}"]`)){let g=t.createElement("qti-interaction-module");g.setAttribute("id",i);let d=Array.isArray(u.paths[i])?u.paths[i][0]:u.paths[i];if(g.setAttribute("primary-path",d),a&&a.paths&&a.paths[i]){let p=a.paths[i];Array.isArray(p)?g.setAttribute("fallback-path",p[0]):g.setAttribute("fallback-path",p)}h.appendChild(g)}}u.urlArgs&&h.setAttribute("url-args",u.urlArgs)}catch(u){console.warn(`Failed to load primary configuration: ${x}`,u)}}else if(y){A.querySelector("qti-interaction-modules")===null?(h=t.createElement("qti-interaction-modules"),A.appendChild(h)):h=A.querySelector("qti-interaction-modules");for(let x in y.paths){let u=y.paths[x],b="";a&&a.paths&&a.paths[x]&&(b=a.paths[x]);let i=Array.isArray(u)?u:[u],f=Array.isArray(b)?b:[b],g=i.map((d,p)=>{let F=f.length>p?f[p]:"";return{primaryPath:d,fallbackPath:F}});for(let d of f)g.some(p=>p.fallbackPath===d)||g.push({primaryPath:i.length>0?i[0]:d,fallbackPath:d});for(let d of g){let p=t.createElement("qti-interaction-module");d.fallbackPath&&p.setAttribute("fallback-path",d.fallbackPath),p.setAttribute("id",x),p.setAttribute("primary-path",d.primaryPath),h&&h.appendChild(p)}}}}return n},shuffleInteractions(){let r=t.querySelectorAll('[shuffle="true"]'),o=Array.from(r).filter(l=>l.tagName?.toLowerCase().endsWith("-interaction"));for(let l of o){let m=P(l.tagName.toLowerCase()),q=Array.isArray(m)?m:[m];for(let y of q){let a=Array.from(l.querySelectorAll(y)),A=a.map((i,f)=>({element:i,fixed:i.hasAttribute("fixed")&&i.getAttribute("fixed")==="true",originalOrder:f})).filter(i=>i.fixed),c=a.filter(i=>!i.hasAttribute("fixed")||i.getAttribute("fixed")!=="true");if(c.length<=1)return console.warn("Shuffling is not possible with fewer than 2 non-fixed elements."),n;let h=[...c],x=!1,u=0;for(;!x&&u<20;){u++;for(let i=c.length-1;i>0;i--){let f=Math.floor(Math.random()*(i+1));[c[i],c[f]]=[c[f],c[i]]}x=!c.every((i,f)=>i===h[f])}if(!x)return console.warn("Failed to shuffle the choices after multiple attempts."),null;l.removeAttribute("shuffle");let b=0;for(let i of c)i.parentElement.insertBefore(i,A[b]?.element),b++;for(let i of A)i.element.parentElement.insertBefore(i.element,c[i.originalOrder])}}return n},extendElementName:(r,o)=>(I(t,r,o),n),extendElementsWithClass:(r="extend")=>(w(t,r),n),customInteraction(r,o){let l=t.querySelector("qti-custom-interaction"),m=l.querySelector("object");return l.setAttribute("data-base-ref",r),l.setAttribute("data-base-item",r+o),l.setAttribute("data",m.getAttribute("data")),l.setAttribute("width",m.getAttribute("width")),l.setAttribute("height",m.getAttribute("height")),l.removeChild(m),n},convertCDATAtoComment(){return E(t),n},stripStyleSheets(){return X(t),n},html(){return e!==null&&L(t,e.substring(0,e.lastIndexOf("/"))),new XMLSerializer().serializeToString(T(t))},xml(){return new XMLSerializer().serializeToString(t)},htmlDoc(){return e!==null&&L(t,e.substring(0,e.lastIndexOf("/"))),T(t)},xmlDoc(){return t}};return n};var W=()=>{let s,t={async load(e){return new Promise(n=>{S(e).promise.then(r=>(s=r,n(t)))})},parse(e){s=M(e)},assessmentTest(){let e=s.querySelector('resource[type="imsqti_test_xmlv3p0"]');return{href:e.getAttribute("href"),identifier:e.getAttribute("identifier")}}};return t};var U=()=>{let s,t={async load(e){return new Promise((n,r)=>{S(e).promise.then(o=>(s=o,t.path(e.substring(0,e.lastIndexOf("/"))),n(t)))})},parse(e){return s=M(e),t},path:e=>(L(s,e),t),fn(e){return e(s),t},items(){return D(s)},html(){return new XMLSerializer().serializeToString(T(s))},xml(){return new XMLSerializer().serializeToString(s)},htmlDoc(){return T(s)},xmlDoc(){return s}};return t};export{z as a,W as b,U as c};
|