@citolab/qti-components 7.3.23 → 7.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +5485 -1
- package/custom-elements.json +29837 -0
- package/dist/chunks/chunk-4BDOB6KY.js +365 -0
- package/dist/chunks/chunk-4BDOB6KY.js.map +1 -0
- package/dist/chunks/{chunk-LF6SO3JU.js → chunk-7RW7LCEJ.js} +459 -587
- package/dist/chunks/chunk-7RW7LCEJ.js.map +1 -0
- package/dist/chunks/chunk-APBAIN6D.js +2237 -0
- package/dist/chunks/chunk-APBAIN6D.js.map +1 -0
- package/dist/chunks/{chunk-22IRJWWY.js → chunk-C5RLRG3L.js} +1 -1
- package/dist/chunks/chunk-C5RLRG3L.js.map +1 -0
- package/dist/chunks/{chunk-AZIKAG7K.js → chunk-DVQQ7I6Y.js} +1 -1
- package/dist/chunks/chunk-DVQQ7I6Y.js.map +1 -0
- package/dist/chunks/{chunk-QCB6P7DH.js → chunk-GAAFN7QF.js} +1 -1
- package/dist/chunks/{chunk-QCB6P7DH.js.map → chunk-GAAFN7QF.js.map} +1 -1
- package/dist/chunks/chunk-K47QFOQX.js +175 -0
- package/dist/chunks/chunk-K47QFOQX.js.map +1 -0
- package/dist/chunks/{chunk-FL72PF4D.js → chunk-SV4K25ZI.js} +2 -2
- package/dist/custom-elements.json +29837 -0
- package/dist/exports/computed-item.context.d.ts +1 -7
- package/dist/exports/computed.context.d.ts +2 -10
- package/dist/exports/computed.context.js +1 -1
- package/dist/exports/interaction.d.ts +45 -7
- package/dist/exports/item.context.d.ts +10 -7
- package/dist/exports/qti-assessment-item.context.d.ts +2 -7
- package/dist/exports/qti-condition-expression.d.ts +4 -5
- package/dist/exports/qti-condition-expression.js +2 -2
- package/dist/exports/qti-expression.d.ts +22 -7
- package/dist/exports/qti-expression.js +1 -1
- package/dist/exports/qti-test.d.ts +10 -38
- package/dist/exports/session.context.d.ts +2 -13
- package/dist/exports/session.context.js +1 -1
- package/dist/exports/test.context.d.ts +2 -7
- package/dist/exports/variables.d.ts +1 -7
- package/dist/index.d.ts +12 -31
- package/dist/index.js +38 -95
- package/{cdn/chunks/chunk-5TDBMEY5.js → dist/item.css} +7 -24
- package/dist/qti-assessment-item-l-mN3teH.d.ts +105 -0
- package/dist/qti-components/index.d.ts +1173 -16
- package/dist/qti-components/index.js +6 -5
- package/dist/qti-components-jsx.d.ts +4463 -0
- package/dist/qti-item/index.d.ts +114 -0
- package/dist/qti-item/index.js +19 -0
- package/dist/qti-loader/index.d.ts +2 -5
- package/dist/qti-loader/index.js +24 -4
- package/dist/qti-loader/index.js.map +1 -1
- package/dist/qti-modal-feedback-PKbhO-3w.d.ts +30 -0
- package/dist/qti-test/index.d.ts +480 -0
- package/dist/qti-test/index.js +69 -0
- package/dist/{qti-test-feedback-CZsbp6z4.d.ts → qti-test-BwvOhz_-.d.ts} +45 -18
- package/dist/variables-BCkyLoXK.d.ts +55 -0
- package/dist/vscode.css-custom-data.json +11 -0
- package/dist/vscode.html-custom-data.json +1135 -0
- package/package.json +74 -116
- 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.map +0 -1
- package/dist/chunks/chunk-36G5MQKR.js +0 -85
- package/dist/chunks/chunk-36G5MQKR.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.map +0 -1
- package/dist/chunks/chunk-BLBSZDQ4.js +0 -52
- package/dist/chunks/chunk-BLBSZDQ4.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-EMVOKXSA.js +0 -84
- package/dist/chunks/chunk-EMVOKXSA.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-GAHXUFMQ.js +0 -93
- package/dist/chunks/chunk-GAHXUFMQ.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-ODHS7HDB.js +0 -94
- package/dist/chunks/chunk-ODHS7HDB.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/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/chunks/{chunk-FL72PF4D.js.map → chunk-SV4K25ZI.js.map} +0 -0
- /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,30 +0,0 @@
|
|
|
1
|
-
// src/lib/qti-item/components/styles.ts
|
|
2
|
-
import { css } from "lit";
|
|
3
|
-
var form = css`
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
padding: 0.5rem 1rem;
|
|
8
|
-
border-radius: 0.25rem;
|
|
9
|
-
user-select: none;
|
|
10
|
-
`;
|
|
11
|
-
var btn = css`
|
|
12
|
-
background-color: lightgray;
|
|
13
|
-
${form};
|
|
14
|
-
`;
|
|
15
|
-
var dis = css`
|
|
16
|
-
cursor: not-allowed;
|
|
17
|
-
opacity: 0.8;
|
|
18
|
-
`;
|
|
19
|
-
var ind = css`
|
|
20
|
-
${form};
|
|
21
|
-
border: 1px solid gray;
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
form,
|
|
26
|
-
btn,
|
|
27
|
-
dis,
|
|
28
|
-
ind
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=chunk-DZAMXOSC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-item/components/styles.ts"],"sourcesContent":["// /* eslint-disable lit-plugin(no-invalid-css) */\nimport { css } from 'lit';\n\nexport const form = css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n`;\n\nexport const btn = css`\n background-color: lightgray;\n ${form};\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.8;\n`;\n\nexport const ind = css`\n ${form};\n border: 1px solid gray;\n`;\n"],"mappings":";AACA,SAAS,WAAW;AAEb,IAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASb,IAAM,MAAM;AAAA;AAAA,IAEf,IAAI;AAAA;AAGD,IAAM,MAAM;AAAA;AAAA;AAAA;AAKZ,IAAM,MAAM;AAAA,IACf,IAAI;AAAA;AAAA;","names":[]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
qtiTransformItem,
|
|
3
|
-
qtiTransformManifest,
|
|
4
|
-
qtiTransformTest
|
|
5
|
-
} from "./chunk-WFUXZ4UT.js";
|
|
6
|
-
|
|
7
|
-
// src/lib/qti-loader/qti-loader.ts
|
|
8
|
-
var getManifestInfo = async (manifestURL) => {
|
|
9
|
-
const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf("/"));
|
|
10
|
-
const test = await qtiTransformManifest().load(`${manifestURL}`).then((api) => api.assessmentTest());
|
|
11
|
-
const testHTMLDoc = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.htmlDoc());
|
|
12
|
-
const items = await qtiTransformTest().load(`${baseURI}/${test.href}`).then((api) => api.items());
|
|
13
|
-
const testURL = `${baseURI}/${test.href}`;
|
|
14
|
-
const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf("/"))}`;
|
|
15
|
-
return {
|
|
16
|
-
testHTMLDoc,
|
|
17
|
-
testURI,
|
|
18
|
-
testURL,
|
|
19
|
-
items,
|
|
20
|
-
testIdentifier: test.identifier
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
var getItemByUri = async (itemUri) => {
|
|
24
|
-
return qtiTransformItem().load(itemUri).promise.then((api) => api.htmlDoc().firstElementChild);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
getManifestInfo,
|
|
29
|
-
getItemByUri
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=chunk-E6V3JHVT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .promise.then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n};\n"],"mappings":";;;;;;;AAqBO,IAAM,kBAAkB,OAAO,gBAA+C;AACnF,QAAM,UAAU,YAAY,UAAU,GAAG,YAAY,YAAY,GAAG,CAAC;AAErE,QAAM,OAAO,MAAM,qBAAqB,EACrC,KAAK,GAAG,WAAW,EAAE,EACrB,KAAK,SAAO,IAAI,eAAe,CAAC;AAEnC,QAAM,cAAc,MAAM,iBAAiB,EACxC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,QAAQ,CAAC;AAE5B,QAAM,QAAQ,MAAM,iBAAiB,EAClC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,MAAM,CAAC;AAE1B,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,IAAI;AACvC,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,KAAK,UAAU,GAAG,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC;AAEhF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,KAAK;AAAA,EACvB;AACF;AAGO,IAAM,eAAe,OAAO,YAAgD;AACjF,SAAO,iBAAiB,EACrB,KAAK,OAAO,EACZ,QAAQ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;AAC7E;","names":[]}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
computedItemContext
|
|
3
|
-
} from "./chunk-4OGJBG35.js";
|
|
4
|
-
import {
|
|
5
|
-
__decorateClass
|
|
6
|
-
} from "./chunk-H2JE6IVU.js";
|
|
7
|
-
|
|
8
|
-
// src/lib/qti-item/components/print-item-variables.ts
|
|
9
|
-
import { consume } from "@lit/context";
|
|
10
|
-
import { css, html, LitElement } from "lit";
|
|
11
|
-
import { customElement } from "lit/decorators.js";
|
|
12
|
-
var PrintItemVariables = class extends LitElement {
|
|
13
|
-
render() {
|
|
14
|
-
const activeItem = this.computedContext;
|
|
15
|
-
if (!activeItem || !activeItem.variables) return html``;
|
|
16
|
-
const responseVariables = activeItem.variables.filter((v) => v.type === "response");
|
|
17
|
-
const outcomeVariables = activeItem.variables.filter((v) => v.type === "outcome");
|
|
18
|
-
const renderTable = (variables, title) => html`
|
|
19
|
-
<h3>${title}</h3>
|
|
20
|
-
<table>
|
|
21
|
-
<thead>
|
|
22
|
-
<tr>
|
|
23
|
-
<th>Identifier</th>
|
|
24
|
-
<th>Value</th>
|
|
25
|
-
<th>Cardinality</th>
|
|
26
|
-
<th>Base Type</th>
|
|
27
|
-
<th>Correct Response / Mappings</th>
|
|
28
|
-
</tr>
|
|
29
|
-
</thead>
|
|
30
|
-
<tbody>
|
|
31
|
-
${variables.map((v) => {
|
|
32
|
-
const correctResponse = v.correctResponse ? Array.isArray(v.correctResponse) ? v.correctResponse.join(", ") : v.correctResponse : "";
|
|
33
|
-
const mapEntries = v.mapping?.mapEntries?.map((m) => `${m.mapKey}=${m.mappedValue}pt`).join(", ") || "";
|
|
34
|
-
const areaMapEntries = v.areaMapping?.areaMapEntries?.map((m) => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(", ") || "";
|
|
35
|
-
return html`
|
|
36
|
-
<tr>
|
|
37
|
-
<td>${v.identifier}</td>
|
|
38
|
-
<td>${Array.isArray(v.value) ? v.value.join(", ") : v.value}</td>
|
|
39
|
-
<td>${v.cardinality}</td>
|
|
40
|
-
<td>${v.baseType}</td>
|
|
41
|
-
<td>${correctResponse || mapEntries || areaMapEntries}</td>
|
|
42
|
-
</tr>
|
|
43
|
-
`;
|
|
44
|
-
})}
|
|
45
|
-
</tbody>
|
|
46
|
-
</table>
|
|
47
|
-
`;
|
|
48
|
-
return html`
|
|
49
|
-
${renderTable(responseVariables, "Response Variables")} ${renderTable(outcomeVariables, "Outcome Variables")}
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
PrintItemVariables.styles = css`
|
|
54
|
-
table {
|
|
55
|
-
width: 100%;
|
|
56
|
-
border-collapse: collapse;
|
|
57
|
-
margin: 20px 0;
|
|
58
|
-
font-size: 14px;
|
|
59
|
-
text-align: left;
|
|
60
|
-
}
|
|
61
|
-
th,
|
|
62
|
-
td {
|
|
63
|
-
border: 1px solid #ddd;
|
|
64
|
-
padding: 8px;
|
|
65
|
-
}
|
|
66
|
-
th {
|
|
67
|
-
background-color: #f4f4f4;
|
|
68
|
-
font-weight: bold;
|
|
69
|
-
}
|
|
70
|
-
h3 {
|
|
71
|
-
margin-top: 20px;
|
|
72
|
-
font-size: 16px;
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
__decorateClass([
|
|
76
|
-
consume({ context: computedItemContext, subscribe: true })
|
|
77
|
-
], PrintItemVariables.prototype, "computedContext", 2);
|
|
78
|
-
PrintItemVariables = __decorateClass([
|
|
79
|
-
customElement("print-item-variables")
|
|
80
|
-
], PrintItemVariables);
|
|
81
|
-
|
|
82
|
-
export {
|
|
83
|
-
PrintItemVariables
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=chunk-EJZQSOHU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-item/components/print-item-variables.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { computedItemContext } from '../../exports/computed-item.context';\n\nimport type { ResponseVariable } from '../../exports/variables';\nimport type { ComputedItemContext } from '../../exports/computed-item.context';\n\n@customElement('print-item-variables')\nexport class PrintItemVariables extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n protected computedContext?: ComputedItemContext;\n\n static styles = css`\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n `;\n\n render() {\n const activeItem = this.computedContext;\n\n if (!activeItem || !activeItem.variables) return html``;\n\n const responseVariables: ResponseVariable[] = activeItem.variables.filter(v => v.type === 'response');\n const outcomeVariables = activeItem.variables.filter(v => v.type === 'outcome');\n\n const renderTable = (variables: ResponseVariable[], title: string) => html`\n <h3>${title}</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ${variables.map(v => {\n const correctResponse = v.correctResponse\n ? Array.isArray(v.correctResponse)\n ? v.correctResponse.join(', ')\n : v.correctResponse\n : '';\n\n const mapEntries = v.mapping?.mapEntries?.map(m => `${m.mapKey}=${m.mappedValue}pt`).join(', ') || '';\n\n const areaMapEntries =\n v.areaMapping?.areaMapEntries?.map(m => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(', ') || '';\n\n return html`\n <tr>\n <td>${v.identifier}</td>\n <td>${Array.isArray(v.value) ? v.value.join(', ') : v.value}</td>\n <td>${v.cardinality}</td>\n <td>${v.baseType}</td>\n <td>${correctResponse || mapEntries || areaMapEntries}</td>\n </tr>\n `;\n })}\n </tbody>\n </table>\n `;\n\n return html`\n ${renderTable(responseVariables, 'Response Variables')} ${renderTable(outcomeVariables, 'Outcome Variables')}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'print-item-variables': PrintItemVariables;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,qBAAqB;AAQvB,IAAM,qBAAN,cAAiC,WAAW;AAAA,EA2BjD,SAAS;AACP,UAAM,aAAa,KAAK;AAExB,QAAI,CAAC,cAAc,CAAC,WAAW,UAAW,QAAO;AAEjD,UAAM,oBAAwC,WAAW,UAAU,OAAO,OAAK,EAAE,SAAS,UAAU;AACpG,UAAM,mBAAmB,WAAW,UAAU,OAAO,OAAK,EAAE,SAAS,SAAS;AAE9E,UAAM,cAAc,CAAC,WAA+B,UA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
|
4
|
-
} from "./chunk-5ZHHNEDA.js";
|
|
5
|
-
import {
|
|
6
|
-
watch
|
|
7
|
-
} from "./chunk-ELDMXTUQ.js";
|
|
8
|
-
import {
|
|
9
|
-
computedContext
|
|
10
|
-
} from "./chunk-AZIKAG7K.js";
|
|
11
|
-
import {
|
|
12
|
-
__decorateClass
|
|
13
|
-
} from "./chunk-H2JE6IVU.js";
|
|
14
|
-
|
|
15
|
-
// src/lib/qti-test/components/test-prev.ts
|
|
16
|
-
import { css, html, LitElement } from "lit";
|
|
17
|
-
import { customElement, property } from "lit/decorators.js";
|
|
18
|
-
import { consume } from "@lit/context";
|
|
19
|
-
var TestPrev = class extends LitElement {
|
|
20
|
-
constructor() {
|
|
21
|
-
super();
|
|
22
|
-
this._internalDisabled = true;
|
|
23
|
-
this.addEventListener("click", (e) => {
|
|
24
|
-
e.preventDefault();
|
|
25
|
-
if (!this._internalDisabled) this._requestItem(this.sectionItems[this.itemIndex - 1].identifier);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
_handleTestElementChange(_oldValue, newValue) {
|
|
29
|
-
if (newValue) {
|
|
30
|
-
this._internalDisabled = false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
willUpdate(_changedProperties) {
|
|
34
|
-
if (!this.computedContext) return;
|
|
35
|
-
const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
|
|
36
|
-
if (!testPart) return;
|
|
37
|
-
this.sectionItems = testPart.sections.flatMap((section) => section.items);
|
|
38
|
-
this.itemIndex = this.sectionItems.findIndex((item) => item.active);
|
|
39
|
-
this.checkDisabled();
|
|
40
|
-
}
|
|
41
|
-
checkDisabled() {
|
|
42
|
-
this._internalDisabled = !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;
|
|
43
|
-
}
|
|
44
|
-
_requestItem(identifier) {
|
|
45
|
-
this.dispatchEvent(
|
|
46
|
-
new CustomEvent("qti-request-navigation", {
|
|
47
|
-
composed: true,
|
|
48
|
-
bubbles: true,
|
|
49
|
-
detail: {
|
|
50
|
-
type: "item",
|
|
51
|
-
id: identifier
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
return html`<slot></slot>`;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
TestPrev.styles = css`
|
|
61
|
-
:host {
|
|
62
|
-
${btn};
|
|
63
|
-
}
|
|
64
|
-
:host([disabled]) {
|
|
65
|
-
${dis};
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
68
|
-
__decorateClass([
|
|
69
|
-
property({ type: Boolean, reflect: true, attribute: "disabled" })
|
|
70
|
-
], TestPrev.prototype, "_internalDisabled", 2);
|
|
71
|
-
__decorateClass([
|
|
72
|
-
consume({ context: computedContext, subscribe: true })
|
|
73
|
-
], TestPrev.prototype, "computedContext", 2);
|
|
74
|
-
__decorateClass([
|
|
75
|
-
watch("computedContext")
|
|
76
|
-
], TestPrev.prototype, "_handleTestElementChange", 1);
|
|
77
|
-
TestPrev = __decorateClass([
|
|
78
|
-
customElement("test-prev")
|
|
79
|
-
], TestPrev);
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
TestPrev
|
|
83
|
-
};
|
|
84
|
-
//# sourceMappingURL=chunk-EMVOKXSA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-prev.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\nimport { watch } from '../../decorators';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext, ComputedItem } from '../../exports/computed.context';\n\n/**\n * Represents a custom element for navigating to the previous test item.\n *\n * @remarks\n * This element provides functionality for navigating to the previous test item.\n *\n * @example\n * ```html\n * <test-prev></test-prev>\n * ```\n */\n@customElement('test-prev')\nexport class TestPrev extends LitElement {\n @property({ type: Boolean, reflect: true, attribute: 'disabled' })\n public _internalDisabled = true;\n\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n sectionItems: ComputedItem[];\n itemIndex: number;\n\n @watch('computedContext')\n _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext) {\n if (newValue) {\n this._internalDisabled = false;\n }\n }\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this._internalDisabled) this._requestItem(this.sectionItems[this.itemIndex - 1].identifier);\n });\n }\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n if (!this.computedContext) return;\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n if (!testPart) return;\n this.sectionItems = testPart.sections.flatMap(section => section.items);\n this.itemIndex = this.sectionItems.findIndex(item => item.active);\n this.checkDisabled();\n }\n\n checkDisabled() {\n this._internalDisabled = !this.computedContext || this.itemIndex === 0 || this.itemIndex === -1;\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-navigation', {\n composed: true,\n bubbles: true,\n detail: {\n type: 'item',\n id: identifier\n }\n })\n );\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-previous': TestPrev;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;AACxC,SAAS,eAAe;AAoBjB,IAAM,WAAN,cAAuB,WAAW;AAAA,EA0BvC,cAAc;AACZ,UAAM;AAzBR,SAAO,oBAAoB;AA2BzB,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,kBAAmB,MAAK,aAAa,KAAK,aAAa,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjG,CAAC;AAAA,EACH;AAAA,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
-
watch
|
|
6
|
-
} from "./chunk-ELDMXTUQ.js";
|
|
7
|
-
import {
|
|
8
|
-
qtiTransformItem
|
|
9
|
-
} from "./chunk-WFUXZ4UT.js";
|
|
10
|
-
import {
|
|
11
|
-
__decorateClass
|
|
12
|
-
} from "./chunk-H2JE6IVU.js";
|
|
13
|
-
|
|
14
|
-
// src/lib/qti-item/components/item-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 ItemContainer = class extends LitElement {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.itemURL = null;
|
|
22
|
-
this.itemDoc = null;
|
|
23
|
-
this.itemXML = null;
|
|
24
|
-
/** Template content if provided */
|
|
25
|
-
this.templateContent = null;
|
|
26
|
-
}
|
|
27
|
-
async handleItemURLChange() {
|
|
28
|
-
if (!this.itemURL) return;
|
|
29
|
-
try {
|
|
30
|
-
const { promise: api } = await qtiTransformItem().load(this.itemURL);
|
|
31
|
-
this.itemDoc = (await api).htmlDoc();
|
|
32
|
-
} catch (error) {
|
|
33
|
-
console.error("Error loading or parsing XML:", error);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
handleItemXMLChange() {
|
|
37
|
-
if (!this.itemXML) return;
|
|
38
|
-
try {
|
|
39
|
-
this.itemDoc = qtiTransformItem().parse(this.itemXML).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.itemURL) {
|
|
49
|
-
this.handleItemURLChange();
|
|
50
|
-
}
|
|
51
|
-
if (this.itemXML) {
|
|
52
|
-
this.handleItemXMLChange();
|
|
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.itemDoc, html`<span>Loading...</span>`)}
|
|
69
|
-
`;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
__decorateClass([
|
|
73
|
-
property({ type: String, attribute: "item-url" })
|
|
74
|
-
], ItemContainer.prototype, "itemURL", 2);
|
|
75
|
-
__decorateClass([
|
|
76
|
-
state()
|
|
77
|
-
], ItemContainer.prototype, "itemDoc", 2);
|
|
78
|
-
__decorateClass([
|
|
79
|
-
state()
|
|
80
|
-
], ItemContainer.prototype, "itemXML", 2);
|
|
81
|
-
__decorateClass([
|
|
82
|
-
watch("itemURL", { waitUntilFirstUpdate: true })
|
|
83
|
-
], ItemContainer.prototype, "handleItemURLChange", 1);
|
|
84
|
-
__decorateClass([
|
|
85
|
-
watch("itemXML", { waitUntilFirstUpdate: true })
|
|
86
|
-
], ItemContainer.prototype, "handleItemXMLChange", 1);
|
|
87
|
-
ItemContainer = __decorateClass([
|
|
88
|
-
customElement("item-container")
|
|
89
|
-
], ItemContainer);
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
ItemContainer
|
|
93
|
-
};
|
|
94
|
-
//# sourceMappingURL=chunk-ETLOKJAG.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-item/components/item-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 { qtiTransformItem } from '../../qti-transformers';\n\n/**\n * `<item-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-item` will be placed inside the shadow DOM of this element.\n * The element loads the item from the provided URL and renders it inside the shadow DOM.\n *\n * ### Styling\n * Add a class to the element for styling.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('item-container')\nexport class ItemContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'item-url' })\n itemURL: string = null;\n\n /** A parsed HTML document */\n @state()\n itemDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n itemXML: string = null;\n\n /** Template content if provided */\n private templateContent = null;\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const { promise: api } = await qtiTransformItem().load(this.itemURL);\n this.itemDoc = (await api).htmlDoc();\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('itemXML', { waitUntilFirstUpdate: true })\n protected handleItemXMLChange() {\n if (!this.itemXML) return;\n try {\n this.itemDoc = qtiTransformItem().parse(this.itemXML).htmlDoc();\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.initializeTemplateContent();\n this.applyStyles();\n if (this.itemURL) {\n this.handleItemURLChange();\n }\n if (this.itemXML) {\n this.handleItemXMLChange();\n }\n }\n\n private initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.templateContent = template ? template.content : html``;\n }\n\n private applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n render() {\n return html`\n ${this.templateContent}\n <slot></slot>\n ${until(this.itemDoc, html`<span>Loading...</span>`)}\n `;\n }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P,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,93 +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-stamp.ts
|
|
9
|
-
import { html, LitElement, nothing } from "lit";
|
|
10
|
-
import { customElement, property, state } from "lit/decorators.js";
|
|
11
|
-
import { prepareTemplate } from "@heximal/templates";
|
|
12
|
-
import { consume } from "@lit/context";
|
|
13
|
-
var TestStamp = class extends LitElement {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.debug = false;
|
|
17
|
-
this.stampContext = {
|
|
18
|
-
view: "candidate",
|
|
19
|
-
activeItem: {},
|
|
20
|
-
activeSection: {
|
|
21
|
-
items: []
|
|
22
|
-
},
|
|
23
|
-
activeTestpart: {
|
|
24
|
-
items: [],
|
|
25
|
-
sections: []
|
|
26
|
-
},
|
|
27
|
-
test: {}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
createRenderRoot() {
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
connectedCallback() {
|
|
34
|
-
super.connectedCallback();
|
|
35
|
-
const templateElement = this.querySelector("template");
|
|
36
|
-
if (!templateElement) {
|
|
37
|
-
this.myTemplate = null;
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
this.myTemplate = prepareTemplate(templateElement);
|
|
41
|
-
}
|
|
42
|
-
willUpdate(_changedProperties) {
|
|
43
|
-
if (!this.computedContext) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const activeTestPart = this.computedContext.testParts.find((testPart) => testPart.active);
|
|
47
|
-
const activeSection = activeTestPart?.sections.find((section) => section.active);
|
|
48
|
-
const activeItem = activeSection?.items.find((item) => item.active);
|
|
49
|
-
const { variables, ...augmentedItem } = activeItem || {};
|
|
50
|
-
if (!activeTestPart || !activeSection || !activeItem) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const augmentedTestPart = {
|
|
54
|
-
...activeTestPart,
|
|
55
|
-
items: activeTestPart.sections.flatMap((section) => section.items.map(({ variables: variables2, ...rest }) => rest)),
|
|
56
|
-
sections: activeTestPart.sections.map((section) => ({
|
|
57
|
-
...section,
|
|
58
|
-
items: section.items.map(({ variables: variables2, ...rest }) => rest)
|
|
59
|
-
}))
|
|
60
|
-
};
|
|
61
|
-
const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables: variables2, ...rest }) => rest) };
|
|
62
|
-
const { testParts, ...activeTest } = this.computedContext;
|
|
63
|
-
this.stampContext = {
|
|
64
|
-
view: this.computedContext.view,
|
|
65
|
-
activeItem: augmentedItem,
|
|
66
|
-
activeSection: augmentedSection,
|
|
67
|
-
activeTestpart: augmentedTestPart,
|
|
68
|
-
test: activeTest
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
render() {
|
|
72
|
-
return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}
|
|
73
|
-
${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
__decorateClass([
|
|
77
|
-
property({ type: Boolean, reflect: true })
|
|
78
|
-
], TestStamp.prototype, "debug", 2);
|
|
79
|
-
__decorateClass([
|
|
80
|
-
state(),
|
|
81
|
-
consume({ context: computedContext, subscribe: true })
|
|
82
|
-
], TestStamp.prototype, "computedContext", 2);
|
|
83
|
-
__decorateClass([
|
|
84
|
-
state()
|
|
85
|
-
], TestStamp.prototype, "stampContext", 2);
|
|
86
|
-
TestStamp = __decorateClass([
|
|
87
|
-
customElement("test-stamp")
|
|
88
|
-
], TestStamp);
|
|
89
|
-
|
|
90
|
-
export {
|
|
91
|
-
TestStamp
|
|
92
|
-
};
|
|
93
|
-
//# sourceMappingURL=chunk-GAHXUFMQ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-stamp.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { prepareTemplate } from '@heximal/templates';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { View } from '../core/mixins/test-view.mixin';\nimport type { PropertyValues } from 'lit';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from '@heximal/templates';\n\n/**\n * A custom web component that renders a test stamp using the Lit framework.\n * This component is deprecated and will be removed in the future.\n * @customElement\n * @extends {LitElement}\n */\n@customElement('test-stamp')\nexport class TestStamp extends LitElement {\n /**\n * Indicates whether the component is in debug mode.\n * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.\n */\n @property({ type: Boolean, reflect: true })\n public debug = false;\n\n @state()\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n @state()\n private stampContext: {\n view?: View;\n test?: unknown;\n activeTestpart?: unknown;\n activeSection?: unknown;\n activeItem?: unknown;\n } = {\n view: 'candidate',\n activeItem: {},\n activeSection: {\n items: []\n },\n activeTestpart: {\n items: [],\n sections: []\n },\n test: {}\n };\n\n myTemplate: TemplateFunction;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n if (!this.computedContext) {\n return;\n }\n const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);\n const activeSection = activeTestPart?.sections.find(section => section.active);\n const activeItem = activeSection?.items.find(item => item.active);\n const { variables, ...augmentedItem } = activeItem || {};\n\n if (!activeTestPart || !activeSection || !activeItem) {\n return;\n }\n\n const augmentedTestPart = {\n ...activeTestPart,\n items: activeTestPart.sections.flatMap(section => section.items.map(({ variables, ...rest }) => rest)),\n sections: activeTestPart.sections.map(section => ({\n ...section,\n items: section.items.map(({ variables, ...rest }) => rest)\n }))\n };\n\n const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables, ...rest }) => rest) };\n const { testParts, ...activeTest } = this.computedContext;\n\n this.stampContext = {\n view: this.computedContext.view,\n activeItem: augmentedItem,\n activeSection: augmentedSection,\n activeTestpart: augmentedTestPart,\n test: activeTest\n };\n }\n\n render() {\n // if (!this.stampContext) return nothing;\n return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}\n ${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAgBjB,IAAM,YAAN,cAAwB,WAAW;AAAA,EAAnC;AAAA;AAML,SAAO,QAAQ;AAOf,SAAQ,eAMJ;AAAA,MACF,M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,KAAK,MAAM,IAAI,EAAE;AAC9G,UAAM,EAAE,WAAW,GAAG,WAAW,IAAI,KAAK;AAE1C,SAAK,eAAe;AAAA,MAClB,MAAM,KAAK,gBAAgB;AAAA,MAC3B,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,gBAAgB;AAAA,MAChB,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EAEA,SAAS;AAEP,WAAO,QAAQ,KAAK,QAAQ,mBAAmB,KAAK,UAAU,KAAK,cAAc,MAAM,CAAC,CAAC,mBAAmB,OAAO;AAAA,MACjH,KAAK,aAAa,KAAK,WAAW,KAAK,YAAY,IAAI,OAAO;AAAA,EAClE;AACF;AAjFS;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAL/B,UAMJ;AAIC;AAAA,EAFP,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAT3C,UAUH;AAGA;AAAA,EADP,MAAM;AAAA,GAZI,UAaH;AAbG,YAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":["variables"]}
|
|
@@ -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":[]}
|