@citolab/qti-components 7.0.4 → 7.0.6-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/chunk-25BMUTLC.js +1 -0
- package/cdn/chunk-3DWLPGTE.js +1 -0
- package/cdn/chunk-7BKWTY4S.js +1 -0
- package/cdn/chunk-7CQ4ETXL.js +1 -0
- package/cdn/chunk-7ENNZNJ4.js +1 -0
- package/cdn/chunk-7LGM2TQA.js +1 -0
- package/cdn/chunk-CYJMNT76.js +0 -0
- package/cdn/chunk-DLMFCDQX.js +1 -0
- package/cdn/chunk-DPR6SGCZ.js +1 -0
- package/cdn/chunk-EQGXFSYL.js +8 -0
- package/cdn/chunk-F5VW77RE.js +1 -0
- package/cdn/chunk-FNVXN5CO.js +1 -0
- package/cdn/chunk-GB7DLBFM.js +0 -0
- package/cdn/chunk-GBB54IPA.js +8 -0
- package/cdn/chunk-GPDDPZFH.js +1 -0
- package/cdn/chunk-H4A34YRT.js +0 -0
- package/cdn/chunk-ITXNNGVQ.js +0 -0
- package/cdn/chunk-IV7UP34N.js +5 -0
- package/cdn/chunk-IZZ36JQV.js +0 -0
- package/cdn/chunk-JNT54FPI.js +1 -0
- package/cdn/chunk-JS4S7ZI7.js +1 -0
- package/cdn/chunk-L26FOTPN.js +17 -0
- package/cdn/chunk-LA7TBIPQ.js +0 -0
- package/cdn/chunk-LVW3MHTI.js +23 -0
- package/cdn/chunk-POT65ZY7.js +1 -0
- package/cdn/chunk-Q7PVZA43.js +5 -0
- package/cdn/chunk-QJPHXAUE.js +1 -0
- package/cdn/chunk-QP57JHGY.js +11 -0
- package/cdn/chunk-RB6CONZW.js +3 -0
- package/cdn/chunk-RSRX5JYB.js +1 -0
- package/cdn/chunk-TG6AE3DB.js +0 -0
- package/cdn/chunk-V6YPUNZC.js +0 -0
- package/cdn/chunk-VI2WKTN4.js +1 -0
- package/cdn/chunk-W7X6GNEX.js +902 -0
- package/cdn/chunk-Y63VPWCG.js +3523 -0
- package/cdn/chunk-ZEX7TYC7.js +8 -0
- package/cdn/index.global.js +45 -45
- package/cdn/index.js +1 -4783
- package/cdn/qti-components/index.global.js +226 -0
- package/cdn/qti-components/index.js +1 -0
- package/cdn/qti-item/components/index.global.js +149 -0
- package/cdn/qti-item/components/index.js +1 -0
- package/cdn/qti-item/components/item-container.global.js +149 -0
- package/cdn/qti-item/components/item-container.js +1 -0
- package/cdn/qti-item/index.global.js +149 -0
- package/cdn/qti-item/index.js +1 -0
- package/cdn/qti-item/qti-item.global.js +114 -0
- package/cdn/qti-item/qti-item.js +1 -0
- package/cdn/qti-loader/index.global.js +1 -0
- package/cdn/qti-loader/index.js +1 -0
- package/cdn/qti-test/components/index.global.js +242 -0
- package/cdn/qti-test/components/index.js +1 -0
- package/cdn/qti-test/components/styles.global.js +44 -0
- package/cdn/qti-test/components/styles.js +1 -0
- package/cdn/qti-test/components/test-component.abstract.global.js +170 -0
- package/cdn/qti-test/components/test-component.abstract.js +1 -0
- package/cdn/qti-test/components/test-container.global.js +149 -0
- package/cdn/qti-test/components/test-container.js +1 -0
- package/cdn/qti-test/components/test-item-link.global.js +170 -0
- package/cdn/qti-test/components/test-item-link.js +1 -0
- package/cdn/qti-test/components/test-next.global.js +170 -0
- package/cdn/qti-test/components/test-next.js +1 -0
- package/cdn/qti-test/components/test-next.spec.global.js +297 -0
- package/cdn/qti-test/components/test-next.spec.js +713 -0
- package/cdn/qti-test/components/test-paging-buttons-stamp.global.js +207 -0
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -0
- package/cdn/qti-test/components/test-prev.global.js +170 -0
- package/cdn/qti-test/components/test-prev.js +1 -0
- package/cdn/qti-test/components/test-view.global.js +170 -0
- package/cdn/qti-test/components/test-view.js +1 -0
- package/cdn/qti-test/context/index.global.js +58 -0
- package/cdn/qti-test/context/index.js +1 -0
- package/cdn/qti-test/context/test.context.global.js +58 -0
- package/cdn/qti-test/context/test.context.js +1 -0
- package/cdn/qti-test/index.global.js +242 -0
- package/cdn/qti-test/index.js +1 -0
- package/cdn/qti-test/mixins/index.global.js +1 -0
- package/cdn/qti-test/mixins/index.js +1 -0
- package/cdn/qti-test/mixins/test-loader.mixin.global.js +1 -0
- package/cdn/qti-test/mixins/test-loader.mixin.js +1 -0
- package/cdn/qti-test/mixins/test-navigation.mixin.global.js +1 -0
- package/cdn/qti-test/mixins/test-navigation.mixin.js +1 -0
- package/cdn/qti-test/mixins/test-view.mixin.global.js +1 -0
- package/cdn/qti-test/mixins/test-view.mixin.js +1 -0
- package/cdn/qti-test/qti-assessment-test/index.global.js +170 -0
- package/cdn/qti-test/qti-assessment-test/index.js +1 -0
- package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.global.js +170 -0
- package/cdn/qti-test/qti-assessment-test/qti-assessment-item-ref.js +1 -0
- package/cdn/qti-test/qti-assessment-test/qti-assessment-section.global.js +170 -0
- package/cdn/qti-test/qti-assessment-test/qti-assessment-section.js +1 -0
- package/cdn/qti-test/qti-assessment-test/qti-assessment-test.global.js +170 -0
- package/cdn/qti-test/qti-assessment-test/qti-assessment-test.js +1 -0
- package/cdn/qti-test/qti-assessment-test/qti-test-part.global.js +114 -0
- package/cdn/qti-test/qti-assessment-test/qti-test-part.js +1 -0
- package/cdn/qti-test/qti-test.global.js +170 -0
- package/cdn/qti-test/qti-test.js +1 -0
- package/cdn/qti-test/test-base.global.js +170 -0
- package/cdn/qti-test/test-base.js +1 -0
- package/cdn/qti-transformers/index.global.js +1 -0
- package/cdn/qti-transformers/index.js +1 -0
- package/dist/{transformers/index.js → chunk-2OA7E3E7.js} +2 -1
- package/dist/chunk-2OA7E3E7.js.map +1 -0
- package/dist/chunk-37X6KZO3.js +1 -0
- package/dist/chunk-37X6KZO3.js.map +1 -0
- package/dist/chunk-3WLCQQN7.js +3529 -0
- package/dist/chunk-3WLCQQN7.js.map +1 -0
- package/dist/chunk-3YVIK6LO.js +1 -0
- package/dist/chunk-3YVIK6LO.js.map +1 -0
- package/dist/chunk-44VE5POH.js +55 -0
- package/dist/chunk-44VE5POH.js.map +1 -0
- package/dist/chunk-4CSM2PCC.js +37 -0
- package/dist/chunk-4CSM2PCC.js.map +1 -0
- package/dist/chunk-4YG2FPKK.js +31 -0
- package/dist/chunk-4YG2FPKK.js.map +1 -0
- package/dist/chunk-7A6KCSAU.js +44 -0
- package/dist/chunk-7A6KCSAU.js.map +1 -0
- package/dist/chunk-ENVUIH2A.js +118 -0
- package/dist/chunk-ENVUIH2A.js.map +1 -0
- package/dist/chunk-ENZVY5X6.js +20 -0
- package/dist/chunk-ENZVY5X6.js.map +1 -0
- package/dist/chunk-EUCEENQQ.js +6253 -0
- package/dist/chunk-EUCEENQQ.js.map +1 -0
- package/dist/chunk-FNFNAV3G.js +56 -0
- package/dist/chunk-FNFNAV3G.js.map +1 -0
- package/dist/chunk-GSFDTSLL.js +1 -0
- package/dist/chunk-GSFDTSLL.js.map +1 -0
- package/dist/chunk-GTYLWGDG.js +43 -0
- package/dist/chunk-GTYLWGDG.js.map +1 -0
- package/dist/chunk-IAFQ5ZPI.js +29 -0
- package/dist/chunk-IAFQ5ZPI.js.map +1 -0
- package/dist/chunk-JDHBXMKF.js +78 -0
- package/dist/chunk-JDHBXMKF.js.map +1 -0
- package/dist/chunk-L7MBIXEX.js +50 -0
- package/dist/chunk-L7MBIXEX.js.map +1 -0
- package/dist/chunk-LYFMLDNV.js +1 -0
- package/dist/chunk-LYFMLDNV.js.map +1 -0
- package/dist/chunk-NNPTSZGC.js +1 -0
- package/dist/chunk-NNPTSZGC.js.map +1 -0
- package/dist/chunk-NQM35JUI.js +1 -0
- package/dist/chunk-NQM35JUI.js.map +1 -0
- package/dist/chunk-ODUHPWTX.js +65 -0
- package/dist/chunk-ODUHPWTX.js.map +1 -0
- package/dist/chunk-OGHHCP23.js +36 -0
- package/dist/chunk-OGHHCP23.js.map +1 -0
- package/dist/chunk-OQZW2B47.js +75 -0
- package/dist/chunk-OQZW2B47.js.map +1 -0
- package/dist/chunk-OXDOQVRL.js +63 -0
- package/dist/chunk-OXDOQVRL.js.map +1 -0
- package/dist/chunk-PBSMP6VF.js +128 -0
- package/dist/chunk-PBSMP6VF.js.map +1 -0
- package/dist/chunk-Q7OPFS4A.js +1 -0
- package/dist/chunk-Q7OPFS4A.js.map +1 -0
- package/dist/chunk-R4HSV7U7.js +10 -0
- package/dist/chunk-R4HSV7U7.js.map +1 -0
- package/dist/chunk-TXRSYXG3.js +50 -0
- package/dist/chunk-TXRSYXG3.js.map +1 -0
- package/dist/chunk-U3RLYKL5.js +51 -0
- package/dist/chunk-U3RLYKL5.js.map +1 -0
- package/dist/chunk-UB5K44DB.js +30 -0
- package/dist/chunk-UB5K44DB.js.map +1 -0
- package/dist/chunk-VODOQFTJ.js +72 -0
- package/dist/chunk-VODOQFTJ.js.map +1 -0
- package/dist/chunk-VW7VIQBE.js +34 -0
- package/dist/chunk-VW7VIQBE.js.map +1 -0
- package/dist/chunk-X4ZBUCOD.js +94 -0
- package/dist/chunk-X4ZBUCOD.js.map +1 -0
- package/dist/chunk-XFHB6KQW.js +1 -0
- package/dist/chunk-XFHB6KQW.js.map +1 -0
- package/dist/chunk-XNBWN7N2.js +94 -0
- package/dist/chunk-XNBWN7N2.js.map +1 -0
- package/dist/index.d.ts +18 -503
- package/dist/index.js +169 -13584
- package/dist/index.js.map +1 -1
- package/dist/item.css +10 -10
- package/dist/qti-components/index.d.ts +150 -0
- package/dist/qti-components/index.js +189 -0
- package/dist/qti-components/index.js.map +1 -0
- package/dist/qti-components-jsx.d.ts +93 -147
- package/dist/qti-item/components/index.d.ts +3 -0
- package/dist/qti-item/components/index.js +12 -0
- package/dist/qti-item/components/index.js.map +1 -0
- package/dist/qti-item/components/item-container.d.ts +40 -0
- package/dist/qti-item/components/item-container.js +11 -0
- package/dist/qti-item/components/item-container.js.map +1 -0
- package/dist/qti-item/index.d.ts +4 -0
- package/dist/qti-item/index.js +17 -0
- package/dist/qti-item/index.js.map +1 -0
- package/dist/qti-item/qti-item.d.ts +25 -0
- package/dist/qti-item/qti-item.js +8 -0
- package/dist/qti-item/qti-item.js.map +1 -0
- package/dist/{loader → qti-loader}/index.d.ts +1 -1
- package/dist/qti-loader/index.js +11 -0
- package/dist/qti-loader/index.js.map +1 -0
- package/dist/{qti-simple-choice-D0GiMrqD.d.ts → qti-simple-choice-DxWcdKHi.d.ts} +30 -40
- package/dist/qti-test/components/index.d.ts +13 -0
- package/dist/qti-test/components/index.js +40 -0
- package/dist/qti-test/components/index.js.map +1 -0
- package/dist/qti-test/components/styles.d.ts +8 -0
- package/dist/qti-test/components/styles.js +14 -0
- package/dist/qti-test/components/styles.js.map +1 -0
- package/dist/qti-test/components/test-component.abstract.d.ts +23 -0
- package/dist/qti-test/components/test-component.abstract.js +12 -0
- package/dist/qti-test/components/test-component.abstract.js.map +1 -0
- package/dist/qti-test/components/test-container.d.ts +37 -0
- package/dist/qti-test/components/test-container.js +11 -0
- package/dist/qti-test/components/test-container.js.map +1 -0
- package/dist/qti-test/components/test-item-link.d.ts +21 -0
- package/dist/qti-test/components/test-item-link.js +14 -0
- package/dist/qti-test/components/test-item-link.js.map +1 -0
- package/dist/qti-test/components/test-next.d.ts +32 -0
- package/dist/qti-test/components/test-next.js +14 -0
- package/dist/qti-test/components/test-next.js.map +1 -0
- package/dist/qti-test/components/test-next.spec.d.ts +16 -0
- package/dist/qti-test/components/test-next.spec.js +45923 -0
- package/dist/qti-test/components/test-next.spec.js.map +1 -0
- package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +22 -0
- package/dist/qti-test/components/test-paging-buttons-stamp.js +13 -0
- package/dist/qti-test/components/test-paging-buttons-stamp.js.map +1 -0
- package/dist/qti-test/components/test-prev.d.ts +32 -0
- package/dist/qti-test/components/test-prev.js +14 -0
- package/dist/qti-test/components/test-prev.js.map +1 -0
- package/dist/qti-test/components/test-view.d.ts +27 -0
- package/dist/qti-test/components/test-view.js +13 -0
- package/dist/qti-test/components/test-view.js.map +1 -0
- package/dist/qti-test/context/index.d.ts +6 -0
- package/dist/qti-test/context/index.js +11 -0
- package/dist/qti-test/context/index.js.map +1 -0
- package/dist/qti-test/context/test.context.d.ts +6 -0
- package/dist/qti-test/context/test.context.js +10 -0
- package/dist/qti-test/context/test.context.js.map +1 -0
- package/dist/qti-test/index.d.ts +14 -0
- package/dist/qti-test/index.js +72 -0
- package/dist/qti-test/index.js.map +1 -0
- package/dist/qti-test/mixins/index.d.ts +8 -0
- package/dist/qti-test/mixins/index.js +18 -0
- package/dist/qti-test/mixins/index.js.map +1 -0
- package/dist/qti-test/mixins/test-loader.mixin.d.ts +8 -0
- package/dist/qti-test/mixins/test-loader.mixin.js +9 -0
- package/dist/qti-test/mixins/test-loader.mixin.js.map +1 -0
- package/dist/qti-test/mixins/test-navigation.mixin.d.ts +22 -0
- package/dist/qti-test/mixins/test-navigation.mixin.js +8 -0
- package/dist/qti-test/mixins/test-navigation.mixin.js.map +1 -0
- package/dist/qti-test/mixins/test-view.mixin.d.ts +6 -0
- package/dist/qti-test/mixins/test-view.mixin.js +8 -0
- package/dist/qti-test/mixins/test-view.mixin.js.map +1 -0
- package/dist/qti-test/qti-assessment-test/index.d.ts +6 -0
- package/dist/qti-test/qti-assessment-test/index.js +23 -0
- package/dist/qti-test/qti-assessment-test/index.js.map +1 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.d.ts +6 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js +10 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-item-ref.js.map +1 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.d.ts +6 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.js +10 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-section.js.map +1 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.d.ts +6 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.js +10 -0
- package/dist/qti-test/qti-assessment-test/qti-assessment-test.js.map +1 -0
- package/dist/qti-test/qti-assessment-test/qti-test-part.d.ts +19 -0
- package/dist/qti-test/qti-assessment-test/qti-test-part.js +8 -0
- package/dist/qti-test/qti-assessment-test/qti-test-part.js.map +1 -0
- package/dist/qti-test/qti-test.d.ts +68 -0
- package/dist/qti-test/qti-test.js +16 -0
- package/dist/qti-test/qti-test.js.map +1 -0
- package/dist/qti-test/test-base.d.ts +6 -0
- package/dist/qti-test/test-base.js +10 -0
- package/dist/qti-test/test-base.js.map +1 -0
- package/dist/qti-transformers/index.js +12 -0
- package/dist/qti-transformers/index.js.map +1 -0
- package/dist/test-base-BJwG9Ie8.d.ts +109 -0
- package/dist/vscode.html-custom-data.json +49 -38
- package/package.json +28 -52
- package/dist/custom-element-eslint-rules.js +0 -329
- package/dist/custom-elements.json +0 -27271
- package/dist/loader/index.js +0 -310
- package/dist/loader/index.js.map +0 -1
- package/dist/qti-simple-choice-CfgBEvdI.d.ts +0 -1143
- package/dist/qti-simple-choice-UTrFa_RQ.d.ts +0 -1177
- package/dist/qti-simple-choice-zEsDq3c0.d.ts +0 -1147
- package/dist/transformers/index.js.map +0 -1
- /package/dist/{transformers → qti-transformers}/index.d.ts +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__decorateClass
|
|
3
|
+
} from "./chunk-44VE5POH.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/qti-test/qti-assessment-test/qti-test-part.ts
|
|
6
|
+
import { html, LitElement } from "lit";
|
|
7
|
+
import { customElement, property } from "lit/decorators.js";
|
|
8
|
+
var QtiTestPart = class extends LitElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.identifier = "";
|
|
12
|
+
this.title = "";
|
|
13
|
+
this.class = "";
|
|
14
|
+
this.NavigationMode = "nonlinear";
|
|
15
|
+
this.submissionMode = "individual";
|
|
16
|
+
}
|
|
17
|
+
async connectedCallback() {
|
|
18
|
+
super.connectedCallback();
|
|
19
|
+
await this.updateComplete;
|
|
20
|
+
this.dispatchEvent(
|
|
21
|
+
new Event("qti-test-part-connected", {
|
|
22
|
+
bubbles: true,
|
|
23
|
+
composed: true
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html` <slot></slot>`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
__decorateClass([
|
|
32
|
+
property({ type: String })
|
|
33
|
+
], QtiTestPart.prototype, "identifier", 2);
|
|
34
|
+
__decorateClass([
|
|
35
|
+
property({ type: String })
|
|
36
|
+
], QtiTestPart.prototype, "title", 2);
|
|
37
|
+
__decorateClass([
|
|
38
|
+
property({ type: String })
|
|
39
|
+
], QtiTestPart.prototype, "class", 2);
|
|
40
|
+
__decorateClass([
|
|
41
|
+
property({ type: String, attribute: "navigation-mode" })
|
|
42
|
+
], QtiTestPart.prototype, "NavigationMode", 2);
|
|
43
|
+
__decorateClass([
|
|
44
|
+
property({ type: String, attribute: "submission-mode" })
|
|
45
|
+
], QtiTestPart.prototype, "submissionMode", 2);
|
|
46
|
+
QtiTestPart = __decorateClass([
|
|
47
|
+
customElement("qti-test-part")
|
|
48
|
+
], QtiTestPart);
|
|
49
|
+
if (!customElements.get("qti-test-part")) {
|
|
50
|
+
customElements.define("qti-test-part", QtiTestPart);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
QtiTestPart
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=chunk-FNFNAV3G.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/qti-assessment-test/qti-test-part.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n@customElement('qti-test-part')\nexport class QtiTestPart extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) title: string = '';\n @property({ type: String }) class: string = '';\n\n @property({ type: String, attribute: 'navigation-mode' })\n NavigationMode: 'linear' | 'nonlinear' = 'nonlinear';\n\n @property({ type: String, attribute: 'submission-mode' })\n submissionMode: 'individual' | 'simultaneous' = 'individual';\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-test-part-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-test-part')) {\n customElements.define('qti-test-part', QtiTestPart);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test-part': QtiTestPart;\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,eAAe,gBAAgB;AAEjC,IAAM,cAAN,cAA0B,WAAW;AAAA,EAArC;AAAA;AACuB,sBAAqB;AACrB,iBAAgB;AAChB,iBAAgB;AAG5C,0BAAyC;AAGzC,0BAAgD;AAAA;AAAA,EAEhD,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,MAAM,2BAA2B;AAAA,QACnC,SAAS;AAAA,QACT,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAxB8B;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,YACiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,YAEiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAHf,YAGiB;AAG5B;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAL7C,YAMX;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAR7C,YASX;AATW,cAAN;AAAA,EADN,cAAc,eAAe;AAAA,GACjB;AA2Bb,IAAI,CAAC,eAAe,IAAI,eAAe,GAAG;AACxC,iBAAe,OAAO,iBAAiB,WAAW;AACpD;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-GSFDTSLL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-UB5K44DB.js";
|
|
5
|
+
import {
|
|
6
|
+
TestComponent
|
|
7
|
+
} from "./chunk-ENVUIH2A.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-44VE5POH.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-item-link.ts
|
|
13
|
+
import { css, html } from "lit";
|
|
14
|
+
import { customElement, property } from "lit/decorators.js";
|
|
15
|
+
var TestItemLink = class extends TestComponent {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.itemId = null;
|
|
19
|
+
this.addEventListener("click", () => this._requestItem(this.itemId));
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return html` <slot></slot> `;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
TestItemLink.styles = css`
|
|
26
|
+
:host {
|
|
27
|
+
${btn};
|
|
28
|
+
}
|
|
29
|
+
:host([disabled]) {
|
|
30
|
+
${dis};
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
__decorateClass([
|
|
34
|
+
property({ type: String, attribute: "item-id" })
|
|
35
|
+
], TestItemLink.prototype, "itemId", 2);
|
|
36
|
+
TestItemLink = __decorateClass([
|
|
37
|
+
customElement("test-item-link")
|
|
38
|
+
], TestItemLink);
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
TestItemLink
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=chunk-GTYLWGDG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-item-link.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n@customElement('test-item-link')\nexport class TestItemLink extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: String, attribute: 'item-id' })\n private itemId: string = null;\n\n constructor() {\n super();\n this.addEventListener('click', () => this._requestItem(this.itemId));\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-item-link': TestItemLink;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,eAAe,gBAAgB;AAKjC,IAAM,eAAN,cAA2B,cAAc;AAAA,EAa9C,cAAc;AACZ,UAAM;AAHR,SAAQ,SAAiB;AAIvB,SAAK,iBAAiB,SAAS,MAAM,KAAK,aAAa,KAAK,MAAM,CAAC;AAAA,EACrE;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AArBa,aACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AAKR;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,UAAU,CAAC;AAAA,GAVrC,aAWH;AAXG,eAAN;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
qtiTransformItem,
|
|
3
|
+
qtiTransformManifest,
|
|
4
|
+
qtiTransformTest
|
|
5
|
+
} from "./chunk-2OA7E3E7.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) => qtiTransformItem().load(itemUri).then((api) => api.htmlDoc().firstElementChild);
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
getManifestInfo,
|
|
27
|
+
getItemByUri
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-IAFQ5ZPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { QtiAssessmentItem } from '../qti-components';\nimport { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\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 qtiTransformItem()\n .load(itemUri)\n .then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n"],"mappings":";;;;;;;AAoBO,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,YACjC,iBAAiB,EACd,KAAK,OAAO,EACZ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;","names":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TestComponent
|
|
3
|
+
} from "./chunk-ENVUIH2A.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-44VE5POH.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-paging-buttons-stamp.ts
|
|
9
|
+
import { html } from "lit";
|
|
10
|
+
import { customElement, property } from "lit/decorators.js";
|
|
11
|
+
import { prepareTemplate } from "stampino";
|
|
12
|
+
var TestPagingButtonsStamp = class extends TestComponent {
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.maxDisplayedItems = 2;
|
|
16
|
+
this.skipOnCategory = "dep-informational";
|
|
17
|
+
this._internals.ariaLabel = "pagination";
|
|
18
|
+
}
|
|
19
|
+
createRenderRoot() {
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const items = this._testContext.items.reduce(
|
|
24
|
+
(acc, item) => {
|
|
25
|
+
const isDepInfoItem = item.category?.split(" ").includes(this.skipOnCategory);
|
|
26
|
+
const newIndex = isDepInfoItem ? "i" : acc.counter++;
|
|
27
|
+
acc.result.push({
|
|
28
|
+
...item,
|
|
29
|
+
newIndex
|
|
30
|
+
// Assign the new index, which only increments for non-info items
|
|
31
|
+
});
|
|
32
|
+
return acc;
|
|
33
|
+
},
|
|
34
|
+
{ counter: 0, result: [] }
|
|
35
|
+
).result;
|
|
36
|
+
const itemIndex = items.findIndex((item) => item.identifier === this._testContext.navItemId);
|
|
37
|
+
const start = Math.max(0, itemIndex - this.maxDisplayedItems);
|
|
38
|
+
const end = Math.min(items.length, itemIndex + this.maxDisplayedItems + 1);
|
|
39
|
+
const clampedItems = items.slice(start, end);
|
|
40
|
+
return html`
|
|
41
|
+
${clampedItems.map((item) => {
|
|
42
|
+
const rawscore = item.variables.find((vr) => vr.identifier == "SCORE");
|
|
43
|
+
const score = parseInt(rawscore?.value?.toString());
|
|
44
|
+
const completionStatus = item.variables.find((v) => v.identifier === "completionStatus")?.value;
|
|
45
|
+
const type = item.category !== this.skipOnCategory ? "regular" : "info";
|
|
46
|
+
const active = this._testContext.navItemId === item.identifier;
|
|
47
|
+
const correct = this._testContext.view === "scorer" && type == "regular" && score !== void 0 && !isNaN(score) && score > 0;
|
|
48
|
+
const incorrect = this._testContext.view === "scorer" && type == "regular" && score !== void 0 && !isNaN(score) && score <= 0;
|
|
49
|
+
const answered = this._testContext.view === "candidate" && completionStatus === "completed" && item.category !== this.skipOnCategory;
|
|
50
|
+
const computedItem = {
|
|
51
|
+
...item,
|
|
52
|
+
type,
|
|
53
|
+
active,
|
|
54
|
+
correct,
|
|
55
|
+
incorrect,
|
|
56
|
+
answered
|
|
57
|
+
};
|
|
58
|
+
const templateElement = this.firstElementChild;
|
|
59
|
+
const myTemplate = prepareTemplate(templateElement);
|
|
60
|
+
return myTemplate({ item: computedItem });
|
|
61
|
+
})}
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
__decorateClass([
|
|
66
|
+
property({ type: Number, attribute: "max-displayed-items" })
|
|
67
|
+
], TestPagingButtonsStamp.prototype, "maxDisplayedItems", 2);
|
|
68
|
+
__decorateClass([
|
|
69
|
+
property({ type: String, attribute: "skip-on-category" })
|
|
70
|
+
], TestPagingButtonsStamp.prototype, "skipOnCategory", 2);
|
|
71
|
+
TestPagingButtonsStamp = __decorateClass([
|
|
72
|
+
customElement("test-paging-buttons-stamp")
|
|
73
|
+
], TestPagingButtonsStamp);
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
TestPagingButtonsStamp
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=chunk-JDHBXMKF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-paging-buttons-stamp.ts"],"sourcesContent":["import { html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { TestComponent } from './test-component.abstract';\nimport { prepareTemplate } from 'stampino';\n\n@customElement('test-paging-buttons-stamp')\nexport class TestPagingButtonsStamp extends TestComponent {\n @property({ type: Number, attribute: 'max-displayed-items' })\n private maxDisplayedItems = 2;\n\n @property({ type: String, attribute: 'skip-on-category' })\n private skipOnCategory = 'dep-informational';\n\n protected createRenderRoot() {\n return this;\n }\n\n constructor() {\n super();\n this._internals.ariaLabel = 'pagination';\n }\n\n render() {\n const items = this._testContext.items.reduce(\n (acc, item) => {\n const isDepInfoItem = item.category?.split(' ').includes(this.skipOnCategory);\n const newIndex = isDepInfoItem ? 'i' : acc.counter++;\n acc.result.push({\n ...item,\n newIndex // Assign the new index, which only increments for non-info items\n });\n return acc;\n },\n { counter: 0, result: [] }\n ).result;\n\n // Get the index of the current item\n const itemIndex = items.findIndex(item => item.identifier === this._testContext.navItemId);\n\n // Calculate the start and end range based on maxDisplayedItems\n const start = Math.max(0, itemIndex - this.maxDisplayedItems);\n const end = Math.min(items.length, itemIndex + this.maxDisplayedItems + 1);\n\n // console.log('start', start, 'end', end);\n // Adjust the items array to only include the clamped range\n const clampedItems = items.slice(start, end);\n\n return html`\n ${clampedItems.map(item => {\n const rawscore = item.variables.find(vr => vr.identifier == 'SCORE');\n const score = parseInt(rawscore?.value?.toString());\n const completionStatus = item.variables.find(v => v.identifier === 'completionStatus')?.value;\n const type = item.category !== this.skipOnCategory ? 'regular' : 'info'; // rounded-full\n const active = this._testContext.navItemId === item.identifier; // !border-sky-600\n const correct =\n this._testContext.view === 'scorer' && type == 'regular' && score !== undefined && !isNaN(score) && score > 0; // bg-green-100 border-green-400\n const incorrect =\n this._testContext.view === 'scorer' &&\n type == 'regular' &&\n score !== undefined &&\n !isNaN(score) &&\n score <= 0; // bg-red-100 border-red-400\n const answered =\n this._testContext.view === 'candidate' &&\n completionStatus === 'completed' &&\n item.category !== this.skipOnCategory; // bg-slate-300 shadow-sm\n\n const computedItem = {\n ...item,\n type,\n active,\n correct,\n incorrect,\n answered\n };\n\n const templateElement = this.firstElementChild as HTMLTemplateElement;\n const myTemplate = prepareTemplate(templateElement);\n return myTemplate({ item: computedItem });\n })}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-paging-buttons-stamp': TestPagingButtonsStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,eAAe,gBAAgB;AAGxC,SAAS,uBAAuB;AAGzB,IAAM,yBAAN,cAAqC,cAAc;AAAA,EAWxD,cAAc;AACZ,UAAM;AAVR,SAAQ,oBAAoB;AAG5B,SAAQ,iBAAiB;AAQvB,SAAK,WAAW,YAAY;AAAA,EAC9B;AAAA,EAPU,mBAAmB;AAC3B,WAAO;AAAA,EACT;AAAA,EAOA,SAAS;AACP,UAAM,QAAQ,KAAK,aAAa,MAAM;AAAA,MACpC,CAAC,KAAK,SAAS;AACb,cAAM,gBAAgB,KAAK,UAAU,MAAM,GAAG,EAAE,SAAS,KAAK,cAAc;AAC5E,cAAM,WAAW,gBAAgB,MAAM,IAAI;AAC3C,YAAI,OAAO,KAAK;AAAA,UACd,GAAG;AAAA,UACH;AAAA;AAAA,QACF,CAAC;AACD,eAAO;AAAA,MACT;AAAA,MACA,EAAE,SAAS,GAAG,QAAQ,CAAC,EAAE;AAAA,IAC3B,EAAE;AAGF,UAAM,YAAY,MAAM,UAAU,UAAQ,KAAK,eAAe,KAAK,aAAa,SAAS;AAGzF,UAAM,QAAQ,KAAK,IAAI,GAAG,YAAY,KAAK,iBAAiB;AAC5D,UAAM,MAAM,KAAK,IAAI,MAAM,QAAQ,YAAY,KAAK,oBAAoB,CAAC;AAIzE,UAAM,eAAe,MAAM,MAAM,OAAO,GAAG;AAE3C,WAAO;AAAA,QACH,aAAa,IAAI,UAAQ;AACzB,YAAM,WAAW,KAAK,UAAU,KAAK,QAAM,GAAG,cAAc,OAAO;AACnE,YAAM,QAAQ,SAAS,UAAU,OAAO,SAAS,CAAC;AAClD,YAAM,mBAAmB,KAAK,UAAU,KAAK,OAAK,EAAE,eAAe,kBAAkB,GAAG;AACxF,YAAM,OAAO,KAAK,aAAa,KAAK,iBAAiB,YAAY;AACjE,YAAM,SAAS,KAAK,aAAa,cAAc,KAAK;AACpD,YAAM,UACJ,KAAK,aAAa,SAAS,YAAY,QAAQ,aAAa,UAAU,UAAa,CAAC,MAAM,KAAK,KAAK,QAAQ;AAC9G,YAAM,YACJ,KAAK,aAAa,SAAS,YAC3B,QAAQ,aACR,UAAU,UACV,CAAC,MAAM,KAAK,KACZ,SAAS;AACX,YAAM,WACJ,KAAK,aAAa,SAAS,eAC3B,qBAAqB,eACrB,KAAK,aAAa,KAAK;AAEzB,YAAM,eAAe;AAAA,QACnB,GAAG;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,YAAM,kBAAkB,KAAK;AAC7B,YAAM,aAAa,gBAAgB,eAAe;AAClD,aAAO,WAAW,EAAE,MAAM,aAAa,CAAC;AAAA,IAC1C,CAAC,CAAC;AAAA;AAAA,EAEN;AACF;AA1EU;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,sBAAsB,CAAC;AAAA,GADjD,uBAEH;AAGA;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,mBAAmB,CAAC;AAAA,GAJ9C,uBAKH;AALG,yBAAN;AAAA,EADN,cAAc,2BAA2B;AAAA,GAC7B;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-UB5K44DB.js";
|
|
5
|
+
import {
|
|
6
|
+
TestComponent
|
|
7
|
+
} from "./chunk-ENVUIH2A.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-44VE5POH.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-next.ts
|
|
13
|
+
import { css, html } from "lit";
|
|
14
|
+
import { customElement } from "lit/decorators.js";
|
|
15
|
+
var TestNext = class extends TestComponent {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this._internals.role = "button";
|
|
19
|
+
this._internals.ariaLabel = "Next item";
|
|
20
|
+
this.addEventListener("click", (e) => {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
willUpdate(changedProperties) {
|
|
26
|
+
super.willUpdate(changedProperties);
|
|
27
|
+
if (changedProperties.has("_testContext")) {
|
|
28
|
+
this.disabled = !this._testElement?.el || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return html`<slot></slot>`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
TestNext.styles = css`
|
|
36
|
+
:host {
|
|
37
|
+
${btn};
|
|
38
|
+
}
|
|
39
|
+
:host([disabled]) {
|
|
40
|
+
${dis};
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
TestNext = __decorateClass([
|
|
44
|
+
customElement("test-next")
|
|
45
|
+
], TestNext);
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
TestNext
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-L7MBIXEX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement?.el || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,cAAc,MAAM,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,MAAM,SAAS;AAAA,IACxG;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA/Ba,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-LYFMLDNV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-NNPTSZGC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-NQM35JUI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// src/lib/qti-test/mixins/test-navigation.mixin.ts
|
|
2
|
+
var TestNavigationMixin = (superClass) => {
|
|
3
|
+
class TestNavigationClass extends superClass {
|
|
4
|
+
constructor(...args) {
|
|
5
|
+
super(...args);
|
|
6
|
+
this.addEventListener("qti-request-test-item", ({ detail: navItemId }) => {
|
|
7
|
+
if (!navItemId) return;
|
|
8
|
+
this._clearLoadedItems();
|
|
9
|
+
const itemRefEl = this.testElement.el.querySelector(
|
|
10
|
+
`qti-assessment-item-ref[identifier="${navItemId}"]`
|
|
11
|
+
);
|
|
12
|
+
const promise = this._loadItemRequest(itemRefEl.href, false);
|
|
13
|
+
const navPartId = itemRefEl.closest("qti-test-part").identifier;
|
|
14
|
+
const navSectionId = itemRefEl.closest("qti-assessment-section").identifier;
|
|
15
|
+
this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId, navItemLoading: true };
|
|
16
|
+
if (promise) {
|
|
17
|
+
promise.then((doc) => {
|
|
18
|
+
itemRefEl.xmlDoc = doc;
|
|
19
|
+
requestAnimationFrame(
|
|
20
|
+
() => this.dispatchEvent(new CustomEvent("qti-item-connected", { bubbles: true, composed: true }))
|
|
21
|
+
);
|
|
22
|
+
this._testContext = { ...this._testContext, navItemLoading: false };
|
|
23
|
+
}).catch((error) => console.error("Failed to load item:", error));
|
|
24
|
+
} else {
|
|
25
|
+
console.info("Load item request was not handled:", itemRefEl.href);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
this.addEventListener("qti-assessment-test-connected", () => {
|
|
29
|
+
let navItemId = this._testContext.navItemId;
|
|
30
|
+
if (!navItemId) {
|
|
31
|
+
const itemRefEl = this.testElement.el.querySelector("qti-assessment-item-ref");
|
|
32
|
+
navItemId = itemRefEl.identifier;
|
|
33
|
+
}
|
|
34
|
+
this.dispatchEvent(
|
|
35
|
+
new CustomEvent("qti-request-test-item", { detail: navItemId, bubbles: true, composed: true })
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
_clearLoadedItems() {
|
|
40
|
+
const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);
|
|
41
|
+
Array.from(itemRefEls).forEach((itemElement) => {
|
|
42
|
+
itemElement.xmlDoc = null;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
_loadItemRequest(href, cancelPreviousRequest = true) {
|
|
46
|
+
const event = new CustomEvent("qti-load-item-request", {
|
|
47
|
+
bubbles: true,
|
|
48
|
+
composed: true,
|
|
49
|
+
detail: {
|
|
50
|
+
href,
|
|
51
|
+
promise: null,
|
|
52
|
+
cancelPreviousRequest
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.dispatchEvent(event);
|
|
56
|
+
return event.detail.promise;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return TestNavigationClass;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
TestNavigationMixin
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=chunk-ODUHPWTX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/mixins/test-navigation.mixin.ts"],"sourcesContent":["import { QtiAssessmentItemRef } from '../qti-assessment-test';\nimport { TestBase } from '../test-base';\n\ndeclare module '../context/test.context' {\n interface TestContext {\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n }\n}\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestNavigationInterface {}\nexport const TestNavigationMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestNavigationClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n\n // this.addEventListener('qti-request-test-part', (e: CustomEvent) => {\n // this._clearLoadedItems();\n // });\n\n // Load all items of a section\n // this.addEventListener('qti-request-test-section', ({ detail: navSectionId }: CustomEvent<string>) => {\n // this._clearLoadedItems();\n\n // const sectionRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>(\n // `qti-assessment-section[identifier=\"${navSectionId}\"]`\n // );\n\n // const itemRefEls = this.testElement.el.querySelectorAll(\n // `qti-assessment-section[identifier=\"${navSectionId}\"] > qti-assessment-item-ref`\n // );\n\n // const navPartId = sectionRefEl.closest('qti-test-part').identifier;\n\n // this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId: null };\n\n // const items = Array.from(itemRefEls).map((itemRef: QtiAssessmentItemRef) => {\n // return { identifier: itemRef.identifier, href: itemRef.href, element: itemRef };\n // });\n\n // const promises = items.map((item, index) => {\n // return new Promise((resolve, reject) => {\n // return this._loadItemRequest(item.href, false)\n // .then(doc => (item.element.xmlDoc = doc))\n // .then(() => resolve(item))\n // .catch(error => console.error('Failed to load item:', error));\n // });\n // });\n\n // Promise.all(promises)\n // .then(results => {\n // requestAnimationFrame(() =>\n // this.dispatchEvent(new CustomEvent('qti-test-connected', { detail: results, bubbles: true, composed: true }))\n // );\n // })\n // .catch(error => console.error('One or more promises failed:', error));\n // });\n\n // load an item\n this.addEventListener('qti-request-test-item', ({ detail: navItemId }: CustomEvent<string>) => {\n if (!navItemId) return;\n this._clearLoadedItems();\n\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${navItemId}\"]`\n );\n\n const promise = this._loadItemRequest(itemRefEl.href, false);\n\n const navPartId = itemRefEl.closest('qti-test-part').identifier;\n const navSectionId = itemRefEl.closest('qti-assessment-section').identifier;\n this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId, navItemLoading: true };\n\n if (promise) {\n promise\n .then(doc => {\n itemRefEl.xmlDoc = doc;\n requestAnimationFrame(() =>\n this.dispatchEvent(new CustomEvent('qti-item-connected', { bubbles: true, composed: true }))\n );\n this._testContext = { ...this._testContext, navItemLoading: false };\n })\n .catch(error => console.error('Failed to load item:', error));\n } else {\n console.info('Load item request was not handled:', itemRefEl.href);\n }\n });\n\n this.addEventListener('qti-assessment-test-connected', () => {\n let navItemId = this._testContext.navItemId;\n if (!navItemId) {\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>('qti-assessment-item-ref');\n navItemId = itemRefEl.identifier;\n }\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', { detail: navItemId, bubbles: true, composed: true })\n );\n });\n }\n\n private _clearLoadedItems(): void {\n const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);\n Array.from(itemRefEls).forEach((itemElement: QtiAssessmentItemRef) => {\n itemElement.xmlDoc = null;\n });\n }\n\n private _loadItemRequest(href: string, cancelPreviousRequest: boolean = true): Promise<DocumentFragment> {\n const event = new CustomEvent('qti-load-item-request', {\n bubbles: true,\n composed: true,\n detail: {\n href: href,\n promise: null,\n cancelPreviousRequest\n }\n });\n this.dispatchEvent(event);\n\n return event.detail.promise;\n }\n }\n\n return TestNavigationClass as Constructor<TestNavigationInterface> & T;\n};\n"],"mappings":";AAgBO,IAAM,sBAAsB,CAAkC,eAAkB;AAAA,EACrF,MAAe,4BAA4B,WAAW;AAAA,IACpD,eAAe,MAAa;AAC1B,YAAM,GAAG,IAAI;AA6Cb,WAAK,iBAAiB,yBAAyB,CAAC,EAAE,QAAQ,UAAU,MAA2B;AAC7F,YAAI,CAAC,UAAW;AAChB,aAAK,kBAAkB;AAEvB,cAAM,YAAY,KAAK,YAAY,GAAG;AAAA,UACpC,uCAAuC,SAAS;AAAA,QAClD;AAEA,cAAM,UAAU,KAAK,iBAAiB,UAAU,MAAM,KAAK;AAE3D,cAAM,YAAY,UAAU,QAAQ,eAAe,EAAE;AACrD,cAAM,eAAe,UAAU,QAAQ,wBAAwB,EAAE;AACjE,aAAK,eAAe,EAAE,GAAG,KAAK,cAAc,WAAW,cAAc,WAAW,gBAAgB,KAAK;AAErG,YAAI,SAAS;AACX,kBACG,KAAK,SAAO;AACX,sBAAU,SAAS;AACnB;AAAA,cAAsB,MACpB,KAAK,cAAc,IAAI,YAAY,sBAAsB,EAAE,SAAS,MAAM,UAAU,KAAK,CAAC,CAAC;AAAA,YAC7F;AACA,iBAAK,eAAe,EAAE,GAAG,KAAK,cAAc,gBAAgB,MAAM;AAAA,UACpE,CAAC,EACA,MAAM,WAAS,QAAQ,MAAM,wBAAwB,KAAK,CAAC;AAAA,QAChE,OAAO;AACL,kBAAQ,KAAK,sCAAsC,UAAU,IAAI;AAAA,QACnE;AAAA,MACF,CAAC;AAED,WAAK,iBAAiB,iCAAiC,MAAM;AAC3D,YAAI,YAAY,KAAK,aAAa;AAClC,YAAI,CAAC,WAAW;AACd,gBAAM,YAAY,KAAK,YAAY,GAAG,cAAoC,yBAAyB;AACnG,sBAAY,UAAU;AAAA,QACxB;AACA,aAAK;AAAA,UACH,IAAI,YAAY,yBAAyB,EAAE,QAAQ,WAAW,SAAS,MAAM,UAAU,KAAK,CAAC;AAAA,QAC/F;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IAEQ,oBAA0B;AAChC,YAAM,aAAa,KAAK,YAAY,GAAG,iBAAiB,6CAA6C;AACrG,YAAM,KAAK,UAAU,EAAE,QAAQ,CAAC,gBAAsC;AACpE,oBAAY,SAAS;AAAA,MACvB,CAAC;AAAA,IACH;AAAA,IAEQ,iBAAiB,MAAc,wBAAiC,MAAiC;AACvG,YAAM,QAAQ,IAAI,YAAY,yBAAyB;AAAA,QACrD,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ;AAAA,UACN;AAAA,UACA,SAAS;AAAA,UACT;AAAA,QACF;AAAA,MACF,CAAC;AACD,WAAK,cAAc,KAAK;AAExB,aAAO,MAAM,OAAO;AAAA,IACtB;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TestLoaderMixin
|
|
3
|
+
} from "./chunk-VW7VIQBE.js";
|
|
4
|
+
import {
|
|
5
|
+
TestNavigationMixin
|
|
6
|
+
} from "./chunk-ODUHPWTX.js";
|
|
7
|
+
import {
|
|
8
|
+
TestViewMixin
|
|
9
|
+
} from "./chunk-U3RLYKL5.js";
|
|
10
|
+
import {
|
|
11
|
+
TestBase
|
|
12
|
+
} from "./chunk-PBSMP6VF.js";
|
|
13
|
+
import {
|
|
14
|
+
__decorateClass
|
|
15
|
+
} from "./chunk-44VE5POH.js";
|
|
16
|
+
|
|
17
|
+
// src/lib/qti-test/qti-test.ts
|
|
18
|
+
import { html } from "lit";
|
|
19
|
+
import { customElement } from "lit/decorators.js";
|
|
20
|
+
var QtiTest = class extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {
|
|
21
|
+
/**
|
|
22
|
+
* Renders the component's template.
|
|
23
|
+
* Provides a default `<slot>` for content projection.
|
|
24
|
+
*/
|
|
25
|
+
render() {
|
|
26
|
+
return html`<slot></slot>`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
QtiTest = __decorateClass([
|
|
30
|
+
customElement("qti-test")
|
|
31
|
+
], QtiTest);
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
QtiTest
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chunk-OGHHCP23.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/qti-test.ts"],"sourcesContent":["import { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestLoaderMixin, TestNavigationMixin, TestViewMixin } from './mixins';\nimport { TestBase } from './test-base';\n\n/**\n * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n *\n * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n *\n * ### Example Usage\n *\n * Minimal example including navigation:\n *\n * ```html\n * <qti-test>\n * <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n * <nav class=\"flex\">\n * <test-prev></test-prev>\n * <test-next></test-next>\n * </nav>\n * </qti-test>\n * ```\n *\n * Use the following file structure\n * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n *\n * ```plaintext\n * Root/\n * ├── index.html\n * └── /assets/api/examples/\n * ├── assessmenttest.xml\n * └── imsmanifest.xml\n *\n * ```\n *\n * ### Test components\n *\n * Use test components inside the qti-test component for added functionality.\n * ### Test next\n * `<test-next> | TestNext`\n *\n * ### Test prev\n *\n * `<test-prev> | TestPrev`\n * ### Test components\n *\n * You can use normal class names to style the elements.\n * And you can use the `test-prev` and `test-next` elements to navigate through the test.\n *\n */\n@customElement('qti-test')\nexport class QtiTest extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {\n /**\n * Renders the component's template.\n * Provides a default `<slot>` for content projection.\n */\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test': QtiTest;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAmDvB,IAAM,UAAN,cAAsB,gBAAgB,oBAAoB,cAAc,QAAQ,CAAC,CAAC,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,EAKzF,SAAS;AACP,WAAO;AAAA,EACT;AACF;AARa,UAAN;AAAA,EADN,cAAc,UAAU;AAAA,GACZ;","names":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
testContext
|
|
3
|
+
} from "./chunk-R4HSV7U7.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-44VE5POH.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/qti-assessment-test/qti-assessment-item-ref.ts
|
|
9
|
+
import { consume } from "@lit/context";
|
|
10
|
+
import { html, LitElement } from "lit";
|
|
11
|
+
import { property } from "lit/decorators.js";
|
|
12
|
+
var stringToBooleanConverter = {
|
|
13
|
+
fromAttribute(value) {
|
|
14
|
+
return value === "true";
|
|
15
|
+
},
|
|
16
|
+
toAttribute(value) {
|
|
17
|
+
return value ? "true" : "false";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var QtiAssessmentItemRef = class extends LitElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.weigths = /* @__PURE__ */ new Map();
|
|
24
|
+
}
|
|
25
|
+
// the XMLDocument
|
|
26
|
+
createRenderRoot() {
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
get assessmentItem() {
|
|
30
|
+
return this.renderRoot?.querySelector("qti-assessment-item");
|
|
31
|
+
}
|
|
32
|
+
async connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
await this.updateComplete;
|
|
35
|
+
this.dispatchEvent(
|
|
36
|
+
new CustomEvent("qti-assessment-item-ref-connected", {
|
|
37
|
+
bubbles: true,
|
|
38
|
+
composed: true,
|
|
39
|
+
detail: { identifier: this.identifier, href: this.href, category: this.category }
|
|
40
|
+
})
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return html`${this.xmlDoc}`;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
__decorateClass([
|
|
48
|
+
property({ type: String })
|
|
49
|
+
], QtiAssessmentItemRef.prototype, "category", 2);
|
|
50
|
+
__decorateClass([
|
|
51
|
+
property({ type: String })
|
|
52
|
+
], QtiAssessmentItemRef.prototype, "identifier", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
property({ type: Boolean, converter: stringToBooleanConverter })
|
|
55
|
+
], QtiAssessmentItemRef.prototype, "required", 2);
|
|
56
|
+
__decorateClass([
|
|
57
|
+
property({ type: Boolean, converter: stringToBooleanConverter })
|
|
58
|
+
], QtiAssessmentItemRef.prototype, "fixed", 2);
|
|
59
|
+
__decorateClass([
|
|
60
|
+
property({ type: String })
|
|
61
|
+
], QtiAssessmentItemRef.prototype, "href", 2);
|
|
62
|
+
__decorateClass([
|
|
63
|
+
consume({ context: testContext, subscribe: true })
|
|
64
|
+
], QtiAssessmentItemRef.prototype, "_testContext", 2);
|
|
65
|
+
__decorateClass([
|
|
66
|
+
property({ type: Object, attribute: false })
|
|
67
|
+
], QtiAssessmentItemRef.prototype, "xmlDoc", 2);
|
|
68
|
+
if (!customElements.get("qti-assessment-item-ref")) {
|
|
69
|
+
customElements.define("qti-assessment-item-ref", QtiAssessmentItemRef);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export {
|
|
73
|
+
QtiAssessmentItemRef
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=chunk-OQZW2B47.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/qti-assessment-test/qti-assessment-item-ref.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { testContext, TestContext } from '../context';\nimport { QtiAssessmentItem } from '../../qti-components';\n\n// Converter function to interpret \"true\" and \"false\" as booleans\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\n// @customElement('qti-assessment-item-ref')\nexport class QtiAssessmentItemRef extends LitElement {\n @property({ type: String }) category?: string;\n @property({ type: String }) identifier?: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) required?: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed?: boolean;\n @property({ type: String }) href?: string;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n weigths: Map<string, number> = new Map();\n\n @property({ type: Object, attribute: false })\n xmlDoc!: DocumentFragment; // the XMLDocument\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n get assessmentItem(): QtiAssessmentItem | null {\n return this.renderRoot?.querySelector('qti-assessment-item');\n }\n\n async connectedCallback(): Promise<void> {\n // debugger;\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-item-ref-connected', {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier, href: this.href, category: this.category }\n })\n );\n }\n\n render() {\n return html`${this.xmlDoc}`;\n }\n}\n\nif (!customElements.get('qti-assessment-item-ref')) {\n customElements.define('qti-assessment-item-ref', QtiAssessmentItemRef);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item-ref': QtiAssessmentItemRef;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,kBAAkB;AACjC,SAAS,gBAAgB;AAKzB,IAAM,2BAA2B;AAAA,EAC/B,cAAc,OAAwB;AACpC,WAAO,UAAU;AAAA,EACnB;AAAA,EACA,YAAY,OAAwB;AAClC,WAAO,QAAQ,SAAS;AAAA,EAC1B;AACF;AAGO,IAAM,uBAAN,cAAmC,WAAW;AAAA,EAA9C;AAAA;AAUL,mBAA+B,oBAAI,IAAI;AAAA;AAAA;AAAA,EAK7B,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,IAAI,iBAA2C;AAC7C,WAAO,KAAK,YAAY,cAAc,qBAAqB;AAAA,EAC7D;AAAA,EAEA,MAAM,oBAAmC;AAEvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,YAAY,qCAAqC;AAAA,QACnD,SAAS;AAAA,QACT,UAAU;AAAA,QACV,QAAQ,EAAE,YAAY,KAAK,YAAY,MAAM,KAAK,MAAM,UAAU,KAAK,SAAS;AAAA,MAClF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO,OAAO,KAAK,MAAM;AAAA,EAC3B;AACF;AAtC8B;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,qBACiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,qBAEiB;AACsC;AAAA,EAAjE,SAAS,EAAE,MAAM,SAAS,WAAW,yBAAyB,CAAC;AAAA,GAHrD,qBAGuD;AACA;AAAA,EAAjE,SAAS,EAAE,MAAM,SAAS,WAAW,yBAAyB,CAAC;AAAA,GAJrD,qBAIuD;AACtC;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GALf,qBAKiB;AAGrB;AAAA,EADN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAPvC,qBAQJ;AAKP;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,MAAM,CAAC;AAAA,GAZjC,qBAaX;AA4BF,IAAI,CAAC,eAAe,IAAI,yBAAyB,GAAG;AAClD,iBAAe,OAAO,2BAA2B,oBAAoB;AACvE;","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
testContext
|
|
3
|
+
} from "./chunk-R4HSV7U7.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-44VE5POH.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/qti-assessment-test/qti-assessment-section.ts
|
|
9
|
+
import { consume } from "@lit/context";
|
|
10
|
+
import { html, LitElement } from "lit";
|
|
11
|
+
import { property } from "lit/decorators.js";
|
|
12
|
+
var stringToBooleanConverter = {
|
|
13
|
+
fromAttribute(value) {
|
|
14
|
+
return value === "true";
|
|
15
|
+
},
|
|
16
|
+
toAttribute(value) {
|
|
17
|
+
return value ? "true" : "false";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var QtiAssessmentSection = class extends LitElement {
|
|
21
|
+
async connectedCallback() {
|
|
22
|
+
super.connectedCallback();
|
|
23
|
+
await this.updateComplete;
|
|
24
|
+
this.dispatchEvent(
|
|
25
|
+
new Event("qti-assessment-section-connected", {
|
|
26
|
+
bubbles: true,
|
|
27
|
+
composed: true
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return html`<slot name="qti-rubric-block"></slot><slot></slot>`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
__decorateClass([
|
|
36
|
+
property({ type: String })
|
|
37
|
+
], QtiAssessmentSection.prototype, "identifier", 2);
|
|
38
|
+
__decorateClass([
|
|
39
|
+
property({ type: String })
|
|
40
|
+
], QtiAssessmentSection.prototype, "required", 2);
|
|
41
|
+
__decorateClass([
|
|
42
|
+
property({ type: Boolean, converter: stringToBooleanConverter })
|
|
43
|
+
], QtiAssessmentSection.prototype, "fixed", 2);
|
|
44
|
+
__decorateClass([
|
|
45
|
+
property({ type: String })
|
|
46
|
+
], QtiAssessmentSection.prototype, "title", 2);
|
|
47
|
+
__decorateClass([
|
|
48
|
+
property({ type: Boolean, converter: stringToBooleanConverter })
|
|
49
|
+
], QtiAssessmentSection.prototype, "visible", 2);
|
|
50
|
+
__decorateClass([
|
|
51
|
+
property({ type: Boolean, converter: stringToBooleanConverter, attribute: "keep-together" })
|
|
52
|
+
], QtiAssessmentSection.prototype, "keepTogether", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
consume({ context: testContext, subscribe: true })
|
|
55
|
+
], QtiAssessmentSection.prototype, "_testContext", 2);
|
|
56
|
+
if (!customElements.get("qti-assessment-section")) {
|
|
57
|
+
customElements.define("qti-assessment-section", QtiAssessmentSection);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
QtiAssessmentSection
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=chunk-OXDOQVRL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/qti-assessment-test/qti-assessment-section.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { testContext, TestContext } from '../context';\n\n// https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#Root_AssessmentSection\n\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\nexport class QtiAssessmentSection extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) required: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed: boolean;\n @property({ type: String }) title: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) visible: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter, attribute: 'keep-together' }) keepTogether: boolean;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-assessment-section-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html`<slot name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-assessment-section')) {\n customElements.define('qti-assessment-section', QtiAssessmentSection);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-section': QtiAssessmentSection;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,MAAM,kBAAkB;AACjC,SAAS,gBAAgB;AAKzB,IAAM,2BAA2B;AAAA,EAC/B,cAAc,OAAwB;AACpC,WAAO,UAAU;AAAA,EACnB;AAAA,EACA,YAAY,OAAwB;AAClC,WAAO,QAAQ,SAAS;AAAA,EAC1B;AACF;AAEO,IAAM,uBAAN,cAAmC,WAAW;AAAA,EAWnD,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,MAAM,oCAAoC;AAAA,QAC5C,SAAS;AAAA,QACT,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAxB8B;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,qBACiB;AACA;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,qBAEiB;AACsC;AAAA,EAAjE,SAAS,EAAE,MAAM,SAAS,WAAW,yBAAyB,CAAC;AAAA,GAHrD,qBAGuD;AACtC;AAAA,EAA3B,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAJf,qBAIiB;AACsC;AAAA,EAAjE,SAAS,EAAE,MAAM,SAAS,WAAW,yBAAyB,CAAC;AAAA,GALrD,qBAKuD;AAC4B;AAAA,EAA7F,SAAS,EAAE,MAAM,SAAS,WAAW,0BAA0B,WAAW,gBAAgB,CAAC;AAAA,GANjF,qBAMmF;AAGvF;AAAA,EADN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GARvC,qBASJ;AAkBT,IAAI,CAAC,eAAe,IAAI,wBAAwB,GAAG;AACjD,iBAAe,OAAO,0BAA0B,oBAAoB;AACtE;","names":[]}
|