@citolab/qti-components 7.1.0 → 7.1.2
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/chunks/chunk-27WPPEWB.js +1 -0
- package/cdn/chunks/chunk-2HL3OFY7.js +1 -0
- package/cdn/chunks/chunk-33UT2QKP.js +5 -0
- package/cdn/chunks/chunk-3M3VWZCU.js +8 -0
- package/cdn/chunks/chunk-3QAOJL7Y.js +1007 -0
- package/cdn/chunks/chunk-3R4ZTZYA.js +5 -0
- package/cdn/chunks/chunk-6DWYLZ5E.js +5 -0
- package/cdn/chunks/chunk-6RVWXAM7.js +8 -0
- package/cdn/chunks/chunk-7HXSSTSU.js +1 -0
- package/cdn/chunks/chunk-7JXSJZV5.js +8 -0
- package/cdn/chunks/chunk-7QMIMK5V.js +5 -0
- package/cdn/chunks/chunk-7RLNGBXK.js +1 -0
- package/cdn/chunks/chunk-AHZ3W4YP.js +8 -0
- package/cdn/chunks/chunk-BGHD6LZP.js +1007 -0
- package/cdn/chunks/chunk-C73FEG6J.js +1 -0
- package/cdn/chunks/chunk-CFS5WXCD.js +1 -0
- package/cdn/chunks/chunk-CZDMOYYF.js +1 -0
- package/cdn/chunks/chunk-EBVKDAVL.js +5 -0
- package/cdn/chunks/chunk-EEFB2V7Q.js +27 -0
- package/cdn/chunks/chunk-ELZQC26E.js +5 -0
- package/cdn/chunks/chunk-EPOG3VSF.js +5 -0
- package/cdn/chunks/chunk-FDKTSUOQ.js +48 -0
- package/cdn/chunks/chunk-FJOHSSA3.js +1 -0
- package/cdn/chunks/chunk-G5YNM432.js +5 -0
- package/cdn/chunks/chunk-GIJVMMKY.js +1007 -0
- package/cdn/chunks/chunk-GNIERKRX.js +1007 -0
- package/cdn/chunks/chunk-GTHARXCW.js +10 -0
- package/cdn/chunks/chunk-IRLG6H7G.js +1 -0
- package/cdn/chunks/chunk-J3F2YSRA.js +1007 -0
- package/cdn/chunks/chunk-J4ISS5TZ.js +5 -0
- package/cdn/chunks/chunk-KBJYE746.js +5 -0
- package/cdn/chunks/chunk-KIH2VB5Z.js +1 -0
- package/cdn/chunks/chunk-KJJG5SSY.js +1 -0
- package/cdn/chunks/chunk-KLRM2GAU.js +8 -0
- package/cdn/chunks/chunk-KQT5S3DK.js +5 -0
- package/cdn/chunks/chunk-LDKKOMIK.js +3570 -0
- package/cdn/chunks/chunk-LDXZOGPY.js +10 -0
- package/cdn/chunks/chunk-LUVDXKE2.js +5 -0
- package/cdn/chunks/chunk-LZQKENA3.js +1 -0
- package/cdn/chunks/chunk-MGLK2Q6K.js +5 -0
- package/cdn/chunks/chunk-MK2CR5DP.js +1 -0
- package/cdn/chunks/chunk-N5JQAYOR.js +1 -0
- package/cdn/chunks/chunk-NJUBWVY3.js +10 -0
- package/cdn/chunks/chunk-NQKAQ6AU.js +1007 -0
- package/cdn/chunks/chunk-NW5VVFA5.js +5 -0
- package/cdn/chunks/chunk-OYUWBJSX.js +1 -0
- package/cdn/chunks/chunk-PBZODDGJ.js +1 -0
- package/cdn/chunks/chunk-PJFJOZNR.js +48 -0
- package/cdn/chunks/chunk-PMIMCEQ2.js +1 -0
- package/cdn/chunks/chunk-PYOOOJUP.js +3547 -0
- package/cdn/chunks/chunk-Q6HFDDZ4.js +1 -0
- package/cdn/chunks/chunk-QQR6POPY.js +1 -0
- package/cdn/chunks/chunk-QS2LH2IW.js +1007 -0
- package/cdn/chunks/chunk-QUFRWTHS.js +1 -0
- package/cdn/chunks/chunk-RJB5E47I.js +1 -0
- package/cdn/chunks/chunk-SFY52QPM.js +1 -0
- package/cdn/chunks/chunk-SUXBSENJ.js +48 -0
- package/cdn/chunks/chunk-SYO32O6X.js +1 -0
- package/cdn/chunks/chunk-TUWPPE7H.js +1 -0
- package/cdn/chunks/chunk-UHILPQTT.js +10 -0
- package/cdn/chunks/chunk-UOY4MCKX.js +6 -0
- package/cdn/chunks/chunk-VLCD4DFD.js +8 -0
- package/cdn/chunks/chunk-VRTU4ZV6.js +48 -0
- package/cdn/chunks/chunk-VXDODYB5.js +1007 -0
- package/cdn/chunks/chunk-W7GYEQJQ.js +1 -0
- package/cdn/chunks/chunk-WNI2D7SG.js +1 -0
- package/cdn/chunks/chunk-WNJ3YFMW.js +1 -0
- package/cdn/chunks/chunk-WRFAZSRX.js +1007 -0
- package/cdn/chunks/chunk-WTUTTA5R.js +1 -0
- package/cdn/chunks/chunk-WVVKSWZV.js +5 -0
- package/cdn/chunks/chunk-WXFIEBQR.js +0 -0
- package/cdn/chunks/chunk-X75XIXUI.js +10 -0
- package/cdn/chunks/chunk-XPI6OOWN.js +27 -0
- package/cdn/chunks/chunk-YBPCVJIX.js +10 -0
- package/cdn/chunks/chunk-YTSCJPU2.js +1007 -0
- package/cdn/chunks/chunk-YZQZGOYM.js +1 -0
- package/cdn/chunks/chunk-ZHVOZ7WZ.js +1007 -0
- package/cdn/exports/session.context.js +1 -1
- package/cdn/exports/test.context.js +1 -1
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/test-navigation.js +1 -1
- package/cdn/qti-test/components/test-print-context.js +1 -0
- package/cdn/qti-test/components/test-print-item-variables copy.js +1 -0
- package/cdn/qti-test/components/test-print-item-variables.js +1 -1
- package/cdn/qti-test/components/test-print-item-variables.stories copy.js +233 -0
- package/cdn/qti-test/components/test-print-test-context.js +1 -0
- package/cdn/qti-test/components/test-view.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/dist/chunks/chunk-2BVFKYAB.js +659 -0
- package/dist/chunks/chunk-2BVFKYAB.js.map +1 -0
- package/dist/chunks/chunk-2RXVRB7Z.js +659 -0
- package/dist/chunks/chunk-2RXVRB7Z.js.map +1 -0
- package/dist/chunks/chunk-2ZTRBYHP.js +660 -0
- package/dist/chunks/chunk-2ZTRBYHP.js.map +1 -0
- package/dist/chunks/chunk-36LEJZEY.js +87 -0
- package/dist/chunks/chunk-36LEJZEY.js.map +1 -0
- package/dist/chunks/chunk-373M5NVS.js +62 -0
- package/dist/chunks/chunk-373M5NVS.js.map +1 -0
- package/dist/chunks/chunk-3DEV5ARX.js +89 -0
- package/dist/chunks/chunk-3DEV5ARX.js.map +1 -0
- package/dist/chunks/chunk-3GCBMXXY.js +62 -0
- package/dist/chunks/chunk-3GCBMXXY.js.map +1 -0
- package/dist/chunks/chunk-3NH5KOQ4.js +89 -0
- package/dist/chunks/chunk-3NH5KOQ4.js.map +1 -0
- package/dist/chunks/chunk-4BDSKOGB.js +6873 -0
- package/dist/chunks/chunk-4BDSKOGB.js.map +1 -0
- package/dist/chunks/chunk-4BIRH5VP.js +99 -0
- package/dist/chunks/chunk-4BIRH5VP.js.map +1 -0
- package/dist/chunks/chunk-4O3EJ3SA.js +3884 -0
- package/dist/chunks/chunk-4O3EJ3SA.js.map +1 -0
- package/dist/chunks/chunk-4Z3IMDB5.js +84 -0
- package/dist/chunks/chunk-4Z3IMDB5.js.map +1 -0
- package/dist/chunks/chunk-6ITJ2I3A.js +82 -0
- package/dist/chunks/chunk-6ITJ2I3A.js.map +1 -0
- package/dist/chunks/chunk-75ZDJN64.js +32 -0
- package/dist/chunks/chunk-75ZDJN64.js.map +1 -0
- package/dist/chunks/chunk-76SJLOAE.js +84 -0
- package/dist/chunks/chunk-76SJLOAE.js.map +1 -0
- package/dist/chunks/chunk-7JS7FRDO.js +89 -0
- package/dist/chunks/chunk-7JS7FRDO.js.map +1 -0
- package/dist/chunks/chunk-7WL6TAJE.js +6872 -0
- package/dist/chunks/chunk-7WL6TAJE.js.map +1 -0
- package/dist/chunks/chunk-AD5H6KYS.js +78 -0
- package/dist/chunks/chunk-AD5H6KYS.js.map +1 -0
- package/dist/chunks/chunk-AQLCQATM.js +62 -0
- package/dist/chunks/chunk-AQLCQATM.js.map +1 -0
- package/dist/chunks/chunk-AWQHFFVL.js +659 -0
- package/dist/chunks/chunk-AWQHFFVL.js.map +1 -0
- package/dist/chunks/chunk-BLUHTHXX.js +6877 -0
- package/dist/chunks/chunk-BLUHTHXX.js.map +1 -0
- package/dist/chunks/chunk-BO6QD3VK.js +27 -0
- package/dist/chunks/chunk-BO6QD3VK.js.map +1 -0
- package/dist/chunks/chunk-BQ22JHXC.js +6877 -0
- package/dist/chunks/chunk-BQ22JHXC.js.map +1 -0
- package/dist/chunks/chunk-BWM6SEM3.js +659 -0
- package/dist/chunks/chunk-BWM6SEM3.js.map +1 -0
- package/dist/chunks/chunk-C2FVCRYJ.js +660 -0
- package/dist/chunks/chunk-C2FVCRYJ.js.map +1 -0
- package/dist/chunks/chunk-CIVMCP3W.js +78 -0
- package/dist/chunks/chunk-CIVMCP3W.js.map +1 -0
- package/dist/chunks/chunk-CJADUWEC.js +10 -0
- package/dist/chunks/chunk-CJADUWEC.js.map +1 -0
- package/dist/chunks/chunk-DCKLAFBL.js +79 -0
- package/dist/chunks/chunk-DCKLAFBL.js.map +1 -0
- package/dist/chunks/chunk-EHRC7LG6.js +3638 -0
- package/dist/chunks/chunk-EHRC7LG6.js.map +1 -0
- package/dist/chunks/chunk-ELXD2ZSR.js +218 -0
- package/dist/chunks/chunk-ELXD2ZSR.js.map +1 -0
- package/dist/chunks/chunk-EQUEIZJL.js +27 -0
- package/dist/chunks/chunk-EQUEIZJL.js.map +1 -0
- package/dist/chunks/chunk-EREPAU3B.js +80 -0
- package/dist/chunks/chunk-EREPAU3B.js.map +1 -0
- package/dist/chunks/chunk-EXOIDEQ6.js +660 -0
- package/dist/chunks/chunk-EXOIDEQ6.js.map +1 -0
- package/dist/chunks/chunk-FFF7WZJF.js +33 -0
- package/dist/chunks/chunk-FFF7WZJF.js.map +1 -0
- package/dist/chunks/chunk-FJJMZEPV.js +95 -0
- package/dist/chunks/chunk-FJJMZEPV.js.map +1 -0
- package/dist/chunks/chunk-G5DLHZE2.js +659 -0
- package/dist/chunks/chunk-G5DLHZE2.js.map +1 -0
- package/dist/chunks/chunk-HD63HGFY.js +52 -0
- package/dist/chunks/chunk-HD63HGFY.js.map +1 -0
- package/dist/chunks/chunk-HUKKTEBP.js +99 -0
- package/dist/chunks/chunk-HUKKTEBP.js.map +1 -0
- package/dist/chunks/chunk-HXGGGOV2.js +86 -0
- package/dist/chunks/chunk-HXGGGOV2.js.map +1 -0
- package/dist/chunks/chunk-HZYAIUVZ.js +6872 -0
- package/dist/chunks/chunk-HZYAIUVZ.js.map +1 -0
- package/dist/chunks/chunk-IT744RXI.js +75 -0
- package/dist/chunks/chunk-IT744RXI.js.map +1 -0
- package/dist/chunks/chunk-IXVOEGNZ.js +87 -0
- package/dist/chunks/chunk-IXVOEGNZ.js.map +1 -0
- package/dist/chunks/chunk-JEM74SR3.js +85 -0
- package/dist/chunks/chunk-JEM74SR3.js.map +1 -0
- package/dist/chunks/chunk-JP22YLJ6.js +219 -0
- package/dist/chunks/chunk-JP22YLJ6.js.map +1 -0
- package/dist/chunks/chunk-JVGOS45U.js +660 -0
- package/dist/chunks/chunk-JVGOS45U.js.map +1 -0
- package/dist/chunks/chunk-JWVGRAWQ.js +6872 -0
- package/dist/chunks/chunk-JWVGRAWQ.js.map +1 -0
- package/dist/chunks/chunk-JWX6ZOZ6.js +86 -0
- package/dist/chunks/chunk-JWX6ZOZ6.js.map +1 -0
- package/dist/chunks/chunk-JZMZLOTW.js +32 -0
- package/dist/chunks/chunk-JZMZLOTW.js.map +1 -0
- package/dist/chunks/chunk-KS3SCUUO.js +92 -0
- package/dist/chunks/chunk-KS3SCUUO.js.map +1 -0
- package/dist/chunks/chunk-LOPCNZ26.js +95 -0
- package/dist/chunks/chunk-LOPCNZ26.js.map +1 -0
- package/dist/chunks/chunk-LSNOL7NJ.js +6872 -0
- package/dist/chunks/chunk-LSNOL7NJ.js.map +1 -0
- package/dist/chunks/chunk-M4E2ACHZ.js +75 -0
- package/dist/chunks/chunk-M4E2ACHZ.js.map +1 -0
- package/dist/chunks/chunk-MQS7RZFR.js +85 -0
- package/dist/chunks/chunk-MQS7RZFR.js.map +1 -0
- package/dist/chunks/chunk-N3JFTFIL.js +79 -0
- package/dist/chunks/chunk-N3JFTFIL.js.map +1 -0
- package/dist/chunks/chunk-OSMLF3OH.js +6868 -0
- package/dist/chunks/chunk-OSMLF3OH.js.map +1 -0
- package/dist/chunks/chunk-OWWUE3LK.js +660 -0
- package/dist/chunks/chunk-OWWUE3LK.js.map +1 -0
- package/dist/chunks/chunk-P36CLOLO.js +27 -0
- package/dist/chunks/chunk-P36CLOLO.js.map +1 -0
- package/dist/chunks/chunk-PL32YWZA.js +30 -0
- package/dist/chunks/chunk-PL32YWZA.js.map +1 -0
- package/dist/chunks/chunk-Q5JLRHTY.js +659 -0
- package/dist/chunks/chunk-Q5JLRHTY.js.map +1 -0
- package/dist/chunks/chunk-RB227QQP.js +659 -0
- package/dist/chunks/chunk-RB227QQP.js.map +1 -0
- package/dist/chunks/chunk-TC5ZLAPV.js +218 -0
- package/dist/chunks/chunk-TC5ZLAPV.js.map +1 -0
- package/dist/chunks/chunk-TRSEENUK.js +45 -0
- package/dist/chunks/chunk-TRSEENUK.js.map +1 -0
- package/dist/chunks/chunk-U7VUCT7D.js +659 -0
- package/dist/chunks/chunk-U7VUCT7D.js.map +1 -0
- package/dist/chunks/chunk-UEX52I7G.js +1 -0
- package/dist/chunks/chunk-UEX52I7G.js.map +1 -0
- package/dist/chunks/chunk-UFRDMBKM.js +43 -0
- package/dist/chunks/chunk-UFRDMBKM.js.map +1 -0
- package/dist/chunks/chunk-USJXIVR4.js +6872 -0
- package/dist/chunks/chunk-USJXIVR4.js.map +1 -0
- package/dist/chunks/chunk-UZ4QB5IO.js +10 -0
- package/dist/chunks/chunk-UZ4QB5IO.js.map +1 -0
- package/dist/chunks/chunk-V2EYNAG4.js +659 -0
- package/dist/chunks/chunk-V2EYNAG4.js.map +1 -0
- package/dist/chunks/chunk-WJBYWKIF.js +32 -0
- package/dist/chunks/chunk-WJBYWKIF.js.map +1 -0
- package/dist/chunks/chunk-WOVQFPIV.js +6872 -0
- package/dist/chunks/chunk-WOVQFPIV.js.map +1 -0
- package/dist/chunks/chunk-WPUMEBSF.js +33 -0
- package/dist/chunks/chunk-WPUMEBSF.js.map +1 -0
- package/dist/chunks/chunk-WVVYYP6F.js +218 -0
- package/dist/chunks/chunk-WVVYYP6F.js.map +1 -0
- package/dist/chunks/chunk-XSHHCMRC.js +217 -0
- package/dist/chunks/chunk-XSHHCMRC.js.map +1 -0
- package/dist/chunks/chunk-XZTGFLMB.js +6872 -0
- package/dist/chunks/chunk-XZTGFLMB.js.map +1 -0
- package/dist/chunks/chunk-ZBMTSE6Q.js +660 -0
- package/dist/chunks/chunk-ZBMTSE6Q.js.map +1 -0
- package/dist/chunks/chunk-ZMTMIG3C.js +77 -0
- package/dist/chunks/chunk-ZMTMIG3C.js.map +1 -0
- package/dist/chunks/chunk-ZSR4X4I6.js +638 -0
- package/dist/chunks/chunk-ZSR4X4I6.js.map +1 -0
- package/dist/exports/interaction.js +1 -1
- package/dist/exports/session.context.d.ts +1 -1
- package/dist/exports/session.context.js +3 -1
- package/dist/exports/test.context.d.ts +2 -1
- package/dist/exports/test.context.js +3 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +20 -12
- package/dist/qti-components/index.js +2 -2
- package/dist/qti-components-jsx.d.ts +35 -2
- package/dist/qti-response-declaration-5PnLgbOQ.d.ts +1143 -0
- package/dist/qti-response-declaration-PJkGU8F8.d.ts +1151 -0
- package/dist/qti-test/components/index.d.ts +2 -1
- package/dist/qti-test/components/index.js +13 -9
- package/dist/qti-test/components/test-navigation.d.ts +1 -1
- package/dist/qti-test/components/test-navigation.js +3 -3
- package/dist/qti-test/components/test-print-context.d.ts +20 -0
- package/dist/qti-test/components/test-print-context.js +9 -0
- package/dist/qti-test/components/test-print-context.js.map +1 -0
- package/dist/qti-test/components/test-print-item-variables copy.js +86 -0
- package/dist/qti-test/components/test-print-item-variables copy.js.map +1 -0
- package/dist/qti-test/components/test-print-item-variables.d.ts +2 -2
- package/dist/qti-test/components/test-print-item-variables.js +1 -1
- package/dist/qti-test/components/test-print-item-variables.stories copy.js +9731 -0
- package/dist/qti-test/components/test-print-item-variables.stories copy.js.map +1 -0
- package/dist/qti-test/components/test-print-test-context.js +86 -0
- package/dist/qti-test/components/test-print-test-context.js.map +1 -0
- package/dist/qti-test/components/test-view.js +2 -2
- package/dist/qti-test/core/index.d.ts +3 -3
- package/dist/qti-test/core/index.js +15 -3
- package/dist/qti-test-feedback-BuFBq7JH.d.ts +97 -0
- package/dist/qti-test-feedback-CZsPCqSt.d.ts +97 -0
- package/dist/qti-test-feedback-CaNdRC7L.d.ts +96 -0
- package/dist/qti-test-part-BIeEZIWw.d.ts +85 -0
- package/dist/qti-test-part-C_jSX7Zz.d.ts +85 -0
- package/dist/vscode.html-custom-data.json +17 -6
- package/package.json +1 -1
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INITIAL_SESSION_CONTEXT,
|
|
3
|
+
sessionContext
|
|
4
|
+
} from "./chunk-UZ4QB5IO.js";
|
|
5
|
+
import {
|
|
6
|
+
INITIAL_TEST_CONTEXT,
|
|
7
|
+
testContext
|
|
8
|
+
} from "./chunk-CJADUWEC.js";
|
|
9
|
+
import {
|
|
10
|
+
QtiModalFeedback
|
|
11
|
+
} from "./chunk-BLUHTHXX.js";
|
|
12
|
+
import {
|
|
13
|
+
qtiTransformItem
|
|
14
|
+
} from "./chunk-XDMSEAYC.js";
|
|
15
|
+
import {
|
|
16
|
+
__decorateClass
|
|
17
|
+
} from "./chunk-H2JE6IVU.js";
|
|
18
|
+
|
|
19
|
+
// src/lib/qti-test/core/qti-test.ts
|
|
20
|
+
import { html } from "lit";
|
|
21
|
+
import { customElement } from "lit/decorators.js";
|
|
22
|
+
|
|
23
|
+
// src/lib/qti-test/core/mixins/test-loader.mixin.ts
|
|
24
|
+
import { property } from "lit/decorators.js";
|
|
25
|
+
var setSessionData = (key, value) => sessionStorage.setItem(key, JSON.stringify(value));
|
|
26
|
+
var getSessionData = (key) => sessionStorage.getItem(key) ? JSON.parse(sessionStorage.getItem(key)) : null;
|
|
27
|
+
var TestLoaderMixin = (superClass) => {
|
|
28
|
+
class TestLoaderClass extends superClass {
|
|
29
|
+
constructor(...args) {
|
|
30
|
+
super(...args);
|
|
31
|
+
this.autoStoreRestoreContext = null;
|
|
32
|
+
this.navItemId = null;
|
|
33
|
+
this.addEventListener("qti-load-item-request", ({ detail }) => {
|
|
34
|
+
detail.promise = (async () => {
|
|
35
|
+
const api = await qtiTransformItem().load(`${detail.href}`, detail.cancelPreviousRequest);
|
|
36
|
+
return api.htmlDoc();
|
|
37
|
+
})();
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async connectedCallback() {
|
|
41
|
+
super.connectedCallback();
|
|
42
|
+
if (this.navItemId) {
|
|
43
|
+
this.sessionContext = { ...this.sessionContext, navItemId: this.navItemId };
|
|
44
|
+
}
|
|
45
|
+
if (this.autoStoreRestoreContext) {
|
|
46
|
+
const testContext2 = getSessionData(this.autoStoreRestoreContext);
|
|
47
|
+
if (testContext2) {
|
|
48
|
+
this.testContext = testContext2;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
willUpdate(changedProperties) {
|
|
53
|
+
if (changedProperties.has("navItemId")) {
|
|
54
|
+
this.sessionContext = { ...this.sessionContext, navItemId: this.navItemId };
|
|
55
|
+
}
|
|
56
|
+
if (changedProperties.has("testContext")) {
|
|
57
|
+
if (this.autoStoreRestoreContext) {
|
|
58
|
+
setSessionData(this.autoStoreRestoreContext, this.testContext);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
__decorateClass([
|
|
64
|
+
property({ type: String, attribute: "auto-store-restore" })
|
|
65
|
+
], TestLoaderClass.prototype, "autoStoreRestoreContext", 2);
|
|
66
|
+
__decorateClass([
|
|
67
|
+
property({ type: String, attribute: "nav-item-id" })
|
|
68
|
+
], TestLoaderClass.prototype, "navItemId", 2);
|
|
69
|
+
return TestLoaderClass;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/lib/qti-test/core/mixins/test-navigation.mixin.ts
|
|
73
|
+
import { property as property2 } from "lit/decorators.js";
|
|
74
|
+
var TestNavigationMixin = (superClass) => {
|
|
75
|
+
class TestNavigationClass extends superClass {
|
|
76
|
+
constructor(...args) {
|
|
77
|
+
super(...args);
|
|
78
|
+
this.navigate = "item";
|
|
79
|
+
this.addEventListener(
|
|
80
|
+
"qti-request-navigation",
|
|
81
|
+
async ({ detail }) => {
|
|
82
|
+
if (!detail?.id) return;
|
|
83
|
+
if (detail.type === "item") {
|
|
84
|
+
await this._loadItems([detail.id]);
|
|
85
|
+
const navItemId = detail.id;
|
|
86
|
+
const itemRefEl = this._testElement?.querySelector(
|
|
87
|
+
`qti-assessment-item-ref[identifier="${detail.id}"]`
|
|
88
|
+
);
|
|
89
|
+
const navPartId = itemRefEl.closest("qti-test-part")?.identifier;
|
|
90
|
+
const navSectionId = itemRefEl.closest("qti-assessment-section")?.identifier;
|
|
91
|
+
this.sessionContext = { ...this.sessionContext, navPartId, navSectionId, navItemId, navItemLoading: false };
|
|
92
|
+
} else if (detail.type === "section") {
|
|
93
|
+
const itemIds = this._getSectionItemIds(detail.id);
|
|
94
|
+
await this._loadItems(itemIds);
|
|
95
|
+
const navSectionId = detail.id;
|
|
96
|
+
const sectionRefEl = this._testElement?.querySelector(
|
|
97
|
+
`qti-assessment-section[identifier="${navSectionId}"]`
|
|
98
|
+
);
|
|
99
|
+
const navPartId = sectionRefEl.closest("qti-test-part")?.identifier;
|
|
100
|
+
this.sessionContext = {
|
|
101
|
+
...this.sessionContext,
|
|
102
|
+
navPartId,
|
|
103
|
+
navSectionId,
|
|
104
|
+
navItemId: null,
|
|
105
|
+
navItemLoading: false
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
this.addEventListener("qti-assessment-test-connected", (e) => {
|
|
111
|
+
this._testElement = e.detail;
|
|
112
|
+
let id;
|
|
113
|
+
if (this.navigate === "section") {
|
|
114
|
+
id = this._testElement.querySelector("qti-assessment-section")?.identifier;
|
|
115
|
+
} else {
|
|
116
|
+
id = this.sessionContext.navItemId ?? this._testElement.querySelector("qti-assessment-item-ref")?.identifier;
|
|
117
|
+
}
|
|
118
|
+
if (id) {
|
|
119
|
+
this.dispatchEvent(
|
|
120
|
+
new CustomEvent("qti-request-navigation", {
|
|
121
|
+
detail: { type: this.navigate === "section" ? "section" : "item", id },
|
|
122
|
+
bubbles: true,
|
|
123
|
+
composed: true
|
|
124
|
+
})
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
async _loadItems(itemIds) {
|
|
130
|
+
let results;
|
|
131
|
+
if (!this._testElement || itemIds.length === 0) return;
|
|
132
|
+
const itemRefEls = itemIds.map(
|
|
133
|
+
(id) => this._testElement.querySelector(`qti-assessment-item-ref[identifier="${id}"]`)
|
|
134
|
+
);
|
|
135
|
+
if (itemRefEls.includes(null)) {
|
|
136
|
+
console.warn(`One or more items not found: ${itemIds}`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this._clearLoadedItems();
|
|
140
|
+
this.sessionContext = { ...this.sessionContext, navItemLoading: true };
|
|
141
|
+
const itemLoadPromises = itemRefEls.map(async (itemRef) => {
|
|
142
|
+
if (!itemRef) return null;
|
|
143
|
+
return { itemRef, doc: await this._loadItemRequest(itemRef.href) };
|
|
144
|
+
});
|
|
145
|
+
try {
|
|
146
|
+
results = await Promise.all(itemLoadPromises);
|
|
147
|
+
results.forEach(({ itemRef, doc }) => {
|
|
148
|
+
if (itemRef && doc) itemRef.xmlDoc = doc;
|
|
149
|
+
});
|
|
150
|
+
requestAnimationFrame(() => {
|
|
151
|
+
this.dispatchEvent(
|
|
152
|
+
new CustomEvent("qti-test-connected", {
|
|
153
|
+
detail: results.map(({ itemRef }) => ({ identifier: itemRef?.identifier, element: itemRef })),
|
|
154
|
+
bubbles: true,
|
|
155
|
+
composed: true
|
|
156
|
+
})
|
|
157
|
+
);
|
|
158
|
+
});
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.error("Error loading items:", error);
|
|
161
|
+
}
|
|
162
|
+
return results;
|
|
163
|
+
}
|
|
164
|
+
_getSectionItemIds(navSectionId) {
|
|
165
|
+
const sectionRefEl = this._testElement?.querySelector(
|
|
166
|
+
`qti-assessment-section[identifier="${navSectionId}"]`
|
|
167
|
+
);
|
|
168
|
+
if (!sectionRefEl) {
|
|
169
|
+
console.warn(`Section with identifier "${navSectionId}" not found.`);
|
|
170
|
+
return [];
|
|
171
|
+
}
|
|
172
|
+
return Array.from(
|
|
173
|
+
this._testElement.querySelectorAll(
|
|
174
|
+
`qti-assessment-section[identifier="${navSectionId}"] > qti-assessment-item-ref`
|
|
175
|
+
)
|
|
176
|
+
).map((itemRef) => itemRef.identifier);
|
|
177
|
+
}
|
|
178
|
+
_clearLoadedItems() {
|
|
179
|
+
const itemRefEls = this._testElement?.querySelectorAll(
|
|
180
|
+
`qti-assessment-test qti-assessment-item-ref`
|
|
181
|
+
);
|
|
182
|
+
Array.from(itemRefEls || []).forEach((itemElement) => {
|
|
183
|
+
itemElement.xmlDoc = null;
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
_loadItemRequest(href) {
|
|
187
|
+
const event = new CustomEvent("qti-load-item-request", {
|
|
188
|
+
bubbles: true,
|
|
189
|
+
composed: true,
|
|
190
|
+
detail: { href, promise: null }
|
|
191
|
+
});
|
|
192
|
+
this.dispatchEvent(event);
|
|
193
|
+
return event.detail.promise;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
__decorateClass([
|
|
197
|
+
property2({ type: String })
|
|
198
|
+
], TestNavigationClass.prototype, "navigate", 2);
|
|
199
|
+
return TestNavigationClass;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// src/lib/qti-test/core/mixins/test-view.mixin.ts
|
|
203
|
+
var TestViewMixin = (superClass) => {
|
|
204
|
+
class TestViewClass extends superClass {
|
|
205
|
+
constructor(...args) {
|
|
206
|
+
super(...args);
|
|
207
|
+
this.sessionContext = { ...this.sessionContext, view: "candidate" };
|
|
208
|
+
this.addEventListener("on-test-switch-view", (e) => {
|
|
209
|
+
this.sessionContext = { ...this.sessionContext, view: e.detail };
|
|
210
|
+
this._updateElementView();
|
|
211
|
+
});
|
|
212
|
+
this.addEventListener("qti-assessment-test-connected", () => {
|
|
213
|
+
this._updateElementView();
|
|
214
|
+
});
|
|
215
|
+
this.addEventListener("qti-assessment-item-connected", (e) => {
|
|
216
|
+
this._updateElementView();
|
|
217
|
+
this._setCorrectResponseVisibility(e.detail);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
willUpdate(changedProperties) {
|
|
221
|
+
super.willUpdate(changedProperties);
|
|
222
|
+
if (changedProperties.has("sessionContext")) {
|
|
223
|
+
this._updateElementView();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// Method to handle view updates for elements based on the current context view
|
|
227
|
+
_updateElementView() {
|
|
228
|
+
if (this.testElement && this.testElement) {
|
|
229
|
+
const viewElements = Array.from(this.testElement.querySelectorAll("[view]"));
|
|
230
|
+
viewElements.forEach((element) => {
|
|
231
|
+
element.classList.toggle("show", element.getAttribute("view") === this.sessionContext.view);
|
|
232
|
+
});
|
|
233
|
+
const assessmentItem = this.testElement.querySelector(
|
|
234
|
+
`qti-assessment-item[identifier="${this.sessionContext.navItemId}"]`
|
|
235
|
+
);
|
|
236
|
+
if (assessmentItem) {
|
|
237
|
+
assessmentItem.showCorrectResponse(this.sessionContext.view === "scorer");
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// Event handler for connected QTI assessment items
|
|
242
|
+
_setCorrectResponseVisibility(assessmentItem) {
|
|
243
|
+
assessmentItem.showCorrectResponse(this.sessionContext.view === "scorer");
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return TestViewClass;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// src/lib/qti-test/core/test-base.ts
|
|
250
|
+
import { provide } from "@lit/context";
|
|
251
|
+
import { LitElement } from "lit";
|
|
252
|
+
import { state } from "lit/decorators.js";
|
|
253
|
+
var TestBase = class extends LitElement {
|
|
254
|
+
constructor() {
|
|
255
|
+
super();
|
|
256
|
+
this.testContext = INITIAL_TEST_CONTEXT;
|
|
257
|
+
this.sessionContext = INITIAL_SESSION_CONTEXT;
|
|
258
|
+
/**
|
|
259
|
+
* Updates the variables of an assessment item in the test context.
|
|
260
|
+
* - Matches the assessment item with the corresponding test context item.
|
|
261
|
+
* - If the item is not found, logs a warning.
|
|
262
|
+
* - Updates variables in the test context if exactly one variable exists.
|
|
263
|
+
* - Otherwise, syncs the assessment item's variables with the test context.
|
|
264
|
+
*
|
|
265
|
+
* @param assessmentItem - The assessment item to update.
|
|
266
|
+
*/
|
|
267
|
+
this._updateItemInTestContext = (assessmentItem) => {
|
|
268
|
+
const { identifier } = assessmentItem;
|
|
269
|
+
const fullVariables = assessmentItem._context.variables;
|
|
270
|
+
const itemContext = this.testContext.items.find((i) => i?.identifier === identifier);
|
|
271
|
+
if (!itemContext) {
|
|
272
|
+
console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
if (itemContext.variables?.length === 1) {
|
|
276
|
+
this._updateItemVariablesInTestContext(identifier, fullVariables);
|
|
277
|
+
} else {
|
|
278
|
+
assessmentItem.variables = [...itemContext.variables || []];
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
this.addEventListener("qti-assessment-test-connected", (e) => {
|
|
282
|
+
if (this.testContext && this.testContext.items.length > 0) return;
|
|
283
|
+
this.testElement = e.detail;
|
|
284
|
+
const items = Array.from(this.testElement.querySelectorAll("qti-assessment-item-ref")).map((itemRef) => {
|
|
285
|
+
return {
|
|
286
|
+
href: itemRef.href,
|
|
287
|
+
identifier: itemRef.identifier,
|
|
288
|
+
category: itemRef.category,
|
|
289
|
+
variables: [
|
|
290
|
+
{
|
|
291
|
+
identifier: "completionStatus",
|
|
292
|
+
value: "not_attempted",
|
|
293
|
+
type: "outcome"
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
this.testContext = { ...this.testContext, items };
|
|
299
|
+
});
|
|
300
|
+
this.addEventListener("qti-assessment-item-connected", (e) => {
|
|
301
|
+
this._updateItemInTestContext(e.detail);
|
|
302
|
+
});
|
|
303
|
+
this.addEventListener("qti-item-context-updated", (e) => {
|
|
304
|
+
this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail.itemContext.variables);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
// get testContext(): TestContext {
|
|
308
|
+
// return this._testContext;
|
|
309
|
+
// }
|
|
310
|
+
// // /* restores the context by updating existing items and adding new items from the "contextToRestore" parameter into the "this._context.items" array. */
|
|
311
|
+
// set testContext(testContext: TestContext) {
|
|
312
|
+
// if (this._testContext.items.length > 0) {
|
|
313
|
+
// console.warn(
|
|
314
|
+
// 'testContext already set and can not be overwritten. Set the testContext before loading the assessment test'
|
|
315
|
+
// );
|
|
316
|
+
// return;
|
|
317
|
+
// }
|
|
318
|
+
// if (testContext === null || testContext === undefined) return;
|
|
319
|
+
// this._testContext = { ...testContext }; // Clone the context to avoid modifying the original object
|
|
320
|
+
// // // append the items that are not yet in the context and replace the ones that are
|
|
321
|
+
// testContext.items?.forEach(itemContext => {
|
|
322
|
+
// const existingItemContext = this._testContext.items.find(i => i.identifier === itemContext.identifier);
|
|
323
|
+
// if (existingItemContext) {
|
|
324
|
+
// existingItemContext.variables = itemContext.variables;
|
|
325
|
+
// } else {
|
|
326
|
+
// this._testContext.items.push(itemContext);
|
|
327
|
+
// }
|
|
328
|
+
// });
|
|
329
|
+
// }
|
|
330
|
+
_updateItemVariablesInTestContext(identifier, variables) {
|
|
331
|
+
this.testContext = {
|
|
332
|
+
...this.testContext,
|
|
333
|
+
// Spread existing test context properties
|
|
334
|
+
items: this.testContext.items.map((itemContext) => {
|
|
335
|
+
if (itemContext.identifier !== identifier) {
|
|
336
|
+
return itemContext;
|
|
337
|
+
}
|
|
338
|
+
return {
|
|
339
|
+
...itemContext,
|
|
340
|
+
// Keep other properties of the item context
|
|
341
|
+
variables: variables.map((variable) => {
|
|
342
|
+
const matchingVariable = itemContext.variables.find((v) => v.identifier === variable.identifier);
|
|
343
|
+
return matchingVariable ? { ...matchingVariable, ...variable } : variable;
|
|
344
|
+
})
|
|
345
|
+
};
|
|
346
|
+
})
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
__decorateClass([
|
|
351
|
+
state(),
|
|
352
|
+
provide({ context: testContext })
|
|
353
|
+
], TestBase.prototype, "testContext", 2);
|
|
354
|
+
__decorateClass([
|
|
355
|
+
state(),
|
|
356
|
+
provide({ context: sessionContext })
|
|
357
|
+
], TestBase.prototype, "sessionContext", 2);
|
|
358
|
+
|
|
359
|
+
// src/lib/qti-test/core/mixins/test-processing.mixin.ts
|
|
360
|
+
var TestProcessingMixin = (superClass) => {
|
|
361
|
+
class TestProcessingElement extends superClass {
|
|
362
|
+
constructor(...args) {
|
|
363
|
+
super(...args);
|
|
364
|
+
this.addEventListener("qti-register-variable", (e) => {
|
|
365
|
+
this.testContext = {
|
|
366
|
+
...this.testContext,
|
|
367
|
+
testOutcomeVariables: [...this.testContext.testOutcomeVariables || [], e.detail.variable]
|
|
368
|
+
};
|
|
369
|
+
e.stopPropagation();
|
|
370
|
+
});
|
|
371
|
+
this.addEventListener(
|
|
372
|
+
"qti-set-outcome-value",
|
|
373
|
+
(e) => {
|
|
374
|
+
const { outcomeIdentifier, value } = e.detail;
|
|
375
|
+
this.updateOutcomeVariable(outcomeIdentifier, value);
|
|
376
|
+
e.stopPropagation();
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
outcomeProcessing() {
|
|
381
|
+
const outcomeProcessor = this.querySelector("qti-outcome-processing");
|
|
382
|
+
if (!outcomeProcessor) return false;
|
|
383
|
+
outcomeProcessor?.process();
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
/* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */
|
|
387
|
+
updateOutcomeVariable(identifier, value) {
|
|
388
|
+
const outcomeVariable = this.getOutcome(identifier);
|
|
389
|
+
if (!outcomeVariable) {
|
|
390
|
+
console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
this.testContext = {
|
|
394
|
+
...this.testContext,
|
|
395
|
+
testOutcomeVariables: this.testContext.testOutcomeVariables?.map((v) => {
|
|
396
|
+
if (v.identifier !== identifier) {
|
|
397
|
+
return v;
|
|
398
|
+
}
|
|
399
|
+
return {
|
|
400
|
+
...v,
|
|
401
|
+
value: outcomeVariable.cardinality === "single" ? value : [...v.value, value]
|
|
402
|
+
};
|
|
403
|
+
})
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
getOutcome(identifier) {
|
|
407
|
+
return this.getVariable(identifier);
|
|
408
|
+
}
|
|
409
|
+
getVariable(identifier) {
|
|
410
|
+
return this.testContext.testOutcomeVariables?.find((v) => v.identifier === identifier) || null;
|
|
411
|
+
}
|
|
412
|
+
/* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */
|
|
413
|
+
}
|
|
414
|
+
return TestProcessingElement;
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
// src/lib/qti-test/core/qti-test.ts
|
|
418
|
+
var QtiTest = class extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestProcessingMixin(TestBase)))) {
|
|
419
|
+
// export class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {
|
|
420
|
+
/**
|
|
421
|
+
* Renders the component's template.
|
|
422
|
+
* Provides a default `<slot>` for content projection.
|
|
423
|
+
*/
|
|
424
|
+
async connectedCallback() {
|
|
425
|
+
super.connectedCallback();
|
|
426
|
+
await this.updateComplete;
|
|
427
|
+
this.dispatchEvent(new CustomEvent("qti-test-connected", { detail: this }));
|
|
428
|
+
}
|
|
429
|
+
render() {
|
|
430
|
+
return html`<slot></slot>`;
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
QtiTest = __decorateClass([
|
|
434
|
+
customElement("qti-test")
|
|
435
|
+
], QtiTest);
|
|
436
|
+
|
|
437
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-assessment-item-ref.ts
|
|
438
|
+
import { consume } from "@lit/context";
|
|
439
|
+
import { html as html2, LitElement as LitElement2 } from "lit";
|
|
440
|
+
import { property as property3 } from "lit/decorators.js";
|
|
441
|
+
var stringToBooleanConverter = {
|
|
442
|
+
fromAttribute(value) {
|
|
443
|
+
return value === "true";
|
|
444
|
+
},
|
|
445
|
+
toAttribute(value) {
|
|
446
|
+
return value ? "true" : "false";
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
var QtiAssessmentItemRef = class extends LitElement2 {
|
|
450
|
+
constructor() {
|
|
451
|
+
super(...arguments);
|
|
452
|
+
this.weigths = /* @__PURE__ */ new Map();
|
|
453
|
+
}
|
|
454
|
+
// the XMLDocument
|
|
455
|
+
createRenderRoot() {
|
|
456
|
+
return this;
|
|
457
|
+
}
|
|
458
|
+
get assessmentItem() {
|
|
459
|
+
return this.renderRoot?.querySelector("qti-assessment-item");
|
|
460
|
+
}
|
|
461
|
+
async connectedCallback() {
|
|
462
|
+
super.connectedCallback();
|
|
463
|
+
await this.updateComplete;
|
|
464
|
+
this.dispatchEvent(
|
|
465
|
+
new CustomEvent("qti-assessment-item-ref-connected", {
|
|
466
|
+
bubbles: true,
|
|
467
|
+
composed: true,
|
|
468
|
+
detail: { identifier: this.identifier, href: this.href, category: this.category }
|
|
469
|
+
})
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
render() {
|
|
473
|
+
return html2`${this.xmlDoc}`;
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
__decorateClass([
|
|
477
|
+
property3({ type: String })
|
|
478
|
+
], QtiAssessmentItemRef.prototype, "category", 2);
|
|
479
|
+
__decorateClass([
|
|
480
|
+
property3({ type: String })
|
|
481
|
+
], QtiAssessmentItemRef.prototype, "identifier", 2);
|
|
482
|
+
__decorateClass([
|
|
483
|
+
property3({ type: Boolean, converter: stringToBooleanConverter })
|
|
484
|
+
], QtiAssessmentItemRef.prototype, "required", 2);
|
|
485
|
+
__decorateClass([
|
|
486
|
+
property3({ type: Boolean, converter: stringToBooleanConverter })
|
|
487
|
+
], QtiAssessmentItemRef.prototype, "fixed", 2);
|
|
488
|
+
__decorateClass([
|
|
489
|
+
property3({ type: String })
|
|
490
|
+
], QtiAssessmentItemRef.prototype, "href", 2);
|
|
491
|
+
__decorateClass([
|
|
492
|
+
consume({ context: testContext, subscribe: true })
|
|
493
|
+
], QtiAssessmentItemRef.prototype, "_testContext", 2);
|
|
494
|
+
__decorateClass([
|
|
495
|
+
property3({ type: Object, attribute: false })
|
|
496
|
+
], QtiAssessmentItemRef.prototype, "xmlDoc", 2);
|
|
497
|
+
if (!customElements.get("qti-assessment-item-ref")) {
|
|
498
|
+
customElements.define("qti-assessment-item-ref", QtiAssessmentItemRef);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-assessment-section.ts
|
|
502
|
+
import { consume as consume2 } from "@lit/context";
|
|
503
|
+
import { html as html3, LitElement as LitElement3 } from "lit";
|
|
504
|
+
import { property as property4 } from "lit/decorators.js";
|
|
505
|
+
var stringToBooleanConverter2 = {
|
|
506
|
+
fromAttribute(value) {
|
|
507
|
+
return value === "true";
|
|
508
|
+
},
|
|
509
|
+
toAttribute(value) {
|
|
510
|
+
return value ? "true" : "false";
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
var QtiAssessmentSection = class extends LitElement3 {
|
|
514
|
+
async connectedCallback() {
|
|
515
|
+
super.connectedCallback();
|
|
516
|
+
await this.updateComplete;
|
|
517
|
+
this.dispatchEvent(
|
|
518
|
+
new Event("qti-assessment-section-connected", {
|
|
519
|
+
bubbles: true,
|
|
520
|
+
composed: true
|
|
521
|
+
})
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
render() {
|
|
525
|
+
return html3`<slot name="qti-rubric-block"></slot><slot></slot>`;
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
__decorateClass([
|
|
529
|
+
property4({ type: String })
|
|
530
|
+
], QtiAssessmentSection.prototype, "identifier", 2);
|
|
531
|
+
__decorateClass([
|
|
532
|
+
property4({ type: String })
|
|
533
|
+
], QtiAssessmentSection.prototype, "required", 2);
|
|
534
|
+
__decorateClass([
|
|
535
|
+
property4({ type: Boolean, converter: stringToBooleanConverter2 })
|
|
536
|
+
], QtiAssessmentSection.prototype, "fixed", 2);
|
|
537
|
+
__decorateClass([
|
|
538
|
+
property4({ type: String })
|
|
539
|
+
], QtiAssessmentSection.prototype, "title", 2);
|
|
540
|
+
__decorateClass([
|
|
541
|
+
property4({ type: Boolean, converter: stringToBooleanConverter2 })
|
|
542
|
+
], QtiAssessmentSection.prototype, "visible", 2);
|
|
543
|
+
__decorateClass([
|
|
544
|
+
property4({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
|
|
545
|
+
], QtiAssessmentSection.prototype, "keepTogether", 2);
|
|
546
|
+
__decorateClass([
|
|
547
|
+
consume2({ context: testContext, subscribe: true })
|
|
548
|
+
], QtiAssessmentSection.prototype, "_testContext", 2);
|
|
549
|
+
if (!customElements.get("qti-assessment-section")) {
|
|
550
|
+
customElements.define("qti-assessment-section", QtiAssessmentSection);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-assessment-test.ts
|
|
554
|
+
import { consume as consume3 } from "@lit/context";
|
|
555
|
+
import { html as html4, LitElement as LitElement4 } from "lit";
|
|
556
|
+
import { customElement as customElement2, property as property5 } from "lit/decorators.js";
|
|
557
|
+
var QtiAssessmentTest = class extends LitElement4 {
|
|
558
|
+
async connectedCallback() {
|
|
559
|
+
super.connectedCallback();
|
|
560
|
+
await this.updateComplete;
|
|
561
|
+
this.dispatchEvent(
|
|
562
|
+
new CustomEvent("qti-assessment-test-connected", {
|
|
563
|
+
detail: this,
|
|
564
|
+
bubbles: true,
|
|
565
|
+
composed: true
|
|
566
|
+
})
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
render() {
|
|
570
|
+
return html4` <slot></slot>`;
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
__decorateClass([
|
|
574
|
+
property5({ type: String })
|
|
575
|
+
], QtiAssessmentTest.prototype, "identifier", 2);
|
|
576
|
+
__decorateClass([
|
|
577
|
+
property5({ type: String })
|
|
578
|
+
], QtiAssessmentTest.prototype, "title", 2);
|
|
579
|
+
__decorateClass([
|
|
580
|
+
consume3({ context: testContext, subscribe: true })
|
|
581
|
+
], QtiAssessmentTest.prototype, "_testContext", 2);
|
|
582
|
+
QtiAssessmentTest = __decorateClass([
|
|
583
|
+
customElement2("qti-assessment-test")
|
|
584
|
+
], QtiAssessmentTest);
|
|
585
|
+
|
|
586
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-test-part.ts
|
|
587
|
+
import { html as html5, LitElement as LitElement5 } from "lit";
|
|
588
|
+
import { customElement as customElement3, property as property6 } from "lit/decorators.js";
|
|
589
|
+
var QtiTestPart = class extends LitElement5 {
|
|
590
|
+
constructor() {
|
|
591
|
+
super(...arguments);
|
|
592
|
+
this.identifier = "";
|
|
593
|
+
this.title = "";
|
|
594
|
+
this.class = "";
|
|
595
|
+
this.NavigationMode = "nonlinear";
|
|
596
|
+
this.submissionMode = "individual";
|
|
597
|
+
}
|
|
598
|
+
async connectedCallback() {
|
|
599
|
+
super.connectedCallback();
|
|
600
|
+
await this.updateComplete;
|
|
601
|
+
this.dispatchEvent(
|
|
602
|
+
new Event("qti-test-part-connected", {
|
|
603
|
+
bubbles: true,
|
|
604
|
+
composed: true
|
|
605
|
+
})
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
render() {
|
|
609
|
+
return html5` <slot></slot>`;
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
__decorateClass([
|
|
613
|
+
property6({ type: String })
|
|
614
|
+
], QtiTestPart.prototype, "identifier", 2);
|
|
615
|
+
__decorateClass([
|
|
616
|
+
property6({ type: String })
|
|
617
|
+
], QtiTestPart.prototype, "title", 2);
|
|
618
|
+
__decorateClass([
|
|
619
|
+
property6({ type: String })
|
|
620
|
+
], QtiTestPart.prototype, "class", 2);
|
|
621
|
+
__decorateClass([
|
|
622
|
+
property6({ type: String, attribute: "navigation-mode" })
|
|
623
|
+
], QtiTestPart.prototype, "NavigationMode", 2);
|
|
624
|
+
__decorateClass([
|
|
625
|
+
property6({ type: String, attribute: "submission-mode" })
|
|
626
|
+
], QtiTestPart.prototype, "submissionMode", 2);
|
|
627
|
+
QtiTestPart = __decorateClass([
|
|
628
|
+
customElement3("qti-test-part")
|
|
629
|
+
], QtiTestPart);
|
|
630
|
+
if (!customElements.get("qti-test-part")) {
|
|
631
|
+
customElements.define("qti-test-part", QtiTestPart);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-test-feedback.ts
|
|
635
|
+
import { customElement as customElement4 } from "lit/decorators.js";
|
|
636
|
+
import { css, html as html6 } from "lit";
|
|
637
|
+
var QtiTestFeedback = class extends QtiModalFeedback {
|
|
638
|
+
render() {
|
|
639
|
+
return html6``;
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
QtiTestFeedback.styles = css`
|
|
643
|
+
:host {
|
|
644
|
+
color: gray;
|
|
645
|
+
}
|
|
646
|
+
`;
|
|
647
|
+
QtiTestFeedback = __decorateClass([
|
|
648
|
+
customElement4("qti-test-feedback")
|
|
649
|
+
], QtiTestFeedback);
|
|
650
|
+
|
|
651
|
+
export {
|
|
652
|
+
QtiTest,
|
|
653
|
+
QtiAssessmentItemRef,
|
|
654
|
+
QtiAssessmentSection,
|
|
655
|
+
QtiAssessmentTest,
|
|
656
|
+
QtiTestPart,
|
|
657
|
+
QtiTestFeedback
|
|
658
|
+
};
|
|
659
|
+
//# sourceMappingURL=chunk-RB227QQP.js.map
|