@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/exports/qti-assessment-item.context.ts"],"sourcesContent":["import { createContext } from '@lit/context';\n\nimport type { ItemContext } from './item.context';\n\nexport const itemContext = createContext<ItemContext>(Symbol('item'));\n"],"mappings":";AAAA,SAAS,qBAAqB;AAIvB,IAAM,cAAc,cAA2B,OAAO,MAAM,CAAC;","names":[]}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
item_default
|
|
3
|
-
} from "./chunk-LSEB52SP.js";
|
|
4
|
-
import {
|
|
5
|
-
watch
|
|
6
|
-
} from "./chunk-ELDMXTUQ.js";
|
|
7
|
-
import {
|
|
8
|
-
qtiTransformTest
|
|
9
|
-
} from "./chunk-WFUXZ4UT.js";
|
|
10
|
-
import {
|
|
11
|
-
__decorateClass
|
|
12
|
-
} from "./chunk-H2JE6IVU.js";
|
|
13
|
-
|
|
14
|
-
// src/lib/qti-test/components/test-container.ts
|
|
15
|
-
import { LitElement, html } from "lit";
|
|
16
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
17
|
-
import { until } from "lit/directives/until.js";
|
|
18
|
-
var TestContainer = class extends LitElement {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.testURL = null;
|
|
22
|
-
this.testDoc = null;
|
|
23
|
-
this.testXML = null;
|
|
24
|
-
/** Template content if provided */
|
|
25
|
-
this.templateContent = null;
|
|
26
|
-
}
|
|
27
|
-
async handleTestURLChange() {
|
|
28
|
-
if (!this.testURL) return;
|
|
29
|
-
try {
|
|
30
|
-
const api = await qtiTransformTest().load(this.testURL);
|
|
31
|
-
this.testDoc = api.htmlDoc();
|
|
32
|
-
} catch (error) {
|
|
33
|
-
console.error("Error loading or parsing XML:", error);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
handleTestXMLChange() {
|
|
37
|
-
if (!this.testXML) return;
|
|
38
|
-
try {
|
|
39
|
-
this.testDoc = qtiTransformTest().parse(this.testXML).htmlDoc();
|
|
40
|
-
} catch (error) {
|
|
41
|
-
console.error("Error parsing XML:", error);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
async connectedCallback() {
|
|
45
|
-
super.connectedCallback();
|
|
46
|
-
this.initializeTemplateContent();
|
|
47
|
-
this.applyStyles();
|
|
48
|
-
if (this.testURL) {
|
|
49
|
-
this.handleTestURLChange();
|
|
50
|
-
}
|
|
51
|
-
if (this.testXML) {
|
|
52
|
-
this.handleTestXMLChange();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
initializeTemplateContent() {
|
|
56
|
-
const template = this.querySelector("template");
|
|
57
|
-
this.templateContent = template ? template.content : html``;
|
|
58
|
-
}
|
|
59
|
-
applyStyles() {
|
|
60
|
-
const sheet = new CSSStyleSheet();
|
|
61
|
-
sheet.replaceSync(item_default);
|
|
62
|
-
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
63
|
-
}
|
|
64
|
-
render() {
|
|
65
|
-
return html`
|
|
66
|
-
${this.templateContent}
|
|
67
|
-
<slot></slot>
|
|
68
|
-
${until(this.testDoc, html`<span>Loading...</span>`)}
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
__decorateClass([
|
|
73
|
-
property({ type: String, attribute: "test-url" })
|
|
74
|
-
], TestContainer.prototype, "testURL", 2);
|
|
75
|
-
__decorateClass([
|
|
76
|
-
state()
|
|
77
|
-
], TestContainer.prototype, "testDoc", 2);
|
|
78
|
-
__decorateClass([
|
|
79
|
-
state()
|
|
80
|
-
], TestContainer.prototype, "testXML", 2);
|
|
81
|
-
__decorateClass([
|
|
82
|
-
watch("testURL", { waitUntilFirstUpdate: true })
|
|
83
|
-
], TestContainer.prototype, "handleTestURLChange", 1);
|
|
84
|
-
__decorateClass([
|
|
85
|
-
watch("testXML", { waitUntilFirstUpdate: true })
|
|
86
|
-
], TestContainer.prototype, "handleTestXMLChange", 1);
|
|
87
|
-
TestContainer = __decorateClass([
|
|
88
|
-
customElement("test-container")
|
|
89
|
-
], TestContainer);
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
TestContainer
|
|
93
|
-
};
|
|
94
|
-
//# sourceMappingURL=chunk-ODHS7HDB.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-container.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport { watch } from '../../decorators/watch';\nimport itemCss from '../../../item.css?inline';\nimport { qtiTransformTest } from '../../qti-transformers';\n\n/**\n * `<test-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-test` will be placed inside the shadow DOM of this element.\n * The element loads the test from the provided URL and renders it inside the shadow DOM.\n *\n * ```html\n * <qti-test>\n * <test-navigation>\n * <test-container class=\"m-4 bg-white\" test-url=\"./path/to/assessmenttest.xml\"></test-container>\n * </test-navigation>\n * </qti-test>\n * ```\n */\n@customElement('test-container')\nexport class TestContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'test-url' })\n testURL: string = null;\n\n /** A parsed HTML document */\n @state()\n testDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n testXML: string = null;\n\n /** Template content if provided */\n private templateContent = null;\n\n @watch('testURL', { waitUntilFirstUpdate: true })\n protected async handleTestURLChange() {\n if (!this.testURL) return;\n try {\n const api = await qtiTransformTest().load(this.testURL);\n this.testDoc = api.htmlDoc();\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('testXML', { waitUntilFirstUpdate: true })\n protected handleTestXMLChange() {\n if (!this.testXML) return;\n try {\n this.testDoc = qtiTransformTest().parse(this.testXML).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.testURL) {\n this.handleTestURLChange();\n }\n if (this.testXML) {\n this.handleTestXMLChange();\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.testDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-container': TestContainer;\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;","names":[]}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
qtiContext
|
|
3
|
-
} from "./chunk-H6KHXSIO.js";
|
|
4
|
-
import {
|
|
5
|
-
itemContext
|
|
6
|
-
} from "./chunk-NJNQOQUU.js";
|
|
7
|
-
import {
|
|
8
|
-
__decorateClass
|
|
9
|
-
} from "./chunk-H2JE6IVU.js";
|
|
10
|
-
|
|
11
|
-
// src/lib/exports/qti-expression.ts
|
|
12
|
-
import { consume } from "@lit/context";
|
|
13
|
-
import { css, html, LitElement } from "lit";
|
|
14
|
-
import { state } from "lit/decorators.js";
|
|
15
|
-
var QtiExpression = class extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.getVariables = () => (
|
|
19
|
-
// FIXME: if this itself is multiple, this will never enter the qti-multiple switch
|
|
20
|
-
// See this example here: https://github.com/1EdTech/qti-examples/blob/master/qtiv3-examples/packaging/items/Example05-feedbackBlock-adaptive.xml
|
|
21
|
-
Array.from(this.children).map((e) => {
|
|
22
|
-
console.debug("getVariables", e.tagName.toLowerCase());
|
|
23
|
-
switch (e.tagName.toLowerCase()) {
|
|
24
|
-
case "qti-base-value": {
|
|
25
|
-
return {
|
|
26
|
-
baseType: e.getAttribute("base-type"),
|
|
27
|
-
value: e.textContent.trim(),
|
|
28
|
-
cardinality: "single"
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
case "qti-variable": {
|
|
32
|
-
const identifier = e.getAttribute("identifier") || "";
|
|
33
|
-
if (identifier === "QTI_CONTEXT") {
|
|
34
|
-
if (!this.qtiContext?.QTI_CONTEXT) {
|
|
35
|
-
console.warn("QTI_CONTEXT not available");
|
|
36
|
-
return {
|
|
37
|
-
identifier: "QTI_CONTEXT",
|
|
38
|
-
baseType: "record",
|
|
39
|
-
value: this.qtiContext.QTI_CONTEXT,
|
|
40
|
-
cardinality: "record",
|
|
41
|
-
type: "context"
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
identifier: "QTI_CONTEXT",
|
|
46
|
-
baseType: "record",
|
|
47
|
-
value: this.qtiContext.QTI_CONTEXT,
|
|
48
|
-
cardinality: "record",
|
|
49
|
-
type: "context"
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
const variable = this.context.variables.find((v) => v.identifier === identifier) || null;
|
|
53
|
-
return variable;
|
|
54
|
-
}
|
|
55
|
-
case "qti-multiple": {
|
|
56
|
-
const multiple = e;
|
|
57
|
-
const values = multiple.getResult();
|
|
58
|
-
console.debug("values", values);
|
|
59
|
-
if (values?.length > 0) {
|
|
60
|
-
return {
|
|
61
|
-
identifier: "",
|
|
62
|
-
baseType: values[0].baseType,
|
|
63
|
-
value: values.map((v) => v.value),
|
|
64
|
-
cardinality: "multiple",
|
|
65
|
-
type: "response"
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
case "qti-ordered": {
|
|
71
|
-
const multiple = e;
|
|
72
|
-
const values = multiple.getResult();
|
|
73
|
-
if (values?.length > 0) {
|
|
74
|
-
return {
|
|
75
|
-
identifier: "",
|
|
76
|
-
baseType: values[0].baseType,
|
|
77
|
-
value: values.map((v) => v.value),
|
|
78
|
-
cardinality: "ordered",
|
|
79
|
-
type: "response"
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
case "qti-correct": {
|
|
85
|
-
const identifier = e.getAttribute("identifier") || "";
|
|
86
|
-
const responseVariable = this.context.variables.find((v) => v.identifier === identifier) || null;
|
|
87
|
-
return {
|
|
88
|
-
baseType: responseVariable.baseType,
|
|
89
|
-
value: responseVariable.correctResponse,
|
|
90
|
-
cardinality: responseVariable.cardinality
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
default: {
|
|
94
|
-
try {
|
|
95
|
-
const expression = e;
|
|
96
|
-
const value = expression.getResult();
|
|
97
|
-
return {
|
|
98
|
-
baseType: "integer",
|
|
99
|
-
value: value?.toString() || null,
|
|
100
|
-
cardinality: "single"
|
|
101
|
-
};
|
|
102
|
-
} catch (error) {
|
|
103
|
-
console.warn("default not sufficient");
|
|
104
|
-
}
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}).filter((v) => v !== null)
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
static {
|
|
112
|
-
// hide the slot with css
|
|
113
|
-
this.styles = css`
|
|
114
|
-
slot {
|
|
115
|
-
display: none;
|
|
116
|
-
}
|
|
117
|
-
`;
|
|
118
|
-
}
|
|
119
|
-
render() {
|
|
120
|
-
return html`<pre>${JSON.stringify(this.result, null, 2)}</pre>
|
|
121
|
-
<slot></slot>`;
|
|
122
|
-
}
|
|
123
|
-
calculate() {
|
|
124
|
-
this.result = this.getResult();
|
|
125
|
-
return this.result;
|
|
126
|
-
}
|
|
127
|
-
getResult() {
|
|
128
|
-
throw new Error("Not implemented");
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
__decorateClass([
|
|
132
|
-
state()
|
|
133
|
-
], QtiExpression.prototype, "result", 2);
|
|
134
|
-
__decorateClass([
|
|
135
|
-
consume({ context: itemContext, subscribe: true }),
|
|
136
|
-
state()
|
|
137
|
-
], QtiExpression.prototype, "context", 2);
|
|
138
|
-
__decorateClass([
|
|
139
|
-
consume({ context: qtiContext, subscribe: true }),
|
|
140
|
-
state()
|
|
141
|
-
], QtiExpression.prototype, "qtiContext", 2);
|
|
142
|
-
|
|
143
|
-
export {
|
|
144
|
-
QtiExpression
|
|
145
|
-
};
|
|
146
|
-
//# sourceMappingURL=chunk-QCB6P7DH.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/exports/qti-expression.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\n\nimport { itemContext } from './qti-assessment-item.context';\nimport { qtiContext } from './qti.context';\n\nimport type { QtiContext, QtiContextType } from './qti.context';\nimport type { ResponseVariable, VariableDeclaration } from './variables';\nimport type { QtiMultiple } from '../qti-components/qti-response-processing/qti-expression/qti-multiple/qti-multiple';\nimport type { QtiOrdered } from '../qti-components/qti-response-processing/qti-expression/qti-ordered/qti-ordered';\nimport type { ItemContext } from './item.context';\n\nexport interface QtiExpressionBase<T> {\n // get assessmentItem(): QtiAssessmentItem;\n\n // getVariables(): VariableDeclaration<number | string | (number | string)[] | null>[];\n calculate(): Readonly<T>;\n}\n\nexport abstract class QtiExpression<T> extends LitElement implements QtiExpressionBase<T> {\n @state()\n protected result: any;\n\n // hide the slot with css\n static styles = css`\n slot {\n display: none;\n }\n `;\n\n override render() {\n return html`<pre>${JSON.stringify(this.result, null, 2)}</pre>\n <slot></slot>`;\n }\n\n public calculate(): Readonly<T> {\n this.result = this.getResult();\n return this.result;\n }\n\n protected getResult(): Readonly<T> {\n throw new Error('Not implemented');\n }\n\n @consume({ context: itemContext, subscribe: true })\n @state()\n protected context?: ItemContext;\n\n @consume({ context: qtiContext, subscribe: true })\n @state()\n protected qtiContext?: QtiContext;\n\n getVariables = (): (ResponseVariable | VariableDeclaration<QtiContextType>)[] =>\n // FIXME: if this itself is multiple, this will never enter the qti-multiple switch\n // See this example here: https://github.com/1EdTech/qti-examples/blob/master/qtiv3-examples/packaging/items/Example05-feedbackBlock-adaptive.xml\n\n Array.from(this.children)\n .map((e: Element) => {\n console.debug('getVariables', e.tagName.toLowerCase());\n switch (e.tagName.toLowerCase()) {\n case 'qti-base-value': {\n return {\n baseType: e.getAttribute('base-type'),\n value: e.textContent.trim(),\n cardinality: 'single'\n } as ResponseVariable;\n }\n case 'qti-variable': {\n const identifier = e.getAttribute('identifier') || '';\n\n // Special handling for QTI_CONTEXT\n if (identifier === 'QTI_CONTEXT') {\n if (!this.qtiContext?.QTI_CONTEXT) {\n console.warn('QTI_CONTEXT not available');\n return {\n identifier: 'QTI_CONTEXT',\n baseType: 'record',\n value: this.qtiContext.QTI_CONTEXT,\n cardinality: 'record',\n type: 'context'\n } as VariableDeclaration<QtiContextType>;\n }\n return {\n identifier: 'QTI_CONTEXT',\n baseType: 'record',\n value: this.qtiContext.QTI_CONTEXT,\n cardinality: 'record',\n type: 'context'\n } as VariableDeclaration<QtiContextType>;\n }\n\n const variable = this.context.variables.find(v => v.identifier === identifier) || null;\n return variable;\n }\n case 'qti-multiple': {\n const multiple = e as QtiMultiple;\n\n const values = multiple.getResult();\n console.debug('values', values);\n if (values?.length > 0) {\n return {\n identifier: '',\n baseType: values[0].baseType,\n value: values.map(v => v.value),\n cardinality: 'multiple',\n type: 'response'\n } as ResponseVariable;\n }\n return null;\n }\n case 'qti-ordered': {\n const multiple = e as QtiOrdered;\n const values = multiple.getResult();\n if (values?.length > 0) {\n return {\n identifier: '',\n baseType: values[0].baseType,\n value: values.map(v => v.value),\n cardinality: 'ordered',\n type: 'response'\n } as ResponseVariable;\n }\n return null;\n }\n case 'qti-correct': {\n const identifier = e.getAttribute('identifier') || '';\n const responseVariable: ResponseVariable =\n this.context.variables.find(v => v.identifier === identifier) || null;\n return {\n baseType: responseVariable.baseType,\n value: responseVariable.correctResponse,\n cardinality: responseVariable.cardinality\n } as ResponseVariable;\n }\n default: {\n // added for use of qti-equal-rounded\n try {\n const expression = e as QtiExpression<number>;\n const value = expression.getResult();\n return {\n baseType: 'integer',\n value: value?.toString() || null,\n cardinality: 'single'\n } as ResponseVariable;\n } catch (error) {\n console.warn('default not sufficient');\n }\n return null;\n }\n }\n })\n .filter(v => v !== null);\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,aAAa;AAkBf,IAAe,gBAAf,cAAwC,WAA2C;AAAA,EAAnF;AAAA;AAiCL,wBAAe;AAAA;AAAA;AAAA,MAIb,MAAM,KAAK,KAAK,QAAQ,EACrB,IAAI,CAAC,MAAe;AACnB,gBAAQ,MAAM,gBAAgB,EAAE,QAAQ,YAAY,CAAC;AACrD,gBAAQ,EAAE,QAAQ,YAAY,GAAG;AAAA,UAC/B,KAAK,kBAAkB;AACrB,mBAAO;AAAA,cACL,UAAU,EAAE,aAAa,WAAW;AAAA,cACpC,OAAO,EAAE,YAAY,KAAK;AAAA,cAC1B,aAAa;AAAA,YACf;AAAA,UACF;AAAA,UACA,KAAK,gBAAgB;AACnB,kBAAM,aAAa,EAAE,aAAa,YAAY,KAAK;AAGnD,gBAAI,eAAe,eAAe;AAChC,kBAAI,CAAC,KAAK,YAAY,aAAa;AACjC,wBAAQ,KAAK,2BAA2B;AACxC,uBAAO;AAAA,kBACL,YAAY;AAAA,kBACZ,UAAU;AAAA,kBACV,OAAO,KAAK,WAAW;AAAA,kBACvB,aAAa;AAAA,kBACb,MAAM;AAAA,gBACR;AAAA,cACF;AACA,qBAAO;AAAA,gBACL,YAAY;AAAA,gBACZ,UAAU;AAAA,gBACV,OAAO,KAAK,WAAW;AAAA,gBACvB,aAAa;AAAA,gBACb,MAAM;AAAA,cACR;AAAA,YACF;AAEA,kBAAM,WAAW,KAAK,QAAQ,UAAU,KAAK,OAAK,EAAE,eAAe,UAAU,KAAK;AAClF,mBAAO;AAAA,UACT;AAAA,UACA,KAAK,gBAAgB;AACnB,kBAAM,WAAW;AAEjB,kBAAM,SAAS,SAAS,UAAU;AAClC,oBAAQ,MAAM,UAAU,MAAM;AAC9B,gBAAI,QAAQ,SAAS,GAAG;AACtB,qBAAO;AAAA,gBACL,YAAY;AAAA,gBACZ,UAAU,OAAO,CAAC,EAAE;AAAA,gBACpB,OAAO,OAAO,IAAI,OAAK,EAAE,KAAK;AAAA,gBAC9B,aAAa;AAAA,gBACb,MAAM;AAAA,cACR;AAAA,YACF;AACA,mBAAO;AAAA,UACT;AAAA,UACA,KAAK,eAAe;AAClB,kBAAM,WAAW;AACjB,kBAAM,SAAS,SAAS,UAAU;AAClC,gBAAI,QAAQ,SAAS,GAAG;AACtB,qBAAO;AAAA,gBACL,YAAY;AAAA,gBACZ,UAAU,OAAO,CAAC,EAAE;AAAA,gBACpB,OAAO,OAAO,IAAI,OAAK,EAAE,KAAK;AAAA,gBAC9B,aAAa;AAAA,gBACb,MAAM;AAAA,cACR;AAAA,YACF;AACA,mBAAO;AAAA,UACT;AAAA,UACA,KAAK,eAAe;AAClB,kBAAM,aAAa,EAAE,aAAa,YAAY,KAAK;AACnD,kBAAM,mBACJ,KAAK,QAAQ,UAAU,KAAK,OAAK,EAAE,eAAe,UAAU,KAAK;AACnE,mBAAO;AAAA,cACL,UAAU,iBAAiB;AAAA,cAC3B,OAAO,iBAAiB;AAAA,cACxB,aAAa,iBAAiB;AAAA,YAChC;AAAA,UACF;AAAA,UACA,SAAS;AAEP,gBAAI;AACF,oBAAM,aAAa;AACnB,oBAAM,QAAQ,WAAW,UAAU;AACnC,qBAAO;AAAA,gBACL,UAAU;AAAA,gBACV,OAAO,OAAO,SAAS,KAAK;AAAA,gBAC5B,aAAa;AAAA,cACf;AAAA,YACF,SAAS,OAAO;AACd,sBAAQ,KAAK,wBAAwB;AAAA,YACvC;AACA,mBAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF,CAAC,EACA,OAAO,OAAK,MAAM,IAAI;AAAA;AAAA;AAAA,EA/H3B;AAAA;AAAA,SAAO,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMP,SAAS;AAChB,WAAO,YAAY,KAAK,UAAU,KAAK,QAAQ,MAAM,CAAC,CAAC;AAAA;AAAA,EAEzD;AAAA,EAEO,YAAyB;AAC9B,SAAK,SAAS,KAAK,UAAU;AAC7B,WAAO,KAAK;AAAA,EACd;AAAA,EAEU,YAAyB;AACjC,UAAM,IAAI,MAAM,iBAAiB;AAAA,EACnC;AA8GF;AAnIY;AAAA,EADT,MAAM;AAAA,GADa,cAEV;AAyBA;AAAA,EAFT,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,EACjD,MAAM;AAAA,GA1Ba,cA2BV;AAIA;AAAA,EAFT,QAAQ,EAAE,SAAS,YAAY,WAAW,KAAK,CAAC;AAAA,EAChD,MAAM;AAAA,GA9Ba,cA+BV;","names":[]}
|
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
qtiContext
|
|
3
|
-
} from "./chunk-H6KHXSIO.js";
|
|
4
|
-
import {
|
|
5
|
-
sessionContext
|
|
6
|
-
} from "./chunk-22IRJWWY.js";
|
|
7
|
-
import {
|
|
8
|
-
testContext
|
|
9
|
-
} from "./chunk-CJADUWEC.js";
|
|
10
|
-
import {
|
|
11
|
-
computedContext
|
|
12
|
-
} from "./chunk-AZIKAG7K.js";
|
|
13
|
-
import {
|
|
14
|
-
configContext
|
|
15
|
-
} from "./chunk-ERYHQVOT.js";
|
|
16
|
-
import {
|
|
17
|
-
__decorateClass
|
|
18
|
-
} from "./chunk-H2JE6IVU.js";
|
|
19
|
-
|
|
20
|
-
// src/lib/qti-test/components/test-navigation.ts
|
|
21
|
-
import { consume, provide } from "@lit/context";
|
|
22
|
-
import { html, LitElement } from "lit";
|
|
23
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
24
|
-
var TestNavigation = class extends LitElement {
|
|
25
|
-
constructor() {
|
|
26
|
-
super();
|
|
27
|
-
this.identifier = void 0;
|
|
28
|
-
this.initContext = [];
|
|
29
|
-
this.qtiContext = {
|
|
30
|
-
QTI_CONTEXT: {
|
|
31
|
-
testIdentifier: "",
|
|
32
|
-
candidateIdentifier: "",
|
|
33
|
-
environmentIdentifier: "default"
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
this.configContext = {};
|
|
37
|
-
this.autoScoreItems = false;
|
|
38
|
-
this.addEventListener("qti-assessment-test-connected", this._handleTestConnected.bind(this));
|
|
39
|
-
this.addEventListener("qti-assessment-item-connected", this._handleItemConnected.bind(this));
|
|
40
|
-
this.addEventListener("qti-interaction-changed", this._handleInteractionChanged.bind(this));
|
|
41
|
-
this.addEventListener("test-end-attempt", this._handleTestEndAttempt.bind(this));
|
|
42
|
-
this.addEventListener("test-show-correct-response", this._handleTestShowCorrectResponse.bind(this));
|
|
43
|
-
this.addEventListener("test-show-candidate-correction", this._handleTestShowCandidateCorrection.bind(this));
|
|
44
|
-
this.addEventListener("test-update-outcome-variable", this._handleTestUpdateOutcomeVariable.bind(this));
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Handles the 'test-end-attempt' event.
|
|
48
|
-
* @private
|
|
49
|
-
* @listens TestNavigation#test-end-attempt
|
|
50
|
-
* @param {CustomEvent} event - The custom event object.
|
|
51
|
-
*/
|
|
52
|
-
_handleTestEndAttempt(_event) {
|
|
53
|
-
const qtiItemEl = this._testElement.querySelector(
|
|
54
|
-
`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`
|
|
55
|
-
);
|
|
56
|
-
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
57
|
-
const reportValidityAfterScoring = this.configContext?.reportValidityAfterScoring === true ? true : false;
|
|
58
|
-
qtiAssessmentItemEl.processResponse(true, reportValidityAfterScoring);
|
|
59
|
-
}
|
|
60
|
-
// protected createRenderRoot(): HTMLElement | DocumentFragment {
|
|
61
|
-
// return this;
|
|
62
|
-
// }
|
|
63
|
-
// myTemplate: TemplateFunction;
|
|
64
|
-
// connectedCallback(): void {
|
|
65
|
-
// super.connectedCallback();
|
|
66
|
-
// const templateElement = this.querySelector<HTMLTemplateElement>('template');
|
|
67
|
-
// if (!templateElement) {
|
|
68
|
-
// this.myTemplate = null;
|
|
69
|
-
// return;
|
|
70
|
-
// }
|
|
71
|
-
// this.myTemplate = prepareTemplate(templateElement);
|
|
72
|
-
// }
|
|
73
|
-
/**
|
|
74
|
-
* Handles the 'test-show-correct-response' event.
|
|
75
|
-
* @private
|
|
76
|
-
* @listens TestNavigation#test-show-correct-response
|
|
77
|
-
* @param {CustomEvent} event - The custom event object.
|
|
78
|
-
*/
|
|
79
|
-
_handleTestShowCorrectResponse(event) {
|
|
80
|
-
const qtiItemEl = this._testElement.querySelector(
|
|
81
|
-
`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`
|
|
82
|
-
);
|
|
83
|
-
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
84
|
-
if (!qtiAssessmentItemEl) return;
|
|
85
|
-
qtiAssessmentItemEl.showCorrectResponse(event.detail);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Handles the 'test-show-candidate-correction' event.
|
|
89
|
-
* @private
|
|
90
|
-
* @listens TestNavigation#test-show-candidate-correction
|
|
91
|
-
* @param {CustomEvent} event - The custom event object.
|
|
92
|
-
*/
|
|
93
|
-
_handleTestShowCandidateCorrection(event) {
|
|
94
|
-
const qtiItemEl = this._testElement.querySelector(
|
|
95
|
-
`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`
|
|
96
|
-
);
|
|
97
|
-
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
98
|
-
qtiAssessmentItemEl.showCandidateCorrection(event.detail);
|
|
99
|
-
}
|
|
100
|
-
_handleTestUpdateOutcomeVariable(event) {
|
|
101
|
-
const qtiItemEl = this._testElement.querySelector(
|
|
102
|
-
`qti-assessment-item-ref[identifier="${event.detail.assessmentItemRefId}"]`
|
|
103
|
-
);
|
|
104
|
-
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
105
|
-
qtiAssessmentItemEl.setOutcomeVariable(event.detail.outcomeVariableId, event.detail.value);
|
|
106
|
-
}
|
|
107
|
-
_handleInteractionChanged(_event) {
|
|
108
|
-
if (this.autoScoreItems) {
|
|
109
|
-
const assessmentItem = _event.composedPath()[0].closest("qti-assessment-item");
|
|
110
|
-
const scoreOutcomeIdentifier = assessmentItem.variables.find((v) => v.identifier === "SCORE");
|
|
111
|
-
if (scoreOutcomeIdentifier && scoreOutcomeIdentifier.externalScored === null && assessmentItem.adaptive === "false") {
|
|
112
|
-
const reportValidityAfterScoring = this.configContext?.reportValidityAfterScoring === true ? true : false;
|
|
113
|
-
assessmentItem.processResponse(true, reportValidityAfterScoring);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
render() {
|
|
118
|
-
return html`<slot></slot>`;
|
|
119
|
-
}
|
|
120
|
-
/* PK: on test connected we can build the computed context */
|
|
121
|
-
_handleTestConnected(event) {
|
|
122
|
-
this._testElement = event.detail;
|
|
123
|
-
if (!this.qtiContext.QTI_CONTEXT?.testIdentifier) {
|
|
124
|
-
const currentContext = this.qtiContext.QTI_CONTEXT || {
|
|
125
|
-
testIdentifier: "",
|
|
126
|
-
candidateIdentifier: "not set",
|
|
127
|
-
environmentIdentifier: "default"
|
|
128
|
-
};
|
|
129
|
-
this.qtiContext = {
|
|
130
|
-
QTI_CONTEXT: {
|
|
131
|
-
...currentContext,
|
|
132
|
-
testIdentifier: this._testElement.identifier,
|
|
133
|
-
environmentIdentifier: currentContext.environmentIdentifier || "default"
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
const contextDeclarations = this._testElement.querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]');
|
|
138
|
-
contextDeclarations.forEach((declaration) => {
|
|
139
|
-
const defaultValues = this._extractDefaultValues(declaration);
|
|
140
|
-
if (Object.keys(defaultValues).length > 0) {
|
|
141
|
-
this.qtiContext = {
|
|
142
|
-
QTI_CONTEXT: {
|
|
143
|
-
...defaultValues,
|
|
144
|
-
// Default values first
|
|
145
|
-
...this.qtiContext.QTI_CONTEXT
|
|
146
|
-
// Runtime values override defaults
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
const testPartElements = Array.from(this._testElement?.querySelectorAll(`qti-test-part`) || []);
|
|
152
|
-
this.computedContext = {
|
|
153
|
-
identifier: this._testElement.identifier,
|
|
154
|
-
title: this._testElement.title,
|
|
155
|
-
view: this._sessionContext?.view,
|
|
156
|
-
testParts: testPartElements.map((testPart) => {
|
|
157
|
-
const sectionElements = [...testPart.querySelectorAll(`qti-assessment-section`)];
|
|
158
|
-
return {
|
|
159
|
-
active: false,
|
|
160
|
-
identifier: testPart.identifier,
|
|
161
|
-
navigationMode: testPart.navigationMode,
|
|
162
|
-
submissionMode: testPart.submissionMode,
|
|
163
|
-
sections: sectionElements.map((section) => {
|
|
164
|
-
const itemElements = [...section.querySelectorAll(`qti-assessment-item-ref`)];
|
|
165
|
-
return {
|
|
166
|
-
active: false,
|
|
167
|
-
identifier: section.identifier,
|
|
168
|
-
title: section.title,
|
|
169
|
-
items: itemElements.map((item) => ({
|
|
170
|
-
...this.initContext?.find((i) => i.identifier === item.identifier),
|
|
171
|
-
active: false,
|
|
172
|
-
identifier: item.identifier,
|
|
173
|
-
categories: item.category ? item.category?.split(" ") : [],
|
|
174
|
-
href: item.href,
|
|
175
|
-
variables: []
|
|
176
|
-
}))
|
|
177
|
-
};
|
|
178
|
-
})
|
|
179
|
-
};
|
|
180
|
-
})
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Extract default values from a qti-context-declaration element
|
|
185
|
-
*/
|
|
186
|
-
_extractDefaultValues(declaration) {
|
|
187
|
-
const defaultValues = {};
|
|
188
|
-
const defaultValueElement = declaration.querySelector("qti-default-value");
|
|
189
|
-
if (!defaultValueElement) {
|
|
190
|
-
return defaultValues;
|
|
191
|
-
}
|
|
192
|
-
const valueElements = defaultValueElement.querySelectorAll("qti-value[field-identifier]");
|
|
193
|
-
valueElements.forEach((valueElement) => {
|
|
194
|
-
const fieldIdentifier = valueElement.getAttribute("field-identifier");
|
|
195
|
-
const baseType = valueElement.getAttribute("base-type") || "string";
|
|
196
|
-
const textContent = valueElement.textContent?.trim() || "";
|
|
197
|
-
if (fieldIdentifier) {
|
|
198
|
-
let value = textContent;
|
|
199
|
-
switch (baseType) {
|
|
200
|
-
case "integer":
|
|
201
|
-
value = parseInt(textContent, 10);
|
|
202
|
-
break;
|
|
203
|
-
case "float":
|
|
204
|
-
case "duration":
|
|
205
|
-
value = parseFloat(textContent);
|
|
206
|
-
break;
|
|
207
|
-
case "boolean":
|
|
208
|
-
value = textContent.toLowerCase() === "true";
|
|
209
|
-
break;
|
|
210
|
-
case "string":
|
|
211
|
-
default:
|
|
212
|
-
value = textContent;
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
defaultValues[fieldIdentifier] = value;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
return defaultValues;
|
|
219
|
-
}
|
|
220
|
-
/* PK: on item connected we can add item only properties in the xml */
|
|
221
|
-
_handleItemConnected(event) {
|
|
222
|
-
const itemElement = event.detail;
|
|
223
|
-
this.computedContext = {
|
|
224
|
-
...this.computedContext,
|
|
225
|
-
testParts: this.computedContext.testParts.map((testPart) => {
|
|
226
|
-
return {
|
|
227
|
-
...testPart,
|
|
228
|
-
sections: testPart.sections.map((section) => {
|
|
229
|
-
return {
|
|
230
|
-
...section,
|
|
231
|
-
items: section.items.map((item) => {
|
|
232
|
-
if (item.identifier !== itemElement.parentElement.getAttribute("identifier")) {
|
|
233
|
-
return item;
|
|
234
|
-
}
|
|
235
|
-
const scoreOutcome = itemElement.querySelector(
|
|
236
|
-
"qti-outcome-declaration[identifier='SCORE']"
|
|
237
|
-
);
|
|
238
|
-
const externalScored = scoreOutcome?.getAttribute("externalScored");
|
|
239
|
-
const responseDeclarations = itemElement.querySelectorAll("qti-response-declaration");
|
|
240
|
-
const containsCorrectResponse = Array.from(responseDeclarations).some(
|
|
241
|
-
(r) => r.querySelector("qti-correct-response")
|
|
242
|
-
);
|
|
243
|
-
const containsMapping = Array.from(responseDeclarations).some((r) => {
|
|
244
|
-
const mapping = r.querySelector("qti-mapping");
|
|
245
|
-
const areaMapping = r.querySelector("qti-area-mapping");
|
|
246
|
-
return mapping?.querySelector("qti-map-entry") || areaMapping?.querySelector("qti-area-map-entry");
|
|
247
|
-
});
|
|
248
|
-
const hasCorrectResponse = containsCorrectResponse || containsMapping;
|
|
249
|
-
const hasResponseProcessing = itemElement.querySelector("qti-response-processing") ? true : false;
|
|
250
|
-
return {
|
|
251
|
-
...item,
|
|
252
|
-
assessmentItemIdentifier: itemElement.getAttribute("identifier"),
|
|
253
|
-
label: itemElement.getAttribute("label"),
|
|
254
|
-
title: itemElement.title,
|
|
255
|
-
externalScored,
|
|
256
|
-
adaptive: itemElement.adaptive == "true" || false,
|
|
257
|
-
timeDependent: itemElement.timeDependent == "true" || false,
|
|
258
|
-
variables: itemElement.variables,
|
|
259
|
-
hasCorrectResponse,
|
|
260
|
-
hasResponseProcessing
|
|
261
|
-
};
|
|
262
|
-
})
|
|
263
|
-
};
|
|
264
|
-
})
|
|
265
|
-
};
|
|
266
|
-
})
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
/* PK: on every change of the candidate we will recomputed the computedContext */
|
|
270
|
-
willUpdate(_changedProperties) {
|
|
271
|
-
if (!this.computedContext) return;
|
|
272
|
-
let itemIndex = 1;
|
|
273
|
-
this.computedContext = {
|
|
274
|
-
...this.computedContext,
|
|
275
|
-
view: this._sessionContext?.view,
|
|
276
|
-
testParts: this.computedContext.testParts.map((testPart) => {
|
|
277
|
-
return {
|
|
278
|
-
...testPart,
|
|
279
|
-
active: this._sessionContext?.navPartId === testPart.identifier || false,
|
|
280
|
-
sections: testPart.sections.map((section) => {
|
|
281
|
-
return {
|
|
282
|
-
...section,
|
|
283
|
-
active: this._sessionContext?.navSectionId === section.identifier || false,
|
|
284
|
-
completed: section.items.every(
|
|
285
|
-
(item) => this._testContext.items.find((i) => i.identifier === item.identifier)?.variables.find((v) => v.identifier === "completionStatus").value === "completed"
|
|
286
|
-
),
|
|
287
|
-
items: section.items.map((item) => {
|
|
288
|
-
const itemContext = this._testContext?.items.find((i) => i.identifier === item.identifier);
|
|
289
|
-
const computedItem = {
|
|
290
|
-
...item,
|
|
291
|
-
...itemContext,
|
|
292
|
-
...this.initContext?.find((i) => i.identifier === item.identifier)
|
|
293
|
-
};
|
|
294
|
-
const rawscore = computedItem.variables?.find((vr) => vr.identifier == "SCORE")?.value;
|
|
295
|
-
const score = rawscore === void 0 || rawscore === null ? null : parseFloat(rawscore?.toString());
|
|
296
|
-
const completionStatus = computedItem.variables?.find((v) => v.identifier === "completionStatus")?.value;
|
|
297
|
-
const response = computedItem.variables?.find((v) => v.identifier === "RESPONSE")?.value || "";
|
|
298
|
-
const numAttempts = computedItem.variables?.find((v) => v.identifier === "numAttempts")?.value || 0;
|
|
299
|
-
const active = this._sessionContext?.navItemRefId === computedItem.identifier || false;
|
|
300
|
-
const index = item.categories.includes(this.configContext?.infoItemCategory) ? null : itemIndex++;
|
|
301
|
-
const rawMaxScore = item.variables?.find((vr) => vr.identifier == "MAXSCORE")?.value;
|
|
302
|
-
const maxScore = rawMaxScore === void 0 || rawMaxScore === null ? null : parseFloat(rawMaxScore?.toString());
|
|
303
|
-
return {
|
|
304
|
-
...computedItem,
|
|
305
|
-
completionStatus,
|
|
306
|
-
numAttempts,
|
|
307
|
-
score,
|
|
308
|
-
response,
|
|
309
|
-
index,
|
|
310
|
-
// type,
|
|
311
|
-
active,
|
|
312
|
-
// correct,
|
|
313
|
-
maxScore
|
|
314
|
-
// incorrect,
|
|
315
|
-
// completed
|
|
316
|
-
};
|
|
317
|
-
})
|
|
318
|
-
};
|
|
319
|
-
})
|
|
320
|
-
};
|
|
321
|
-
})
|
|
322
|
-
};
|
|
323
|
-
this.dispatchEvent(
|
|
324
|
-
new CustomEvent("qti-computed-context-updated", {
|
|
325
|
-
detail: this.computedContext,
|
|
326
|
-
bubbles: true
|
|
327
|
-
})
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
__decorateClass([
|
|
332
|
-
property({ type: String })
|
|
333
|
-
], TestNavigation.prototype, "identifier", 2);
|
|
334
|
-
__decorateClass([
|
|
335
|
-
state()
|
|
336
|
-
], TestNavigation.prototype, "initContext", 2);
|
|
337
|
-
__decorateClass([
|
|
338
|
-
state(),
|
|
339
|
-
provide({ context: qtiContext })
|
|
340
|
-
], TestNavigation.prototype, "qtiContext", 2);
|
|
341
|
-
__decorateClass([
|
|
342
|
-
state(),
|
|
343
|
-
provide({ context: configContext })
|
|
344
|
-
], TestNavigation.prototype, "configContext", 2);
|
|
345
|
-
__decorateClass([
|
|
346
|
-
state(),
|
|
347
|
-
consume({ context: testContext, subscribe: true })
|
|
348
|
-
], TestNavigation.prototype, "_testContext", 2);
|
|
349
|
-
__decorateClass([
|
|
350
|
-
state(),
|
|
351
|
-
consume({ context: sessionContext, subscribe: true })
|
|
352
|
-
], TestNavigation.prototype, "_sessionContext", 2);
|
|
353
|
-
__decorateClass([
|
|
354
|
-
state(),
|
|
355
|
-
provide({ context: computedContext })
|
|
356
|
-
], TestNavigation.prototype, "computedContext", 2);
|
|
357
|
-
__decorateClass([
|
|
358
|
-
property({ type: Boolean, attribute: "auto-score-items" })
|
|
359
|
-
], TestNavigation.prototype, "autoScoreItems", 2);
|
|
360
|
-
TestNavigation = __decorateClass([
|
|
361
|
-
customElement("test-navigation")
|
|
362
|
-
], TestNavigation);
|
|
363
|
-
|
|
364
|
-
export {
|
|
365
|
-
TestNavigation
|
|
366
|
-
};
|
|
367
|
-
//# sourceMappingURL=chunk-QU7KR7VX.js.map
|