@citolab/qti-components 7.0.4 → 7.0.5
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-4UJBK6JO.js +1 -0
- package/cdn/chunks/chunk-5FCXUJAG.js +23 -0
- package/cdn/chunks/chunk-5O3Z7TDV.js +1 -0
- package/cdn/chunks/chunk-65LFT33L.js +8 -0
- package/cdn/chunks/chunk-6D25UFJR.js +8 -0
- package/cdn/chunks/chunk-6DMSHH5X.js +0 -0
- package/cdn/chunks/chunk-6UGPNL7M.js +1 -0
- package/cdn/chunks/chunk-CFXQCNG6.js +3523 -0
- package/cdn/chunks/chunk-CSUKVUZF.js +3 -0
- package/cdn/chunks/chunk-CSY3WI5A.js +1 -0
- package/cdn/chunks/chunk-DAZR7RUI.js +0 -0
- package/cdn/chunks/chunk-EHK76KRT.js +1 -0
- package/cdn/chunks/chunk-EOPEMJS3.js +0 -0
- package/cdn/chunks/chunk-G5O7EN45.js +5 -0
- package/cdn/chunks/chunk-GEFUIFM7.js +0 -0
- package/cdn/chunks/chunk-JLNHEMQG.js +1 -0
- package/cdn/chunks/chunk-LPWIM7QJ.js +902 -0
- package/cdn/chunks/chunk-M3YRM3AV.js +1 -0
- package/cdn/chunks/chunk-M6BOWL2U.js +1 -0
- package/cdn/chunks/chunk-P5IE36FO.js +8 -0
- package/cdn/chunks/chunk-PXH5KN5O.js +1 -0
- package/cdn/chunks/chunk-RBEI6NIF.js +1 -0
- package/cdn/chunks/chunk-SMKIYFFI.js +1 -0
- package/cdn/chunks/chunk-SRLMW23F.js +0 -0
- package/cdn/chunks/chunk-T3YDLD2H.js +11 -0
- package/cdn/chunks/chunk-T4HD2C4F.js +1 -0
- package/cdn/chunks/chunk-T6IXJ4W4.js +1 -0
- package/cdn/chunks/chunk-TFAUBGP2.js +0 -0
- package/cdn/chunks/chunk-UIEC4LXR.js +17 -0
- package/cdn/chunks/chunk-V44O3GTW.js +0 -0
- package/cdn/chunks/chunk-V6B54FQW.js +5 -0
- package/cdn/chunks/chunk-V6KX6BQN.js +1 -0
- package/cdn/chunks/chunk-VYANBI35.js +1 -0
- package/cdn/chunks/chunk-XUJ7TXHW.js +1 -0
- package/cdn/chunks/chunk-ZIZLFFSG.js +0 -0
- package/cdn/index.css +1 -0
- package/cdn/index.global.js +45 -45
- package/cdn/index.js +196 -476
- package/cdn/qti-components/index.global.js +226 -0
- package/cdn/qti-components/index.js +924 -0
- package/cdn/qti-item/components/index.css +1 -0
- package/cdn/qti-item/components/index.global.js +149 -0
- package/cdn/qti-item/components/index.js +3549 -0
- package/cdn/qti-item/components/item-container.css +1 -0
- package/cdn/qti-item/components/item-container.global.js +149 -0
- package/cdn/qti-item/components/item-container.js +3549 -0
- package/cdn/qti-item/index.css +1 -0
- package/cdn/qti-item/index.global.js +149 -0
- package/cdn/qti-item/index.js +3549 -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 +23 -0
- package/cdn/qti-test/components/index.css +1 -0
- package/cdn/qti-test/components/index.global.js +242 -0
- package/cdn/qti-test/components/index.js +3598 -0
- package/cdn/qti-test/components/styles.global.js +44 -0
- package/cdn/qti-test/components/styles.js +17 -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.css +1 -0
- package/cdn/qti-test/components/test-container.global.js +149 -0
- package/cdn/qti-test/components/test-container.js +3549 -0
- package/cdn/qti-test/components/test-item-link.global.js +170 -0
- package/cdn/qti-test/components/test-item-link.js +24 -0
- package/cdn/qti-test/components/test-next.global.js +170 -0
- package/cdn/qti-test/components/test-next.js +24 -0
- package/cdn/qti-test/components/test-next.spec.css +1 -0
- package/cdn/qti-test/components/test-next.spec.global.js +297 -0
- package/cdn/qti-test/components/test-next.spec.js +5215 -0
- package/cdn/qti-test/components/test-paging-buttons-stamp.global.js +207 -0
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +3 -0
- package/cdn/qti-test/components/test-prev.global.js +170 -0
- package/cdn/qti-test/components/test-prev.js +24 -0
- package/cdn/qti-test/components/test-view.global.js +170 -0
- package/cdn/qti-test/components/test-view.js +11 -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.css +1 -0
- package/cdn/qti-test/index.global.js +242 -0
- package/cdn/qti-test/index.js +3598 -0
- package/cdn/qti-test/mixins/index.global.js +1 -0
- package/cdn/qti-test/mixins/index.js +23 -0
- package/cdn/qti-test/mixins/test-loader.mixin.global.js +1 -0
- package/cdn/qti-test/mixins/test-loader.mixin.js +23 -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 +23 -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 +23 -0
- package/dist/chunks/chunk-3G2DDBJW.js +44 -0
- package/dist/chunks/chunk-3G2DDBJW.js.map +1 -0
- package/dist/chunks/chunk-3NLCJYSX.js +1 -0
- package/dist/chunks/chunk-3NLCJYSX.js.map +1 -0
- package/dist/chunks/chunk-3OXGDCSU.js +6253 -0
- package/dist/chunks/chunk-3OXGDCSU.js.map +1 -0
- package/dist/chunks/chunk-3ROZMGAN.js +43 -0
- package/dist/chunks/chunk-3ROZMGAN.js.map +1 -0
- package/dist/chunks/chunk-4O5F7WV7.js +30 -0
- package/dist/chunks/chunk-4O5F7WV7.js.map +1 -0
- package/dist/chunks/chunk-6YE2KJ4C.js +55 -0
- package/dist/chunks/chunk-6YE2KJ4C.js.map +1 -0
- package/dist/chunks/chunk-AAQCM2FP.js +56 -0
- package/dist/chunks/chunk-AAQCM2FP.js.map +1 -0
- package/dist/chunks/chunk-D3RGDWKP.js +37 -0
- package/dist/chunks/chunk-D3RGDWKP.js.map +1 -0
- package/dist/chunks/chunk-DJLE6EV2.js +36 -0
- package/dist/chunks/chunk-DJLE6EV2.js.map +1 -0
- package/dist/chunks/chunk-ELDMXTUQ.js +31 -0
- package/dist/chunks/chunk-ELDMXTUQ.js.map +1 -0
- package/dist/chunks/chunk-EW5CTHAD.js +1 -0
- package/dist/chunks/chunk-EW5CTHAD.js.map +1 -0
- package/dist/chunks/chunk-HWA4A3SR.js +50 -0
- package/dist/chunks/chunk-HWA4A3SR.js.map +1 -0
- package/dist/chunks/chunk-IKZWK2C5.js +1 -0
- package/dist/chunks/chunk-IKZWK2C5.js.map +1 -0
- package/dist/chunks/chunk-IP7JSYO6.js +1 -0
- package/dist/chunks/chunk-IP7JSYO6.js.map +1 -0
- package/dist/chunks/chunk-JE6BMXZU.js +94 -0
- package/dist/chunks/chunk-JE6BMXZU.js.map +1 -0
- package/dist/chunks/chunk-JSPJGWGT.js +20 -0
- package/dist/chunks/chunk-JSPJGWGT.js.map +1 -0
- package/dist/chunks/chunk-LKINC6JO.js +118 -0
- package/dist/chunks/chunk-LKINC6JO.js.map +1 -0
- package/dist/chunks/chunk-LROTNPC2.js +94 -0
- package/dist/chunks/chunk-LROTNPC2.js.map +1 -0
- package/dist/chunks/chunk-MTMT2RMF.js +63 -0
- package/dist/chunks/chunk-MTMT2RMF.js.map +1 -0
- package/dist/chunks/chunk-NDJZGJUR.js +65 -0
- package/dist/chunks/chunk-NDJZGJUR.js.map +1 -0
- package/dist/chunks/chunk-OE2LFIH2.js +1 -0
- package/dist/chunks/chunk-OE2LFIH2.js.map +1 -0
- package/dist/chunks/chunk-OJ2XGDWK.js +1 -0
- package/dist/chunks/chunk-OJ2XGDWK.js.map +1 -0
- package/dist/chunks/chunk-PUBGXXTM.js +50 -0
- package/dist/chunks/chunk-PUBGXXTM.js.map +1 -0
- package/dist/chunks/chunk-QRCUNRP5.js +75 -0
- package/dist/chunks/chunk-QRCUNRP5.js.map +1 -0
- package/dist/chunks/chunk-S6JJYCO7.js +51 -0
- package/dist/chunks/chunk-S6JJYCO7.js.map +1 -0
- package/dist/chunks/chunk-U3AALKEP.js +1 -0
- package/dist/chunks/chunk-U3AALKEP.js.map +1 -0
- package/dist/chunks/chunk-UCQFSRYF.js +34 -0
- package/dist/chunks/chunk-UCQFSRYF.js.map +1 -0
- package/dist/chunks/chunk-URGVQ64M.js +1 -0
- package/dist/chunks/chunk-URGVQ64M.js.map +1 -0
- package/dist/chunks/chunk-V4FXK4TP.js +128 -0
- package/dist/chunks/chunk-V4FXK4TP.js.map +1 -0
- package/dist/chunks/chunk-W4B23OIP.js +72 -0
- package/dist/chunks/chunk-W4B23OIP.js.map +1 -0
- package/dist/chunks/chunk-XDFXD3BI.js +10 -0
- package/dist/chunks/chunk-XDFXD3BI.js.map +1 -0
- package/dist/chunks/chunk-XDMSEAYC.js +294 -0
- package/dist/chunks/chunk-XPDS72XY.js +29 -0
- package/dist/chunks/chunk-XPDS72XY.js.map +1 -0
- package/dist/chunks/chunk-Y6UWSECL.js +3529 -0
- package/dist/chunks/chunk-Y6UWSECL.js.map +1 -0
- package/dist/chunks/chunk-ZEFOMZNY.js +78 -0
- package/dist/chunks/chunk-ZEFOMZNY.js.map +1 -0
- package/dist/index-Cvrd4KQA.d.ts +109 -0
- package/dist/index.d.ts +18 -503
- package/dist/index.js +1666 -4206
- 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 +6525 -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 +3856 -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 +3856 -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 +3869 -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 +26 -0
- package/dist/qti-item/qti-item.js.map +1 -0
- package/dist/{loader → qti-loader}/index.d.ts +1 -1
- 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 +4144 -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 +29 -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 +149 -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 +3782 -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 +202 -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 +209 -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 +56915 -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 +218 -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 +209 -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 +209 -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 +9 -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 +9 -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 +4746 -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 +350 -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 +240 -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 +64 -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 +50 -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 +221 -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 +85 -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 +73 -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 +54 -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 +62 -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 +500 -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 +137 -0
- package/dist/qti-test/test-base.js.map +1 -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 -51
- package/dist/custom-element-eslint-rules.js +0 -329
- package/dist/custom-elements.json +0 -27271
- 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 → chunks/chunk-XDMSEAYC.js.map} +0 -0
- /package/dist/{loader → qti-loader}/index.js +0 -0
- /package/dist/{loader → qti-loader}/index.js.map +0 -0
- /package/dist/{transformers → qti-transformers}/index.d.ts +0 -0
- /package/dist/{transformers → qti-transformers}/index.js +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-4O5F7WV7.js";
|
|
5
|
+
import {
|
|
6
|
+
TestComponent
|
|
7
|
+
} from "./chunk-LKINC6JO.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-6YE2KJ4C.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-3ROZMGAN.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,30 @@
|
|
|
1
|
+
// src/lib/qti-test/components/styles.ts
|
|
2
|
+
import { css } from "lit";
|
|
3
|
+
var form = css`
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
padding: 0.5rem 1rem;
|
|
8
|
+
border-radius: 0.25rem;
|
|
9
|
+
user-select: none;
|
|
10
|
+
`;
|
|
11
|
+
var btn = css`
|
|
12
|
+
background-color: lightgray;
|
|
13
|
+
${form};
|
|
14
|
+
`;
|
|
15
|
+
var dis = css`
|
|
16
|
+
cursor: not-allowed;
|
|
17
|
+
opacity: 0.5;
|
|
18
|
+
`;
|
|
19
|
+
var ind = css`
|
|
20
|
+
${form};
|
|
21
|
+
border: 1px solid gray;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
form,
|
|
26
|
+
btn,
|
|
27
|
+
dis,
|
|
28
|
+
ind
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk-4O5F7WV7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/styles.ts"],"sourcesContent":["// /* eslint-disable lit-plugin(no-invalid-css) */\nimport { css } from 'lit';\n\nexport const form = css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n padding: 0.5rem 1rem;\n border-radius: 0.25rem;\n user-select: none;\n`;\n\nexport const btn = css`\n background-color: lightgray;\n ${form};\n`;\n\nexport const dis = css`\n cursor: not-allowed;\n opacity: 0.5;\n`;\n\nexport const ind = css`\n ${form};\n border: 1px solid gray;\n`;\n"],"mappings":";AACA,SAAS,WAAW;AAEb,IAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASb,IAAM,MAAM;AAAA;AAAA,IAEf,IAAI;AAAA;AAGD,IAAM,MAAM;AAAA;AAAA;AAAA;AAKZ,IAAM,MAAM;AAAA,IACf,IAAI;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
+
}) : x)(function(x) {
|
|
11
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
14
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
+
};
|
|
17
|
+
var __export = (target, all) => {
|
|
18
|
+
for (var name in all)
|
|
19
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
+
};
|
|
21
|
+
var __copyProps = (to, from, except, desc) => {
|
|
22
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(from))
|
|
24
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
+
}
|
|
27
|
+
return to;
|
|
28
|
+
};
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
+
mod
|
|
36
|
+
));
|
|
37
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
38
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
39
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
40
|
+
if (decorator = decorators[i])
|
|
41
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
42
|
+
if (kind && result) __defProp(target, key, result);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
__require,
|
|
49
|
+
__commonJS,
|
|
50
|
+
__export,
|
|
51
|
+
__toESM,
|
|
52
|
+
__decorateClass,
|
|
53
|
+
__publicField
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-6YE2KJ4C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__decorateClass
|
|
3
|
+
} from "./chunk-6YE2KJ4C.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-AAQCM2FP.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,37 @@
|
|
|
1
|
+
// src/lib/decorators/live-query.ts
|
|
2
|
+
function liveQuery(querySelector, _options) {
|
|
3
|
+
let observer;
|
|
4
|
+
return (proto, decoratedFnName) => {
|
|
5
|
+
const { connectedCallback, disconnectedCallback } = proto;
|
|
6
|
+
proto.connectedCallback = function() {
|
|
7
|
+
connectedCallback.call(this);
|
|
8
|
+
const callback = (mutationList) => {
|
|
9
|
+
const elementsToWatch = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
10
|
+
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
11
|
+
);
|
|
12
|
+
for (const mutation of mutationList) {
|
|
13
|
+
const addedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
14
|
+
const removedNodes = Array.from(mutation.addedNodes).map((e) => e);
|
|
15
|
+
if (mutation.type === "childList" && addedNodes.find((n) => elementsToWatch.includes(n))) {
|
|
16
|
+
this[decoratedFnName](addedNodes, removedNodes);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
observer = new MutationObserver(callback);
|
|
21
|
+
observer.observe(this, { childList: true, subtree: true });
|
|
22
|
+
const elementsAdded = Array.from(this.querySelectorAll(querySelector)).concat(
|
|
23
|
+
Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])
|
|
24
|
+
);
|
|
25
|
+
this[decoratedFnName](Array.from(elementsAdded), []);
|
|
26
|
+
};
|
|
27
|
+
proto.disconnectedCallback = function() {
|
|
28
|
+
disconnectedCallback.call(this);
|
|
29
|
+
observer.disconnect();
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
liveQuery
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=chunk-D3RGDWKP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/decorators/live-query.ts"],"sourcesContent":["// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n\nimport type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\ntype UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface LiveQueryOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n}\n\nexport function liveQuery(querySelector: string, _options?: LiveQueryOptions) {\n let observer: MutationObserver;\n // const resolvedOptions: Required<LiveQueryOptions> = {\n // ...options\n // };\n return <ElemClass extends LitElement>(\n proto: ElemClass,\n decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>\n ): void => {\n const { connectedCallback, disconnectedCallback } = proto;\n\n proto.connectedCallback = function (this: ElemClass) {\n connectedCallback.call(this);\n const callback = (mutationList: MutationRecord[]) => {\n const elementsToWatch = Array.from(this.querySelectorAll(querySelector)).concat(\n Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])\n );\n for (const mutation of mutationList) {\n const addedNodes = Array.from(mutation.addedNodes).map(e => e as Element);\n const removedNodes = Array.from(mutation.addedNodes).map(e => e as Element);\n if (mutation.type === 'childList' && addedNodes.find(n => elementsToWatch.includes(n))) {\n (this[decoratedFnName] as unknown as UpdateHandler)(addedNodes, removedNodes);\n }\n }\n };\n observer = new MutationObserver(callback);\n observer.observe(this, { childList: true, subtree: true });\n\n const elementsAdded = Array.from(this.querySelectorAll(querySelector)).concat(\n Array.from(this.shadowRoot?.querySelectorAll(querySelector) || [])\n );\n (this[decoratedFnName] as unknown as UpdateHandler)(Array.from(elementsAdded), []);\n };\n\n proto.disconnectedCallback = function (this: ElemClass) {\n disconnectedCallback.call(this);\n observer.disconnect();\n };\n };\n}\n"],"mappings":";AA8BO,SAAS,UAAU,eAAuB,UAA6B;AAC5E,MAAI;AAIJ,SAAO,CACL,OACA,oBACS;AACT,UAAM,EAAE,mBAAmB,qBAAqB,IAAI;AAEpD,UAAM,oBAAoB,WAA2B;AACnD,wBAAkB,KAAK,IAAI;AAC3B,YAAM,WAAW,CAAC,iBAAmC;AACnD,cAAM,kBAAkB,MAAM,KAAK,KAAK,iBAAiB,aAAa,CAAC,EAAE;AAAA,UACvE,MAAM,KAAK,KAAK,YAAY,iBAAiB,aAAa,KAAK,CAAC,CAAC;AAAA,QACnE;AACA,mBAAW,YAAY,cAAc;AACnC,gBAAM,aAAa,MAAM,KAAK,SAAS,UAAU,EAAE,IAAI,OAAK,CAAY;AACxE,gBAAM,eAAe,MAAM,KAAK,SAAS,UAAU,EAAE,IAAI,OAAK,CAAY;AAC1E,cAAI,SAAS,SAAS,eAAe,WAAW,KAAK,OAAK,gBAAgB,SAAS,CAAC,CAAC,GAAG;AACtF,YAAC,KAAK,eAAe,EAA+B,YAAY,YAAY;AAAA,UAC9E;AAAA,QACF;AAAA,MACF;AACA,iBAAW,IAAI,iBAAiB,QAAQ;AACxC,eAAS,QAAQ,MAAM,EAAE,WAAW,MAAM,SAAS,KAAK,CAAC;AAEzD,YAAM,gBAAgB,MAAM,KAAK,KAAK,iBAAiB,aAAa,CAAC,EAAE;AAAA,QACrE,MAAM,KAAK,KAAK,YAAY,iBAAiB,aAAa,KAAK,CAAC,CAAC;AAAA,MACnE;AACA,MAAC,KAAK,eAAe,EAA+B,MAAM,KAAK,aAAa,GAAG,CAAC,CAAC;AAAA,IACnF;AAEA,UAAM,uBAAuB,WAA2B;AACtD,2BAAqB,KAAK,IAAI;AAC9B,eAAS,WAAW;AAAA,IACtB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TestLoaderMixin
|
|
3
|
+
} from "./chunk-UCQFSRYF.js";
|
|
4
|
+
import {
|
|
5
|
+
TestNavigationMixin
|
|
6
|
+
} from "./chunk-NDJZGJUR.js";
|
|
7
|
+
import {
|
|
8
|
+
TestViewMixin
|
|
9
|
+
} from "./chunk-S6JJYCO7.js";
|
|
10
|
+
import {
|
|
11
|
+
TestBase
|
|
12
|
+
} from "./chunk-V4FXK4TP.js";
|
|
13
|
+
import {
|
|
14
|
+
__decorateClass
|
|
15
|
+
} from "./chunk-6YE2KJ4C.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-DJLE6EV2.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,31 @@
|
|
|
1
|
+
// src/lib/decorators/watch.ts
|
|
2
|
+
function watch(propertyName, options) {
|
|
3
|
+
const resolvedOptions = {
|
|
4
|
+
waitUntilFirstUpdate: false,
|
|
5
|
+
...options
|
|
6
|
+
};
|
|
7
|
+
return (proto, decoratedFnName) => {
|
|
8
|
+
const { update } = proto;
|
|
9
|
+
const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];
|
|
10
|
+
proto.update = function(changedProps) {
|
|
11
|
+
watchedProperties.forEach((property) => {
|
|
12
|
+
const key = property;
|
|
13
|
+
if (changedProps.has(key)) {
|
|
14
|
+
const oldValue = changedProps.get(key);
|
|
15
|
+
const newValue = this[key];
|
|
16
|
+
if (oldValue !== newValue) {
|
|
17
|
+
if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {
|
|
18
|
+
this[decoratedFnName](oldValue, newValue);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
update.call(this, changedProps);
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
watch
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-ELDMXTUQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/decorators/watch.ts"],"sourcesContent":["import type { LitElement } from 'lit';\n\ntype UpdateHandler = (prev?: unknown, next?: unknown) => void;\n\ntype NonUndefined<A> = A extends undefined ? never : A;\n\nexport type UpdateHandlerFunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;\n}[keyof T];\n\ninterface WatchOptions {\n /**\n * If true, will only start watching after the initial update/render\n */\n waitUntilFirstUpdate?: boolean;\n}\n\n/**\n * Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an\n * update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the\n * initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n *\n * Usage:\n *\n * @watch('propName')\n * handlePropChange(oldValue, newValue) {\n * ...\n * }\n */\nexport function watch(propertyName: string | string[], options?: WatchOptions) {\n const resolvedOptions: Required<WatchOptions> = {\n waitUntilFirstUpdate: false,\n ...options\n };\n return <ElemClass extends LitElement>(\n proto: ElemClass,\n decoratedFnName: UpdateHandlerFunctionKeys<ElemClass> | any\n ) => {\n // @ts-expect-error - update is a protected property\n const { update } = proto;\n const watchedProperties = Array.isArray(propertyName) ? propertyName : [propertyName];\n\n // @ts-expect-error - update is a protected property\n proto.update = function (this: ElemClass, changedProps: Map<keyof ElemClass, ElemClass[keyof ElemClass]>) {\n watchedProperties.forEach(property => {\n const key = property as keyof ElemClass;\n if (changedProps.has(key)) {\n const oldValue = changedProps.get(key);\n const newValue = this[key];\n\n if (oldValue !== newValue) {\n if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) {\n (this[decoratedFnName] as unknown as UpdateHandler)(oldValue, newValue);\n }\n }\n }\n });\n\n update.call(this, changedProps);\n };\n };\n}\n"],"mappings":";AA6BO,SAAS,MAAM,cAAiC,SAAwB;AAC7E,QAAM,kBAA0C;AAAA,IAC9C,sBAAsB;AAAA,IACtB,GAAG;AAAA,EACL;AACA,SAAO,CACL,OACA,oBACG;AAEH,UAAM,EAAE,OAAO,IAAI;AACnB,UAAM,oBAAoB,MAAM,QAAQ,YAAY,IAAI,eAAe,CAAC,YAAY;AAGpF,UAAM,SAAS,SAA2B,cAAgE;AACxG,wBAAkB,QAAQ,cAAY;AACpC,cAAM,MAAM;AACZ,YAAI,aAAa,IAAI,GAAG,GAAG;AACzB,gBAAM,WAAW,aAAa,IAAI,GAAG;AACrC,gBAAM,WAAW,KAAK,GAAG;AAEzB,cAAI,aAAa,UAAU;AACzB,gBAAI,CAAC,gBAAgB,wBAAwB,KAAK,YAAY;AAC5D,cAAC,KAAK,eAAe,EAA+B,UAAU,QAAQ;AAAA,YACxE;AAAA,UACF;AAAA,QACF;AAAA,MACF,CAAC;AAED,aAAO,KAAK,MAAM,YAAY;AAAA,IAChC;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-EW5CTHAD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-4O5F7WV7.js";
|
|
5
|
+
import {
|
|
6
|
+
TestComponent
|
|
7
|
+
} from "./chunk-LKINC6JO.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-6YE2KJ4C.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-prev.ts
|
|
13
|
+
import { css, html } from "lit";
|
|
14
|
+
import { customElement } from "lit/decorators.js";
|
|
15
|
+
var TestPrev = 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 === -1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return html`<slot></slot>`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
TestPrev.styles = css`
|
|
36
|
+
:host {
|
|
37
|
+
${btn};
|
|
38
|
+
}
|
|
39
|
+
:host([disabled]) {
|
|
40
|
+
${dis};
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
TestPrev = __decorateClass([
|
|
44
|
+
customElement("test-prev")
|
|
45
|
+
], TestPrev);
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
TestPrev
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-HWA4A3SR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-prev.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n/**\n * Represents a custom element for navigating to the previous test item.\n *\n * @remarks\n * This element provides functionality for navigating to the previous test item.\n *\n * @example\n * ```html\n * <test-prev></test-prev>\n * ```\n */\n@customElement('test-prev')\nexport class TestPrev extends 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 === -1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-previous': TestPrev;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,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,cAAc,KAAK,KAAK,cAAc;AAAA,IACvF;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-IKZWK2C5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-IP7JSYO6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import {
|
|
2
|
+
item_default
|
|
3
|
+
} from "./chunk-Y6UWSECL.js";
|
|
4
|
+
import {
|
|
5
|
+
watch
|
|
6
|
+
} from "./chunk-ELDMXTUQ.js";
|
|
7
|
+
import {
|
|
8
|
+
qtiTransformTest
|
|
9
|
+
} from "./chunk-XDMSEAYC.js";
|
|
10
|
+
import {
|
|
11
|
+
__decorateClass
|
|
12
|
+
} from "./chunk-6YE2KJ4C.js";
|
|
13
|
+
|
|
14
|
+
// src/lib/qti-test/components/test-container.ts
|
|
15
|
+
import { LitElement, html } from "lit";
|
|
16
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
17
|
+
import { until } from "lit/directives/until.js";
|
|
18
|
+
var TestContainer = class extends LitElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.testURL = null;
|
|
22
|
+
this.testDoc = null;
|
|
23
|
+
this.testXML = null;
|
|
24
|
+
/** Template content if provided */
|
|
25
|
+
this.templateContent = null;
|
|
26
|
+
}
|
|
27
|
+
async handleTestURLChange() {
|
|
28
|
+
if (!this.testURL) return;
|
|
29
|
+
try {
|
|
30
|
+
const api = await qtiTransformTest().load(this.testURL);
|
|
31
|
+
this.testDoc = api.htmlDoc();
|
|
32
|
+
} catch (error) {
|
|
33
|
+
console.error("Error loading or parsing XML:", error);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
handleTestXMLChange() {
|
|
37
|
+
if (!this.testXML) return;
|
|
38
|
+
try {
|
|
39
|
+
this.testDoc = qtiTransformTest().parse(this.testXML).htmlDoc();
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error("Error parsing XML:", error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async connectedCallback() {
|
|
45
|
+
super.connectedCallback();
|
|
46
|
+
this.initializeTemplateContent();
|
|
47
|
+
this.applyStyles();
|
|
48
|
+
if (this.testURL) {
|
|
49
|
+
this.handleTestURLChange();
|
|
50
|
+
}
|
|
51
|
+
if (this.testXML) {
|
|
52
|
+
this.handleTestXMLChange();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
initializeTemplateContent() {
|
|
56
|
+
const template = this.querySelector("template");
|
|
57
|
+
this.templateContent = template ? template.content : html``;
|
|
58
|
+
}
|
|
59
|
+
applyStyles() {
|
|
60
|
+
const sheet = new CSSStyleSheet();
|
|
61
|
+
sheet.replaceSync(item_default);
|
|
62
|
+
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
return html`
|
|
66
|
+
${this.templateContent}
|
|
67
|
+
<slot></slot>
|
|
68
|
+
${until(this.testDoc, html`<span>Loading...</span>`)}
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
__decorateClass([
|
|
73
|
+
property({ type: String, attribute: "test-url" })
|
|
74
|
+
], TestContainer.prototype, "testURL", 2);
|
|
75
|
+
__decorateClass([
|
|
76
|
+
state()
|
|
77
|
+
], TestContainer.prototype, "testDoc", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
state()
|
|
80
|
+
], TestContainer.prototype, "testXML", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
watch("testURL", { waitUntilFirstUpdate: true })
|
|
83
|
+
], TestContainer.prototype, "handleTestURLChange", 1);
|
|
84
|
+
__decorateClass([
|
|
85
|
+
watch("testXML", { waitUntilFirstUpdate: true })
|
|
86
|
+
], TestContainer.prototype, "handleTestXMLChange", 1);
|
|
87
|
+
TestContainer = __decorateClass([
|
|
88
|
+
customElement("test-container")
|
|
89
|
+
], TestContainer);
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
TestContainer
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=chunk-JE6BMXZU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-container.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\nimport { watch } from '../../decorators/watch';\nimport itemCss from '../../../item.css?inline';\nimport { qtiTransformTest } from '../../qti-transformers';\n\n/**\n * `<test-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-test` will be placed inside the shadow DOM of this element.\n * The element loads the test from the provided URL and renders it inside the shadow DOM.\n *\n * ```html\n * <qti-test>\n * <test-container class=\"m-4 bg-white\" test-url=\"./path/to/assessmenttest.xml\"></test-container>\n * </qti-test>\n * ```\n */\n@customElement('test-container')\nexport class TestContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'test-url' })\n testURL: string = null;\n\n /** A parsed HTML document */\n @state()\n testDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n testXML: string = null;\n\n /** Template content if provided */\n private templateContent = null;\n\n @watch('testURL', { waitUntilFirstUpdate: true })\n protected async handleTestURLChange() {\n if (!this.testURL) return;\n try {\n const api = await qtiTransformTest().load(this.testURL);\n this.testDoc = api.htmlDoc();\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('testXML', { waitUntilFirstUpdate: true })\n protected handleTestXMLChange() {\n if (!this.testXML) return;\n try {\n this.testDoc = qtiTransformTest().parse(this.testXML).htmlDoc();\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.initializeTemplateContent();\n this.applyStyles();\n if (this.testURL) {\n this.handleTestURLChange();\n }\n if (this.testXML) {\n this.handleTestXMLChange();\n }\n }\n\n private initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.templateContent = template ? template.content : html``;\n }\n\n private applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n render() {\n return html`\n ${this.templateContent}\n <slot></slot>\n ${until(this.testDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-container': TestContainer;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,YAAY,YAAY;AACjC,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,aAAa;AAiBf,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC;AAAA;AAGL,mBAAkB;AAIlB,mBAA4B;AAI5B,mBAAkB;AAGlB;AAAA,SAAQ,kBAAkB;AAAA;AAAA,EAG1B,MAAgB,sBAAsB;AACpC,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,YAAM,MAAM,MAAM,iBAAiB,EAAE,KAAK,KAAK,OAAO;AACtD,WAAK,UAAU,IAAI,QAAQ;AAAA,IAC7B,SAAS,OAAO;AACd,cAAQ,MAAM,iCAAiC,KAAK;AAAA,IACtD;AAAA,EACF;AAAA,EAGU,sBAAsB;AAC9B,QAAI,CAAC,KAAK,QAAS;AACnB,QAAI;AACF,WAAK,UAAU,iBAAiB,EAAE,MAAM,KAAK,OAAO,EAAE,QAAQ;AAAA,IAChE,SAAS,OAAO;AACd,cAAQ,MAAM,sBAAsB,KAAK;AAAA,IAC3C;AAAA,EACF;AAAA,EAEA,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,SAAK,0BAA0B;AAC/B,SAAK,YAAY;AACjB,QAAI,KAAK,SAAS;AAChB,WAAK,oBAAoB;AAAA,IAC3B;AACA,QAAI,KAAK,SAAS;AAChB,WAAK,oBAAoB;AAAA,IAC3B;AAAA,EACF;AAAA,EAEQ,4BAA4B;AAClC,UAAM,WAAW,KAAK,cAAc,UAAU;AAC9C,SAAK,kBAAkB,WAAW,SAAS,UAAU;AAAA,EACvD;AAAA,EAEQ,cAAc;AACpB,UAAM,QAAQ,IAAI,cAAc;AAChC,UAAM,YAAY,YAAO;AACzB,SAAK,WAAW,qBAAqB,CAAC,KAAK;AAAA,EAC7C;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,QACH,KAAK,eAAe;AAAA;AAAA,QAEpB,MAAM,KAAK,SAAS,6BAA6B,CAAC;AAAA;AAAA,EAExD;AACF;AAhEE;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,WAAW,CAAC;AAAA,GAFtC,cAGX;AAIA;AAAA,EADC,MAAM;AAAA,GANI,cAOX;AAIA;AAAA,EADC,MAAM;AAAA,GAVI,cAWX;AAMgB;AAAA,EADf,MAAM,WAAW,EAAE,sBAAsB,KAAK,CAAC;AAAA,GAhBrC,cAiBK;AAWN;AAAA,EADT,MAAM,WAAW,EAAE,sBAAsB,KAAK,CAAC;AAAA,GA3BrC,cA4BD;AA5BC,gBAAN;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__decorateClass
|
|
3
|
+
} from "./chunk-6YE2KJ4C.js";
|
|
4
|
+
|
|
5
|
+
// src/lib/qti-item/qti-item.ts
|
|
6
|
+
import { html, LitElement } from "lit";
|
|
7
|
+
import { customElement } from "lit/decorators.js";
|
|
8
|
+
var QtiItem = class extends LitElement {
|
|
9
|
+
render() {
|
|
10
|
+
return html`<slot></slot>`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
QtiItem = __decorateClass([
|
|
14
|
+
customElement("qti-item")
|
|
15
|
+
], QtiItem);
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
QtiItem
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=chunk-JSPJGWGT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-item/qti-item.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\n/**\n * `<qti-item>` is a custom element designed for rendering a single `qti-assessment-item`.\n * It can also host some functionalities to interact with the item like scoring, showing feedback, etc.\n * Placing a mandatory `<item-container>` inside '<qti-item>' will load or parse the item and render it.\n * See `<item-container>` for more details.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n@customElement('qti-item')\nexport class QtiItem extends LitElement {\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n"],"mappings":";;;;;AAAA,SAAS,MAAM,kBAAkB;AACjC,SAAS,qBAAqB;AAevB,IAAM,UAAN,cAAsB,WAAW;AAAA,EACtC,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAJa,UAAN;AAAA,EADN,cAAc,UAAU;AAAA,GACZ;","names":[]}
|