@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,208 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
itemContext
|
|
3
|
-
} from "./chunk-NJNQOQUU.js";
|
|
4
|
-
import {
|
|
5
|
-
configContext
|
|
6
|
-
} from "./chunk-ERYHQVOT.js";
|
|
7
|
-
import {
|
|
8
|
-
__decorateClass
|
|
9
|
-
} from "./chunk-H2JE6IVU.js";
|
|
10
|
-
|
|
11
|
-
// src/lib/exports/interaction.ts
|
|
12
|
-
import { property, state } from "lit/decorators.js";
|
|
13
|
-
import { LitElement } from "lit";
|
|
14
|
-
import { consume } from "@lit/context";
|
|
15
|
-
var Correctness = /* @__PURE__ */ ((Correctness2) => {
|
|
16
|
-
Correctness2["Correct"] = "correct";
|
|
17
|
-
Correctness2["PartiallyCorrect"] = "partially-correct";
|
|
18
|
-
Correctness2["Incorrect"] = "incorrect";
|
|
19
|
-
return Correctness2;
|
|
20
|
-
})(Correctness || {});
|
|
21
|
-
var Interaction = class extends LitElement {
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.disabled = false;
|
|
25
|
-
this.readonly = false;
|
|
26
|
-
this._internals = this.attachInternals();
|
|
27
|
-
}
|
|
28
|
-
static {
|
|
29
|
-
this.formAssociated = true;
|
|
30
|
-
}
|
|
31
|
-
get internals() {
|
|
32
|
-
return this._internals;
|
|
33
|
-
}
|
|
34
|
-
get isFullCorrectResponse() {
|
|
35
|
-
return this._isFullCorrectResponse;
|
|
36
|
-
}
|
|
37
|
-
set isFullCorrectResponse(val) {
|
|
38
|
-
this._isFullCorrectResponse = val;
|
|
39
|
-
if (val) {
|
|
40
|
-
this.disabled = true;
|
|
41
|
-
this.setAttribute("response-identifier", this.responseIdentifier + "_cr");
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
get correctResponse() {
|
|
45
|
-
return this._correctResponse;
|
|
46
|
-
}
|
|
47
|
-
set correctResponse(val) {
|
|
48
|
-
this._correctResponse = val;
|
|
49
|
-
}
|
|
50
|
-
get correctness() {
|
|
51
|
-
const responseVariable = this.responseVariable;
|
|
52
|
-
if (!responseVariable || responseVariable.correctResponse === null) return null;
|
|
53
|
-
return responseVariable.correctResponse === responseVariable.value ? "correct" /* Correct */ : "incorrect" /* Incorrect */;
|
|
54
|
-
}
|
|
55
|
-
get isInline() {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
get responseVariable() {
|
|
59
|
-
const responseVariables = this._context.variables.filter((v) => v.type === "response");
|
|
60
|
-
const responseIdentifier = this.getAttribute("response-identifier");
|
|
61
|
-
return responseVariables.find((v) => v.identifier === responseIdentifier);
|
|
62
|
-
}
|
|
63
|
-
toggleCorrectResponse(show) {
|
|
64
|
-
const correctResponseMode = this?.configContext?.correctResponseMode || "internal";
|
|
65
|
-
if (correctResponseMode === "full") {
|
|
66
|
-
this.toggleFullCorrectResponse(show);
|
|
67
|
-
} else {
|
|
68
|
-
this.toggleInternalCorrectResponse(show);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
async toggleFullCorrectResponse(show) {
|
|
72
|
-
const nextSibling = this.nextSibling;
|
|
73
|
-
const nextSiblingIsFullCorrectResponse = nextSibling instanceof HTMLDivElement && nextSibling?.classList.contains("full-correct-response");
|
|
74
|
-
const responseVariable = this.responseVariable;
|
|
75
|
-
if (!responseVariable) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
if (!show || this.correctness === "correct" /* Correct */) {
|
|
79
|
-
if (!nextSiblingIsFullCorrectResponse) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this.parentElement?.removeChild(nextSibling);
|
|
83
|
-
}
|
|
84
|
-
if (nextSiblingIsFullCorrectResponse) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (this.correctness === "correct" /* Correct */) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
const clone = this.cloneNode(true);
|
|
91
|
-
const containerDiv = document.createElement("div");
|
|
92
|
-
containerDiv.classList.add("full-correct-response");
|
|
93
|
-
if (this.isInline) {
|
|
94
|
-
containerDiv.classList.add("full-correct-response-inline");
|
|
95
|
-
} else {
|
|
96
|
-
containerDiv.classList.add("full-correct-response-block");
|
|
97
|
-
}
|
|
98
|
-
containerDiv.role = "full-correct-response";
|
|
99
|
-
containerDiv.appendChild(clone);
|
|
100
|
-
clone.isFullCorrectResponse = true;
|
|
101
|
-
this.parentElement?.insertBefore(containerDiv, this.nextSibling);
|
|
102
|
-
await clone.updateComplete;
|
|
103
|
-
clone.response = Array.isArray(responseVariable.correctResponse) ? [...responseVariable.correctResponse] : responseVariable.correctResponse;
|
|
104
|
-
}
|
|
105
|
-
toggleInternalCorrectResponse(show) {
|
|
106
|
-
const responseVariable = this.responseVariable;
|
|
107
|
-
this.correctResponse = show ? responseVariable?.correctResponse : responseVariable?.cardinality === "single" ? "" : [];
|
|
108
|
-
}
|
|
109
|
-
toggleCandidateCorrection(show) {
|
|
110
|
-
const responseVariable = this.responseVariable;
|
|
111
|
-
if (!responseVariable) return;
|
|
112
|
-
this._internals.states.delete("candidate-correct");
|
|
113
|
-
this._internals.states.delete("candidate-partially-correct");
|
|
114
|
-
this._internals.states.delete("candidate-incorrect");
|
|
115
|
-
if (!show) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (this.correctness === "correct" /* Correct */) {
|
|
119
|
-
this._internals.states.add("candidate-correct");
|
|
120
|
-
}
|
|
121
|
-
if (this.correctness === "partially-correct" /* PartiallyCorrect */) {
|
|
122
|
-
this._internals.states.add("candidate-partially-correct");
|
|
123
|
-
}
|
|
124
|
-
if (this.correctness === "incorrect" /* Incorrect */) {
|
|
125
|
-
this._internals.states.add("candidate-incorrect");
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
get value() {
|
|
129
|
-
return JSON.stringify(this.response);
|
|
130
|
-
}
|
|
131
|
-
set value(val) {
|
|
132
|
-
this.response = val ? JSON.parse(val) : null;
|
|
133
|
-
}
|
|
134
|
-
reportValidity() {
|
|
135
|
-
return this._internals.reportValidity();
|
|
136
|
-
}
|
|
137
|
-
reset() {
|
|
138
|
-
this.response = null;
|
|
139
|
-
}
|
|
140
|
-
// attributeChangedCallback(name: string, _old: string | null, value: string | null): void {
|
|
141
|
-
// super.attributeChangedCallback(name, _old, value);
|
|
142
|
-
// // changing attributes in lit is not a thing, they are defined in the QTI XML and will never change
|
|
143
|
-
// // except in storybook where we can change the value of the attribute
|
|
144
|
-
// // this can make the internal state out of sync with the attribute
|
|
145
|
-
// // so we reset the value to null to force the internal state to be reset
|
|
146
|
-
// const attributeNamesToExclude = ['style', 'class'];
|
|
147
|
-
// if (!attributeNamesToExclude.includes(name)) {
|
|
148
|
-
// this.reset();
|
|
149
|
-
// }
|
|
150
|
-
// }
|
|
151
|
-
connectedCallback() {
|
|
152
|
-
super.connectedCallback();
|
|
153
|
-
if (this.isFullCorrectResponse) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
this.dispatchEvent(
|
|
157
|
-
new CustomEvent("qti-register-interaction", {
|
|
158
|
-
bubbles: true,
|
|
159
|
-
composed: true,
|
|
160
|
-
cancelable: false,
|
|
161
|
-
detail: {
|
|
162
|
-
interactionElement: this,
|
|
163
|
-
responseIdentifier: this.responseIdentifier
|
|
164
|
-
}
|
|
165
|
-
})
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
saveResponse(value) {
|
|
169
|
-
this.dispatchEvent(
|
|
170
|
-
new CustomEvent("qti-interaction-response", {
|
|
171
|
-
bubbles: true,
|
|
172
|
-
composed: true,
|
|
173
|
-
cancelable: false,
|
|
174
|
-
detail: {
|
|
175
|
-
responseIdentifier: this.responseIdentifier,
|
|
176
|
-
response: Array.isArray(value) ? [...value] : value
|
|
177
|
-
}
|
|
178
|
-
})
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
__decorateClass([
|
|
183
|
-
consume({ context: itemContext, subscribe: true })
|
|
184
|
-
], Interaction.prototype, "_context", 2);
|
|
185
|
-
__decorateClass([
|
|
186
|
-
consume({ context: configContext, subscribe: true })
|
|
187
|
-
], Interaction.prototype, "configContext", 2);
|
|
188
|
-
__decorateClass([
|
|
189
|
-
property({ type: String, attribute: "response-identifier" })
|
|
190
|
-
], Interaction.prototype, "responseIdentifier", 2);
|
|
191
|
-
__decorateClass([
|
|
192
|
-
property({ reflect: true, type: Boolean })
|
|
193
|
-
], Interaction.prototype, "disabled", 2);
|
|
194
|
-
__decorateClass([
|
|
195
|
-
property({ reflect: true, type: Boolean })
|
|
196
|
-
], Interaction.prototype, "readonly", 2);
|
|
197
|
-
__decorateClass([
|
|
198
|
-
state()
|
|
199
|
-
], Interaction.prototype, "_isFullCorrectResponse", 2);
|
|
200
|
-
__decorateClass([
|
|
201
|
-
state()
|
|
202
|
-
], Interaction.prototype, "_correctResponse", 2);
|
|
203
|
-
|
|
204
|
-
export {
|
|
205
|
-
Correctness,
|
|
206
|
-
Interaction
|
|
207
|
-
};
|
|
208
|
-
//# sourceMappingURL=chunk-HFAUM56X.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/exports/interaction.ts"],"sourcesContent":["import { property, state } from 'lit/decorators.js';\nimport { LitElement } from 'lit';\nimport { consume } from '@lit/context';\n\nimport { configContext } from './config.context.ts';\nimport { itemContext } from './qti-assessment-item.context.ts';\n\nimport type { ConfigContext } from './config.context.ts';\nimport type { ResponseVariable } from './variables';\nimport type { IInteraction } from './interaction.interface';\nimport type { ItemContext } from './item.context.ts';\n\nexport enum Correctness {\n Correct = 'correct',\n PartiallyCorrect = 'partially-correct',\n Incorrect = 'incorrect'\n}\n\nexport abstract class Interaction extends LitElement implements IInteraction {\n @consume({ context: itemContext, subscribe: true })\n private _context: ItemContext;\n\n @consume({ context: configContext, subscribe: true })\n protected configContext: ConfigContext;\n\n static formAssociated = true;\n protected _internals: ElementInternals;\n\n get internals(): ElementInternals {\n return this._internals;\n }\n\n @property({ type: String, attribute: 'response-identifier' }) responseIdentifier;\n\n @property({ reflect: true, type: Boolean }) disabled = false;\n\n @property({ reflect: true, type: Boolean }) readonly = false;\n\n @state()\n protected _isFullCorrectResponse: boolean;\n\n get isFullCorrectResponse(): Readonly<boolean> {\n return this._isFullCorrectResponse;\n }\n\n set isFullCorrectResponse(val: Readonly<boolean>) {\n this._isFullCorrectResponse = val as boolean;\n if (val) {\n this.disabled = true;\n this.setAttribute('response-identifier', this.responseIdentifier + '_cr');\n }\n }\n\n /* PK: Correct response */\n @state()\n protected _correctResponse: string | string[];\n\n get correctResponse(): Readonly<string | string[]> {\n return this._correctResponse;\n }\n\n set correctResponse(val: Readonly<string | string[]>) {\n this._correctResponse = val as string | string[];\n }\n\n get correctness(): Readonly<Correctness | null> {\n const responseVariable = this.responseVariable;\n if (!responseVariable || responseVariable.correctResponse === null) return null;\n\n return responseVariable.correctResponse === responseVariable.value ? Correctness.Correct : Correctness.Incorrect;\n }\n\n get isInline(): boolean {\n return false;\n }\n\n get responseVariable(): ResponseVariable | undefined {\n // Get all response variables\n const responseVariables = this._context.variables.filter(v => v.type === 'response') as ResponseVariable[];\n\n // Get the response identifier for this interaction\n const responseIdentifier = this.getAttribute('response-identifier');\n\n // Return the matching response variable for this interaction\n return responseVariables.find(v => v.identifier === responseIdentifier);\n }\n\n public toggleCorrectResponse(show: boolean): void {\n const correctResponseMode = this?.configContext?.correctResponseMode || 'internal';\n\n if (correctResponseMode === 'full') {\n this.toggleFullCorrectResponse(show);\n } else {\n this.toggleInternalCorrectResponse(show);\n }\n }\n\n protected async toggleFullCorrectResponse(show: boolean): Promise<void> {\n const nextSibling = this.nextSibling;\n const nextSiblingIsFullCorrectResponse =\n nextSibling instanceof HTMLDivElement && nextSibling?.classList.contains('full-correct-response');\n const responseVariable = this.responseVariable;\n\n if (!responseVariable) {\n return;\n }\n\n if (!show || this.correctness === Correctness.Correct) {\n // Don't show with the correct answer responded\n if (!nextSiblingIsFullCorrectResponse) {\n return;\n }\n // Remove cloned interaction\n this.parentElement?.removeChild(nextSibling);\n }\n\n if (nextSiblingIsFullCorrectResponse) {\n return; // Already exists\n }\n\n if (this.correctness === Correctness.Correct) {\n return;\n }\n\n // Add a clone of interaction with the correct response\n const clone = this.cloneNode(true) as Interaction;\n\n const containerDiv = document.createElement('div');\n containerDiv.classList.add('full-correct-response');\n if (this.isInline) {\n containerDiv.classList.add('full-correct-response-inline');\n } else {\n containerDiv.classList.add('full-correct-response-block');\n }\n containerDiv.role = 'full-correct-response';\n containerDiv.appendChild(clone);\n\n clone.isFullCorrectResponse = true;\n\n this.parentElement?.insertBefore(containerDiv, this.nextSibling);\n await clone.updateComplete;\n\n clone.response = Array.isArray(responseVariable.correctResponse)\n ? ([...responseVariable.correctResponse] as string[])\n : (responseVariable.correctResponse as string);\n }\n\n protected toggleInternalCorrectResponse(show: boolean): void {\n const responseVariable = this.responseVariable;\n\n this.correctResponse = show\n ? responseVariable?.correctResponse\n : responseVariable?.cardinality === 'single'\n ? ''\n : [];\n }\n\n public toggleCandidateCorrection(show: boolean): void {\n const responseVariable = this.responseVariable;\n if (!responseVariable) return;\n\n this._internals.states.delete('candidate-correct');\n this._internals.states.delete('candidate-partially-correct');\n this._internals.states.delete('candidate-incorrect');\n\n if (!show) {\n return;\n }\n\n if (this.correctness === Correctness.Correct) {\n this._internals.states.add('candidate-correct');\n }\n if (this.correctness === Correctness.PartiallyCorrect) {\n this._internals.states.add('candidate-partially-correct');\n }\n if (this.correctness === Correctness.Incorrect) {\n this._internals.states.add('candidate-incorrect');\n }\n }\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n abstract validate(): boolean;\n\n get value(): string | null {\n return JSON.stringify(this.response);\n }\n\n set value(val: string | null) {\n this.response = val ? JSON.parse(val) : null;\n }\n\n abstract get response(): string | string[] | null;\n abstract set response(val: string | string[] | null);\n\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n\n public reset(): void {\n this.response = null;\n }\n\n // attributeChangedCallback(name: string, _old: string | null, value: string | null): void {\n // super.attributeChangedCallback(name, _old, value);\n // // changing attributes in lit is not a thing, they are defined in the QTI XML and will never change\n // // except in storybook where we can change the value of the attribute\n // // this can make the internal state out of sync with the attribute\n // // so we reset the value to null to force the internal state to be reset\n // const attributeNamesToExclude = ['style', 'class'];\n // if (!attributeNamesToExclude.includes(name)) {\n // this.reset();\n // }\n // }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n\n if (this.isFullCorrectResponse) {\n return;\n }\n\n this.dispatchEvent(\n new CustomEvent('qti-register-interaction', {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n interactionElement: this,\n responseIdentifier: this.responseIdentifier\n }\n })\n );\n }\n\n public saveResponse(value: string | string[]): void {\n this.dispatchEvent(\n new CustomEvent('qti-interaction-response', {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n responseIdentifier: this.responseIdentifier,\n response: Array.isArray(value) ? [...value] : value\n }\n })\n );\n }\n}\n"],"mappings":"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","names":["Correctness"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// src/lib/exports/item.context.ts
|
|
2
|
-
var itemContextVariables = [
|
|
3
|
-
{
|
|
4
|
-
identifier: "completionStatus",
|
|
5
|
-
cardinality: "single",
|
|
6
|
-
baseType: "string",
|
|
7
|
-
value: "unknown",
|
|
8
|
-
type: "outcome"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
identifier: "numAttempts",
|
|
12
|
-
cardinality: "single",
|
|
13
|
-
baseType: "integer",
|
|
14
|
-
value: "0",
|
|
15
|
-
type: "response"
|
|
16
|
-
}
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
itemContextVariables
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=chunk-JQ6HWGRY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/exports/item.context.ts"],"sourcesContent":["import type { VariableDeclaration } from './variables';\n\nexport interface ItemContext {\n identifier?: string;\n href?: string;\n variables?: ReadonlyArray<VariableDeclaration<string | string[] | null>>;\n}\n\nexport const itemContextVariables = [\n {\n identifier: 'completionStatus',\n cardinality: 'single',\n baseType: 'string',\n value: 'unknown',\n type: 'outcome'\n },\n {\n identifier: 'numAttempts',\n cardinality: 'single',\n baseType: 'integer',\n value: '0',\n type: 'response'\n }\n] as VariableDeclaration<string | string[]>[];\n"],"mappings":";AAQO,IAAM,uBAAuB;AAAA,EAClC;AAAA,IACE,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,UAAU;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,UAAU;AAAA,IACV,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
watch
|
|
3
|
-
} from "./chunk-ELDMXTUQ.js";
|
|
4
|
-
import {
|
|
5
|
-
sessionContext
|
|
6
|
-
} from "./chunk-22IRJWWY.js";
|
|
7
|
-
import {
|
|
8
|
-
__decorateClass
|
|
9
|
-
} from "./chunk-H2JE6IVU.js";
|
|
10
|
-
|
|
11
|
-
// src/lib/qti-test/components/test-view.ts
|
|
12
|
-
import { html, LitElement } from "lit";
|
|
13
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
14
|
-
import { consume } from "@lit/context";
|
|
15
|
-
var TestView = class extends LitElement {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.label = "view";
|
|
19
|
-
this._handleViewOptionsChange = () => {
|
|
20
|
-
this.updateViewOptions();
|
|
21
|
-
};
|
|
22
|
-
this._viewOptions = TestView.DEFAULT_VIEW_OPTIONS;
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() {
|
|
25
|
-
super.connectedCallback();
|
|
26
|
-
this.updateViewOptions();
|
|
27
|
-
}
|
|
28
|
-
updateViewOptions() {
|
|
29
|
-
if (this.viewOptions) {
|
|
30
|
-
const options = this.viewOptions.split(",").map((opt) => opt.trim());
|
|
31
|
-
this._viewOptions = options.filter((opt) => TestView.DEFAULT_VIEW_OPTIONS.includes(opt));
|
|
32
|
-
} else {
|
|
33
|
-
this._viewOptions = TestView.DEFAULT_VIEW_OPTIONS;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
_switchView(view) {
|
|
37
|
-
this.dispatchEvent(
|
|
38
|
-
new CustomEvent("on-test-switch-view", {
|
|
39
|
-
composed: true,
|
|
40
|
-
bubbles: true,
|
|
41
|
-
detail: view
|
|
42
|
-
})
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
render() {
|
|
46
|
-
return html`
|
|
47
|
-
<label part="label" for="viewSelect">${this.label}</label>
|
|
48
|
-
<select
|
|
49
|
-
part="select"
|
|
50
|
-
id="viewSelect"
|
|
51
|
-
@change=${(e) => {
|
|
52
|
-
const el = e.target;
|
|
53
|
-
this._switchView(el.value);
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
${this._viewOptions.map(
|
|
57
|
-
(v) => html`<option value="${v}" ?selected=${v === this.sessionContext.view}>${v}</option>`
|
|
58
|
-
)}
|
|
59
|
-
</select>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
TestView.DEFAULT_VIEW_OPTIONS = ["author", "candidate", "proctor", "scorer", "testConstructor", "tutor"];
|
|
64
|
-
__decorateClass([
|
|
65
|
-
consume({ context: sessionContext, subscribe: true })
|
|
66
|
-
], TestView.prototype, "sessionContext", 2);
|
|
67
|
-
__decorateClass([
|
|
68
|
-
property({ type: String })
|
|
69
|
-
], TestView.prototype, "label", 2);
|
|
70
|
-
__decorateClass([
|
|
71
|
-
property({ type: String, attribute: "view-options" })
|
|
72
|
-
], TestView.prototype, "viewOptions", 2);
|
|
73
|
-
__decorateClass([
|
|
74
|
-
watch("viewOptions", { waitUntilFirstUpdate: true })
|
|
75
|
-
], TestView.prototype, "_handleViewOptionsChange", 2);
|
|
76
|
-
__decorateClass([
|
|
77
|
-
state()
|
|
78
|
-
], TestView.prototype, "_viewOptions", 2);
|
|
79
|
-
TestView = __decorateClass([
|
|
80
|
-
customElement("test-view")
|
|
81
|
-
], TestView);
|
|
82
|
-
|
|
83
|
-
export {
|
|
84
|
-
TestView
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=chunk-KG5Z2CKO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-view.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { watch } from '../../decorators/watch';\n// import { computedContext } from '../../exports/computed.context';\nimport { sessionContext } from '../../exports/session.context';\n\n// import type { ComputedContext } from '../../exports/computed.context';\nimport type { SessionContext } from '../../exports/session.context';\n\n@customElement('test-view')\nexport class TestView extends LitElement {\n static DEFAULT_VIEW_OPTIONS = ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'];\n\n @consume({ context: sessionContext, subscribe: true })\n private sessionContext: SessionContext;\n\n /** label accompanying the select view dropdown */\n @property({ type: String })\n label = 'view';\n\n /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */\n @property({ type: String, attribute: 'view-options' }) viewOptions;\n @watch('viewOptions', { waitUntilFirstUpdate: true })\n protected _handleViewOptionsChange = () => {\n this.updateViewOptions();\n };\n\n connectedCallback(): void {\n super.connectedCallback();\n this.updateViewOptions();\n }\n\n @state()\n private _viewOptions: string[] = TestView.DEFAULT_VIEW_OPTIONS;\n\n private updateViewOptions() {\n if (this.viewOptions) {\n const options = this.viewOptions.split(',').map(opt => opt.trim());\n this._viewOptions = options.filter(opt => TestView.DEFAULT_VIEW_OPTIONS.includes(opt));\n } else {\n this._viewOptions = TestView.DEFAULT_VIEW_OPTIONS;\n }\n }\n\n protected _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n render() {\n return html`\n <label part=\"label\" for=\"viewSelect\">${this.label}</label>\n <select\n part=\"select\"\n id=\"viewSelect\"\n @change=${(e: Event) => {\n const el = e.target as HTMLSelectElement;\n this._switchView(el.value);\n }}\n >\n ${this._viewOptions.map(\n v => html`<option value=\"${v}\" ?selected=${v === this.sessionContext.view}>${v}</option>`\n )}\n </select>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-view': TestView;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,eAAe;AAUjB,IAAM,WAAN,cAAuB,WAAW;AAAA,EAAlC;AAAA;AAQL,iBAAQ;AAKR,SAAU,2BAA2B,MAAM;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAQA,SAAQ,eAAyB,SAAS;AAAA;AAAA,EAN1C,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,SAAK,kBAAkB;AAAA,EACzB;AAAA,EAKQ,oBAAoB;AAC1B,QAAI,KAAK,aAAa;AACpB,YAAM,UAAU,KAAK,YAAY,MAAM,GAAG,EAAE,IAAI,SAAO,IAAI,KAAK,CAAC;AACjE,WAAK,eAAe,QAAQ,OAAO,SAAO,SAAS,qBAAqB,SAAS,GAAG,CAAC;AAAA,IACvF,OAAO;AACL,WAAK,eAAe,SAAS;AAAA,IAC/B;AAAA,EACF;AAAA,EAEU,YAAY,MAAc;AAClC,SAAK;AAAA,MACH,IAAI,YAAY,uBAAuB;AAAA,QACrC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,6CACkC,KAAK,KAAK;AAAA;AAAA;AAAA;AAAA,kBAIrC,CAAC,MAAa;AACtB,YAAM,KAAK,EAAE;AACb,WAAK,YAAY,GAAG,KAAK;AAAA,IAC3B,CAAC;AAAA;AAAA,UAEC,KAAK,aAAa;AAAA,MAClB,OAAK,sBAAsB,CAAC,eAAe,MAAM,KAAK,eAAe,IAAI,IAAI,CAAC;AAAA,IAChF,CAAC;AAAA;AAAA;AAAA,EAGP;AACF;AA7Da,SACJ,uBAAuB,CAAC,UAAU,aAAa,WAAW,UAAU,mBAAmB,OAAO;AAG7F;AAAA,EADP,QAAQ,EAAE,SAAS,gBAAgB,WAAW,KAAK,CAAC;AAAA,GAH1C,SAIH;AAIR;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAPf,SAQX;AAGuD;AAAA,EAAtD,SAAS,EAAE,MAAM,QAAQ,WAAW,eAAe,CAAC;AAAA,GAX1C,SAW4C;AAE7C;AAAA,EADT,MAAM,eAAe,EAAE,sBAAsB,KAAK,CAAC;AAAA,GAZzC,SAaD;AAUF;AAAA,EADP,MAAM;AAAA,GAtBI,SAuBH;AAvBG,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computedContext
|
|
3
|
-
} from "./chunk-AZIKAG7K.js";
|
|
4
|
-
import {
|
|
5
|
-
__decorateClass
|
|
6
|
-
} from "./chunk-H2JE6IVU.js";
|
|
7
|
-
|
|
8
|
-
// src/lib/qti-test/components/test-section-buttons-stamp.ts
|
|
9
|
-
import { html, LitElement } from "lit";
|
|
10
|
-
import { customElement } from "lit/decorators.js";
|
|
11
|
-
import { prepareTemplate } from "@heximal/templates";
|
|
12
|
-
import { consume } from "@lit/context";
|
|
13
|
-
var TestSectionButtonsStamp = class extends LitElement {
|
|
14
|
-
createRenderRoot() {
|
|
15
|
-
return this;
|
|
16
|
-
}
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this._internals = this.attachInternals();
|
|
20
|
-
this._internals.ariaLabel = "pagination";
|
|
21
|
-
}
|
|
22
|
-
connectedCallback() {
|
|
23
|
-
super.connectedCallback();
|
|
24
|
-
const templateElement = this.querySelector("template");
|
|
25
|
-
this.myTemplate = prepareTemplate(templateElement);
|
|
26
|
-
}
|
|
27
|
-
render() {
|
|
28
|
-
if (!this.computedContext) return html``;
|
|
29
|
-
const sections = this.computedContext.testParts.flatMap((testPart) => testPart.sections);
|
|
30
|
-
return html` ${sections.map((item) => this.myTemplate({ item }))} `;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
__decorateClass([
|
|
34
|
-
consume({ context: computedContext, subscribe: true })
|
|
35
|
-
], TestSectionButtonsStamp.prototype, "computedContext", 2);
|
|
36
|
-
TestSectionButtonsStamp = __decorateClass([
|
|
37
|
-
customElement("test-section-buttons-stamp")
|
|
38
|
-
], TestSectionButtonsStamp);
|
|
39
|
-
|
|
40
|
-
export {
|
|
41
|
-
TestSectionButtonsStamp
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=chunk-KSXNC564.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-section-buttons-stamp.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from '@heximal/templates';\n\n/**\n * @deprecated test-section-buttons-stamp is deprecated and will be removed in the future.\n */\n@customElement('test-section-buttons-stamp')\nexport class TestSectionButtonsStamp extends LitElement {\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n myTemplate: TemplateFunction;\n private _internals: ElementInternals;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n this._internals.ariaLabel = 'pagination';\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n render() {\n if (!this.computedContext) return html``;\n const sections = this.computedContext.testParts.flatMap(testPart => testPart.sections);\n\n return html` ${sections.map(item => this.myTemplate({ item }))} `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-section-buttons-stamp': TestSectionButtonsStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAWjB,IAAM,0BAAN,cAAsC,WAAW;AAAA,EAO5C,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,aAAa,KAAK,gBAAgB;AACvC,SAAK,WAAW,YAAY;AAAA,EAC9B;AAAA,EAEA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;AAC1E,SAAK,aAAa,gBAAgB,eAAe;AAAA,EACnD;AAAA,EAEA,SAAS;AACP,QAAI,CAAC,KAAK,gBAAiB,QAAO;AAClC,UAAM,WAAW,KAAK,gBAAgB,UAAU,QAAQ,cAAY,SAAS,QAAQ;AAErF,WAAO,QAAQ,SAAS,IAAI,UAAQ,KAAK,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;AAAA,EAChE;AACF;AA3BU;AAAA,EADP,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAD3C,wBAEH;AAFG,0BAAN;AAAA,EADN,cAAc,4BAA4B;AAAA,GAC9B;","names":[]}
|