@citolab/qti-components 7.0.4 → 7.0.6-beta.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-22HAPLRD.js +0 -0
- package/cdn/chunk-4DFVJE2A.js +48 -0
- package/cdn/chunk-4I75QSIL.js +8 -0
- package/cdn/chunk-5WCOPF7O.js +73 -0
- package/cdn/chunk-A536ZOJJ.js +43 -0
- package/cdn/chunk-BLKKKK6C.js +11 -0
- package/cdn/chunk-DC2R556M.js +5 -0
- package/cdn/chunk-GALSGMIP.js +5 -0
- package/cdn/chunk-IXSX4SJX.js +1 -0
- package/cdn/chunk-KYOTSBCX.js +1 -0
- package/cdn/chunk-L4TDHAKL.js +24 -0
- package/cdn/chunk-LVW3MHTI.js +23 -0
- package/cdn/chunk-M6AATWPS.js +59 -0
- package/cdn/chunk-MFWSHIPH.js +17 -0
- package/cdn/chunk-QGKK4T2J.js +8 -0
- package/cdn/chunk-ROXN2HIJ.js +8 -0
- package/cdn/chunk-SQDSHH6N.js +3539 -0
- package/cdn/chunk-T4A5AZCI.js +939 -0
- package/cdn/chunk-VI2WKTN4.js +1 -0
- package/cdn/index.global.js +36 -36
- 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/core/index.global.js +149 -0
- package/cdn/qti-item/core/index.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 +207 -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-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.css +1 -0
- package/cdn/qti-test/components/test-next.spec.global.js +64 -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/core/index.global.js +205 -0
- package/cdn/qti-test/core/index.js +1 -0
- package/cdn/qti-transformers/index.global.js +1 -0
- package/cdn/qti-transformers/index.js +1 -0
- package/dist/chunk-2CHF3TMY.js +3529 -0
- package/dist/chunk-2CHF3TMY.js.map +1 -0
- package/dist/{transformers/index.js → chunk-2OA7E3E7.js} +2 -1
- package/dist/chunk-2OA7E3E7.js.map +1 -0
- package/dist/chunk-3TFUBCJW.js +72 -0
- package/dist/chunk-3TFUBCJW.js.map +1 -0
- package/dist/chunk-44VE5POH.js +55 -0
- package/dist/chunk-44VE5POH.js.map +1 -0
- package/dist/chunk-4FH7P7YI.js +43 -0
- package/dist/chunk-4FH7P7YI.js.map +1 -0
- package/dist/chunk-4YG2FPKK.js +31 -0
- package/dist/chunk-4YG2FPKK.js.map +1 -0
- package/dist/chunk-6SG3NMKU.js +50 -0
- package/dist/chunk-6SG3NMKU.js.map +1 -0
- package/dist/chunk-ANLIJZBL.js +118 -0
- package/dist/chunk-ANLIJZBL.js.map +1 -0
- package/dist/chunk-CNQYM52B.js +569 -0
- package/dist/chunk-CNQYM52B.js.map +1 -0
- package/dist/chunk-F3NTI6TX.js +10 -0
- package/dist/chunk-F3NTI6TX.js.map +1 -0
- package/dist/chunk-F7HTXGGH.js +78 -0
- package/dist/chunk-F7HTXGGH.js.map +1 -0
- package/dist/chunk-MAC76UNI.js +1 -0
- package/dist/chunk-MAC76UNI.js.map +1 -0
- package/dist/chunk-OO6JSYLP.js +50 -0
- package/dist/chunk-OO6JSYLP.js.map +1 -0
- package/dist/chunk-QYN5S4EM.js +107 -0
- package/dist/chunk-QYN5S4EM.js.map +1 -0
- package/dist/chunk-UB5K44DB.js +30 -0
- package/dist/chunk-UB5K44DB.js.map +1 -0
- package/dist/chunk-UBZPSVSE.js +6301 -0
- package/dist/chunk-UBZPSVSE.js.map +1 -0
- package/dist/index.d.ts +13 -503
- package/dist/index.js +132 -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 +188 -0
- package/dist/qti-components/index.js.map +1 -0
- package/dist/qti-components-jsx.d.ts +147 -201
- package/dist/qti-item/core/index.d.ts +61 -0
- package/dist/qti-item/core/index.js +13 -0
- package/dist/qti-item/core/index.js.map +1 -0
- package/dist/{loader → qti-loader}/index.d.ts +1 -1
- package/dist/qti-loader/index.js +29 -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 +11 -0
- package/dist/qti-test/components/index.js +32 -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 +22 -0
- package/dist/qti-test/components/test-component.abstract.js +10 -0
- package/dist/qti-test/components/test-component.abstract.js.map +1 -0
- package/dist/qti-test/components/test-item-link.d.ts +20 -0
- package/dist/qti-test/components/test-item-link.js +12 -0
- package/dist/qti-test/components/test-item-link.js.map +1 -0
- package/dist/qti-test/components/test-next.d.ts +31 -0
- package/dist/qti-test/components/test-next.js +12 -0
- package/dist/qti-test/components/test-next.js.map +1 -0
- package/dist/qti-test/components/test-next.spec.css +2481 -0
- package/dist/qti-test/components/test-next.spec.css.map +1 -0
- package/dist/qti-test/components/test-next.spec.d.ts +13 -0
- package/dist/qti-test/components/test-next.spec.js +45904 -0
- package/dist/qti-test/components/test-next.spec.js.map +1 -0
- package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +21 -0
- package/dist/qti-test/components/test-paging-buttons-stamp.js +11 -0
- package/dist/qti-test/components/test-paging-buttons-stamp.js.map +1 -0
- package/dist/qti-test/components/test-prev.d.ts +31 -0
- package/dist/qti-test/components/test-prev.js +12 -0
- package/dist/qti-test/components/test-prev.js.map +1 -0
- package/dist/qti-test/components/test-view.d.ts +26 -0
- package/dist/qti-test/components/test-view.js +11 -0
- package/dist/qti-test/components/test-view.js.map +1 -0
- package/dist/qti-test/core/index.d.ts +121 -0
- package/dist/qti-test/core/index.js +27 -0
- package/dist/qti-test/core/index.js.map +1 -0
- package/dist/qti-transformers/index.js +12 -0
- package/dist/qti-transformers/index.js.map +1 -0
- package/dist/test.context-DbSTxKk_.d.ts +99 -0
- package/dist/vscode.html-custom-data.json +53 -42
- package/package.json +100 -111
- 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,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
testContext,
|
|
3
|
+
testElement
|
|
4
|
+
} from "./chunk-F3NTI6TX.js";
|
|
5
|
+
import {
|
|
6
|
+
watch
|
|
7
|
+
} from "./chunk-4YG2FPKK.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-44VE5POH.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-component.abstract.ts
|
|
13
|
+
import { consume } from "@lit/context";
|
|
14
|
+
import { LitElement } from "lit";
|
|
15
|
+
import { state } from "lit/decorators.js";
|
|
16
|
+
|
|
17
|
+
// src/lib/decorators/prop-internal-state.ts
|
|
18
|
+
import { property } from "lit/decorators.js";
|
|
19
|
+
function propInternalState(options) {
|
|
20
|
+
return (protoOrDescriptor, name) => {
|
|
21
|
+
property(options)(protoOrDescriptor, name);
|
|
22
|
+
const key = `__${name}`;
|
|
23
|
+
Object.defineProperty(protoOrDescriptor, name, {
|
|
24
|
+
get() {
|
|
25
|
+
return this[key];
|
|
26
|
+
},
|
|
27
|
+
set(value) {
|
|
28
|
+
const oldValue = this[key];
|
|
29
|
+
this[key] = value;
|
|
30
|
+
if (oldValue !== value) {
|
|
31
|
+
if (this._internals?.states) {
|
|
32
|
+
const stateName = name.toLowerCase();
|
|
33
|
+
if (value) {
|
|
34
|
+
this._internals.states.add(`--${stateName}`);
|
|
35
|
+
} else {
|
|
36
|
+
this._internals.states.delete(`--${stateName}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (options.aria && this._internals) {
|
|
40
|
+
const ariaAttribute = options.aria;
|
|
41
|
+
if (value) {
|
|
42
|
+
this._internals[ariaAttribute] = "true";
|
|
43
|
+
} else {
|
|
44
|
+
this._internals[ariaAttribute] = null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
this.requestUpdate(name, oldValue);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
configurable: true,
|
|
51
|
+
enumerable: true
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/lib/qti-test/components/test-component.abstract.ts
|
|
57
|
+
var TestComponent = class extends LitElement {
|
|
58
|
+
constructor() {
|
|
59
|
+
super();
|
|
60
|
+
this.disabled = true;
|
|
61
|
+
this._internals = this.attachInternals();
|
|
62
|
+
}
|
|
63
|
+
_handleTestElementChange(_oldValue, newValue) {
|
|
64
|
+
if (newValue.el) {
|
|
65
|
+
this.disabled = false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
willUpdate(changedProperties) {
|
|
69
|
+
if (changedProperties.has("_testContext")) {
|
|
70
|
+
const { items = [], navItemId } = this._testContext ?? {};
|
|
71
|
+
this.itemIndex = items.findIndex((item) => item.identifier === navItemId);
|
|
72
|
+
this.items = items;
|
|
73
|
+
this.view = this._testContext?.view;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
_switchView(view) {
|
|
77
|
+
this.dispatchEvent(
|
|
78
|
+
new CustomEvent("on-test-switch-view", {
|
|
79
|
+
composed: true,
|
|
80
|
+
bubbles: true,
|
|
81
|
+
detail: view
|
|
82
|
+
})
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
_requestItem(identifier) {
|
|
86
|
+
this.dispatchEvent(
|
|
87
|
+
new CustomEvent("qti-request-test-item", {
|
|
88
|
+
composed: true,
|
|
89
|
+
bubbles: true,
|
|
90
|
+
detail: identifier
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
__decorateClass([
|
|
96
|
+
propInternalState({
|
|
97
|
+
type: Boolean,
|
|
98
|
+
reflect: true,
|
|
99
|
+
aria: "ariaDisabled"
|
|
100
|
+
// Maps to `aria-disabled` attribute
|
|
101
|
+
})
|
|
102
|
+
], TestComponent.prototype, "disabled", 2);
|
|
103
|
+
__decorateClass([
|
|
104
|
+
state(),
|
|
105
|
+
consume({ context: testContext, subscribe: true })
|
|
106
|
+
], TestComponent.prototype, "_testContext", 2);
|
|
107
|
+
__decorateClass([
|
|
108
|
+
state(),
|
|
109
|
+
consume({ context: testElement, subscribe: true })
|
|
110
|
+
], TestComponent.prototype, "_testElement", 2);
|
|
111
|
+
__decorateClass([
|
|
112
|
+
watch("_testElement")
|
|
113
|
+
], TestComponent.prototype, "_handleTestElementChange", 1);
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
TestComponent
|
|
117
|
+
};
|
|
118
|
+
//# sourceMappingURL=chunk-ANLIJZBL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/qti-test/components/test-component.abstract.ts","../src/lib/decorators/prop-internal-state.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { propInternalState } from '../../decorators';\nimport { testContext, testElement, TestElement, TestContext } from '../core/context';\nimport { watch } from '../../decorators/watch';\n\nexport abstract class TestComponent extends LitElement {\n @propInternalState({\n type: Boolean,\n reflect: true,\n aria: 'ariaDisabled' // Maps to `aria-disabled` attribute\n })\n public disabled = true;\n\n @state()\n @consume({ context: testContext, subscribe: true })\n protected _testContext?: TestContext;\n\n @state()\n @consume({ context: testElement, subscribe: true })\n protected _testElement?: TestElement;\n @watch('_testElement')\n _handleTestElementChange(_oldValue: TestElement, newValue: TestElement) {\n if (newValue.el) {\n this.disabled = false;\n }\n }\n\n protected _internals: ElementInternals;\n\n protected items;\n protected itemIndex;\n protected view;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n protected willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n if (changedProperties.has('_testContext')) {\n const { items = [], navItemId } = this._testContext ?? {};\n this.itemIndex = items.findIndex(item => item.identifier === navItemId);\n this.items = items;\n this.view = this._testContext?.view;\n }\n }\n\n protected _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\n );\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n}\n","import { ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { PropertyDeclaration } from 'lit';\n\n// Extended decorator options\ninterface InternalStateOptions extends PropertyDeclaration {\n aria?: string; // Corresponding ARIA attribute, e.g., 'aria-disabled'\n}\n\nexport function propInternalState(options: InternalStateOptions) {\n return (protoOrDescriptor: any, name: string) => {\n // Apply the default Lit `@property` decorator\n property(options)(protoOrDescriptor, name);\n\n // Intercept the property descriptor to enhance functionality\n const key = `__${name}`; // Internal backing field\n\n Object.defineProperty(protoOrDescriptor, name, {\n get() {\n return this[key];\n },\n set(value: any) {\n const oldValue = this[key];\n this[key] = value;\n\n // Trigger updates if value changes\n if (oldValue !== value) {\n // Update internals state\n if (this._internals?.states) {\n const stateName = name.toLowerCase();\n if (value) {\n this._internals.states.add(`--${stateName}`);\n } else {\n this._internals.states.delete(`--${stateName}`);\n }\n }\n\n // Update ARIA attributes if specified\n if (options.aria && this._internals) {\n const ariaAttribute = options.aria;\n if (value) {\n this._internals[ariaAttribute] = 'true';\n } else {\n this._internals[ariaAttribute] = null;\n }\n }\n\n // Request an update\n (this as ReactiveElement).requestUpdate(name, oldValue);\n }\n },\n configurable: true,\n enumerable: true\n });\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,aAAa;;;ACDtB,SAAS,gBAAgB;AAQlB,SAAS,kBAAkB,SAA+B;AAC/D,SAAO,CAAC,mBAAwB,SAAiB;AAE/C,aAAS,OAAO,EAAE,mBAAmB,IAAI;AAGzC,UAAM,MAAM,KAAK,IAAI;AAErB,WAAO,eAAe,mBAAmB,MAAM;AAAA,MAC7C,MAAM;AACJ,eAAO,KAAK,GAAG;AAAA,MACjB;AAAA,MACA,IAAI,OAAY;AACd,cAAM,WAAW,KAAK,GAAG;AACzB,aAAK,GAAG,IAAI;AAGZ,YAAI,aAAa,OAAO;AAEtB,cAAI,KAAK,YAAY,QAAQ;AAC3B,kBAAM,YAAY,KAAK,YAAY;AACnC,gBAAI,OAAO;AACT,mBAAK,WAAW,OAAO,IAAI,KAAK,SAAS,EAAE;AAAA,YAC7C,OAAO;AACL,mBAAK,WAAW,OAAO,OAAO,KAAK,SAAS,EAAE;AAAA,YAChD;AAAA,UACF;AAGA,cAAI,QAAQ,QAAQ,KAAK,YAAY;AACnC,kBAAM,gBAAgB,QAAQ;AAC9B,gBAAI,OAAO;AACT,mBAAK,WAAW,aAAa,IAAI;AAAA,YACnC,OAAO;AACL,mBAAK,WAAW,aAAa,IAAI;AAAA,YACnC;AAAA,UACF;AAGA,UAAC,KAAyB,cAAc,MAAM,QAAQ;AAAA,QACxD;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MACd,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACF;;;ADhDO,IAAe,gBAAf,cAAqC,WAAW;AAAA,EA4BrD,cAAc;AACZ,UAAM;AAvBR,SAAO,WAAW;AAwBhB,SAAK,aAAa,KAAK,gBAAgB;AAAA,EACzC;AAAA,EAfA,yBAAyB,WAAwB,UAAuB;AACtE,QAAI,SAAS,IAAI;AACf,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAaU,WAAW,mBAA2D;AAC9E,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,YAAM,EAAE,QAAQ,CAAC,GAAG,UAAU,IAAI,KAAK,gBAAgB,CAAC;AACxD,WAAK,YAAY,MAAM,UAAU,UAAQ,KAAK,eAAe,SAAS;AACtE,WAAK,QAAQ;AACb,WAAK,OAAO,KAAK,cAAc;AAAA,IACjC;AAAA,EACF;AAAA,EAEU,YAAY,MAAc;AAClC,SAAK;AAAA,MACH,IAAI,YAAY,uBAAuB;AAAA,QACrC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAvDS;AAAA,EALN,kBAAkB;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA;AAAA,EACR,CAAC;AAAA,GALmB,cAMb;AAIG;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAT9B,cAUV;AAIA;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAb9B,cAcV;AAEV;AAAA,EADC,MAAM,cAAc;AAAA,GAfD,cAgBpB;","names":[]}
|
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
import {
|
|
2
|
+
item_default
|
|
3
|
+
} from "./chunk-2CHF3TMY.js";
|
|
4
|
+
import {
|
|
5
|
+
qtiTransformItem,
|
|
6
|
+
qtiTransformTest
|
|
7
|
+
} from "./chunk-2OA7E3E7.js";
|
|
8
|
+
import {
|
|
9
|
+
testContext,
|
|
10
|
+
testElement
|
|
11
|
+
} from "./chunk-F3NTI6TX.js";
|
|
12
|
+
import {
|
|
13
|
+
watch
|
|
14
|
+
} from "./chunk-4YG2FPKK.js";
|
|
15
|
+
import {
|
|
16
|
+
__decorateClass
|
|
17
|
+
} from "./chunk-44VE5POH.js";
|
|
18
|
+
|
|
19
|
+
// src/lib/qti-test/core/components/test-container.ts
|
|
20
|
+
import { LitElement, html } from "lit";
|
|
21
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
22
|
+
import { until } from "lit/directives/until.js";
|
|
23
|
+
var TestContainer = class extends LitElement {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments);
|
|
26
|
+
this.testURL = null;
|
|
27
|
+
this.testDoc = null;
|
|
28
|
+
this.testXML = null;
|
|
29
|
+
/** Template content if provided */
|
|
30
|
+
this.templateContent = null;
|
|
31
|
+
}
|
|
32
|
+
async handleTestURLChange() {
|
|
33
|
+
if (!this.testURL) return;
|
|
34
|
+
try {
|
|
35
|
+
const api = await qtiTransformTest().load(this.testURL);
|
|
36
|
+
this.testDoc = api.htmlDoc();
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error("Error loading or parsing XML:", error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handleTestXMLChange() {
|
|
42
|
+
if (!this.testXML) return;
|
|
43
|
+
try {
|
|
44
|
+
this.testDoc = qtiTransformTest().parse(this.testXML).htmlDoc();
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error("Error parsing XML:", error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async connectedCallback() {
|
|
50
|
+
super.connectedCallback();
|
|
51
|
+
this.initializeTemplateContent();
|
|
52
|
+
this.applyStyles();
|
|
53
|
+
if (this.testURL) {
|
|
54
|
+
this.handleTestURLChange();
|
|
55
|
+
}
|
|
56
|
+
if (this.testXML) {
|
|
57
|
+
this.handleTestXMLChange();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
initializeTemplateContent() {
|
|
61
|
+
const template = this.querySelector("template");
|
|
62
|
+
this.templateContent = template ? template.content : html``;
|
|
63
|
+
}
|
|
64
|
+
applyStyles() {
|
|
65
|
+
const sheet = new CSSStyleSheet();
|
|
66
|
+
sheet.replaceSync(item_default);
|
|
67
|
+
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return html`
|
|
71
|
+
${this.templateContent}
|
|
72
|
+
<slot></slot>
|
|
73
|
+
${until(this.testDoc, html`<span>Loading...</span>`)}
|
|
74
|
+
`;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
__decorateClass([
|
|
78
|
+
property({ type: String, attribute: "test-url" })
|
|
79
|
+
], TestContainer.prototype, "testURL", 2);
|
|
80
|
+
__decorateClass([
|
|
81
|
+
state()
|
|
82
|
+
], TestContainer.prototype, "testDoc", 2);
|
|
83
|
+
__decorateClass([
|
|
84
|
+
state()
|
|
85
|
+
], TestContainer.prototype, "testXML", 2);
|
|
86
|
+
__decorateClass([
|
|
87
|
+
watch("testURL", { waitUntilFirstUpdate: true })
|
|
88
|
+
], TestContainer.prototype, "handleTestURLChange", 1);
|
|
89
|
+
__decorateClass([
|
|
90
|
+
watch("testXML", { waitUntilFirstUpdate: true })
|
|
91
|
+
], TestContainer.prototype, "handleTestXMLChange", 1);
|
|
92
|
+
TestContainer = __decorateClass([
|
|
93
|
+
customElement("test-container")
|
|
94
|
+
], TestContainer);
|
|
95
|
+
|
|
96
|
+
// src/lib/qti-test/core/qti-test.ts
|
|
97
|
+
import { html as html2 } from "lit";
|
|
98
|
+
import { customElement as customElement2 } from "lit/decorators.js";
|
|
99
|
+
|
|
100
|
+
// src/lib/qti-test/core/mixins/test-loader.mixin.ts
|
|
101
|
+
var TestLoaderMixin = (superClass) => {
|
|
102
|
+
class TestLoaderClass extends superClass {
|
|
103
|
+
// private testURL = '';
|
|
104
|
+
constructor(...args) {
|
|
105
|
+
super(...args);
|
|
106
|
+
this.addEventListener("qti-assessment-test-connected", () => {
|
|
107
|
+
});
|
|
108
|
+
this.addEventListener("qti-load-item-request", ({ detail }) => {
|
|
109
|
+
detail.promise = (async () => {
|
|
110
|
+
const api = await qtiTransformItem().load(
|
|
111
|
+
`${detail.href}`,
|
|
112
|
+
detail.cancelPreviousRequest
|
|
113
|
+
);
|
|
114
|
+
return api.htmlDoc();
|
|
115
|
+
})();
|
|
116
|
+
});
|
|
117
|
+
this.addEventListener("qti-interaction-changed", (_e) => {
|
|
118
|
+
});
|
|
119
|
+
this.addEventListener("qti-outcome-changed", () => {
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return TestLoaderClass;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// src/lib/qti-test/core/mixins/test-navigation.mixin.ts
|
|
127
|
+
var TestNavigationMixin = (superClass) => {
|
|
128
|
+
class TestNavigationClass extends superClass {
|
|
129
|
+
constructor(...args) {
|
|
130
|
+
super(...args);
|
|
131
|
+
this.addEventListener("qti-request-test-item", ({ detail: navItemId }) => {
|
|
132
|
+
if (!navItemId) return;
|
|
133
|
+
this._clearLoadedItems();
|
|
134
|
+
const itemRefEl = this.testElement.el.querySelector(
|
|
135
|
+
`qti-assessment-item-ref[identifier="${navItemId}"]`
|
|
136
|
+
);
|
|
137
|
+
const promise = this._loadItemRequest(itemRefEl.href, false);
|
|
138
|
+
const navPartId = itemRefEl.closest("qti-test-part").identifier;
|
|
139
|
+
const navSectionId = itemRefEl.closest("qti-assessment-section").identifier;
|
|
140
|
+
this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId, navItemLoading: true };
|
|
141
|
+
if (promise) {
|
|
142
|
+
promise.then((doc) => {
|
|
143
|
+
itemRefEl.xmlDoc = doc;
|
|
144
|
+
requestAnimationFrame(
|
|
145
|
+
() => this.dispatchEvent(new CustomEvent("qti-item-connected", { bubbles: true, composed: true }))
|
|
146
|
+
);
|
|
147
|
+
this._testContext = { ...this._testContext, navItemLoading: false };
|
|
148
|
+
}).catch((error) => console.error("Failed to load item:", error));
|
|
149
|
+
} else {
|
|
150
|
+
console.info("Load item request was not handled:", itemRefEl.href);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
this.addEventListener("qti-assessment-test-connected", () => {
|
|
154
|
+
let navItemId = this._testContext.navItemId;
|
|
155
|
+
if (!navItemId) {
|
|
156
|
+
const itemRefEl = this.testElement.el.querySelector("qti-assessment-item-ref");
|
|
157
|
+
navItemId = itemRefEl.identifier;
|
|
158
|
+
}
|
|
159
|
+
this.dispatchEvent(
|
|
160
|
+
new CustomEvent("qti-request-test-item", { detail: navItemId, bubbles: true, composed: true })
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
_clearLoadedItems() {
|
|
165
|
+
const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);
|
|
166
|
+
Array.from(itemRefEls).forEach((itemElement) => {
|
|
167
|
+
itemElement.xmlDoc = null;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
_loadItemRequest(href, cancelPreviousRequest = true) {
|
|
171
|
+
const event = new CustomEvent("qti-load-item-request", {
|
|
172
|
+
bubbles: true,
|
|
173
|
+
composed: true,
|
|
174
|
+
detail: {
|
|
175
|
+
href,
|
|
176
|
+
promise: null,
|
|
177
|
+
cancelPreviousRequest
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
this.dispatchEvent(event);
|
|
181
|
+
return event.detail.promise;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return TestNavigationClass;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// src/lib/qti-test/core/mixins/test-view.mixin.ts
|
|
188
|
+
var TestViewMixin = (superClass) => {
|
|
189
|
+
class TestViewClass extends superClass {
|
|
190
|
+
constructor(...args) {
|
|
191
|
+
super(...args);
|
|
192
|
+
this._testContext = { ...this._testContext, view: "candidate" };
|
|
193
|
+
this.addEventListener("on-test-switch-view", (e) => {
|
|
194
|
+
this._testContext = { ...this._testContext, view: e.detail };
|
|
195
|
+
this._updateElementView();
|
|
196
|
+
});
|
|
197
|
+
this.addEventListener("qti-assessment-test-connected", () => {
|
|
198
|
+
this._updateElementView();
|
|
199
|
+
});
|
|
200
|
+
this.addEventListener("qti-assessment-item-connected", (e) => {
|
|
201
|
+
this._updateElementView();
|
|
202
|
+
this._setCorrectResponseVisibility(e.detail);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
willUpdate(changedProperties) {
|
|
206
|
+
super.willUpdate(changedProperties);
|
|
207
|
+
if (changedProperties.has("_testContext")) {
|
|
208
|
+
this._updateElementView();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// Method to handle view updates for elements based on the current context view
|
|
212
|
+
_updateElementView() {
|
|
213
|
+
if (this.testElement && this.testElement.el) {
|
|
214
|
+
const viewElements = Array.from(this.testElement.el.querySelectorAll("[view]"));
|
|
215
|
+
viewElements.forEach((element) => {
|
|
216
|
+
element.classList.toggle("show", element.getAttribute("view") === this._testContext.view);
|
|
217
|
+
});
|
|
218
|
+
const assessmentItem = this.testElement.el.querySelector(
|
|
219
|
+
`qti-assessment-item[identifier="${this._testContext.navItemId}"]`
|
|
220
|
+
);
|
|
221
|
+
if (assessmentItem) {
|
|
222
|
+
assessmentItem.showCorrectResponse(this._testContext.view === "scorer");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// Event handler for connected QTI assessment items
|
|
227
|
+
_setCorrectResponseVisibility(assessmentItem) {
|
|
228
|
+
assessmentItem.showCorrectResponse(this._testContext.view === "scorer");
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return TestViewClass;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// src/lib/qti-test/core/test-base.ts
|
|
235
|
+
import { provide } from "@lit/context";
|
|
236
|
+
import { LitElement as LitElement2 } from "lit";
|
|
237
|
+
import { state as state2 } from "lit/decorators.js";
|
|
238
|
+
var TestBase = class extends LitElement2 {
|
|
239
|
+
constructor() {
|
|
240
|
+
super();
|
|
241
|
+
this._testContext = { items: [], testOutcomeVariables: [] };
|
|
242
|
+
this.testElement = { el: null };
|
|
243
|
+
/**
|
|
244
|
+
* Updates the variables of an assessment item in the test context.
|
|
245
|
+
* - Matches the assessment item with the corresponding test context item.
|
|
246
|
+
* - If the item is not found, logs a warning.
|
|
247
|
+
* - Updates variables in the test context if exactly one variable exists.
|
|
248
|
+
* - Otherwise, syncs the assessment item's variables with the test context.
|
|
249
|
+
*
|
|
250
|
+
* @param assessmentItem - The assessment item to update.
|
|
251
|
+
*/
|
|
252
|
+
this._updateItemInTestContext = (assessmentItem) => {
|
|
253
|
+
const { identifier, variables } = assessmentItem;
|
|
254
|
+
const itemContext = this._testContext.items.find((i) => i?.identifier === identifier);
|
|
255
|
+
if (!itemContext) {
|
|
256
|
+
console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (itemContext.variables?.length === 1) {
|
|
260
|
+
this._updateItemVariablesInTestContext(identifier, variables);
|
|
261
|
+
} else {
|
|
262
|
+
assessmentItem.variables = [...itemContext.variables || []];
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
this.addEventListener("qti-assessment-test-connected", (e) => {
|
|
266
|
+
const qtiAssessmentTest = e.detail;
|
|
267
|
+
const items = Array.from(qtiAssessmentTest.querySelectorAll("qti-assessment-item-ref")).map(
|
|
268
|
+
(itemRef) => ({
|
|
269
|
+
href: itemRef.href,
|
|
270
|
+
identifier: itemRef.identifier,
|
|
271
|
+
category: itemRef.category,
|
|
272
|
+
variables: [{ identifier: "completionStatus", value: "not_attempted", type: "outcome" }]
|
|
273
|
+
})
|
|
274
|
+
);
|
|
275
|
+
this.testElement = { el: qtiAssessmentTest };
|
|
276
|
+
this._testContext = { ...this._testContext, items };
|
|
277
|
+
});
|
|
278
|
+
this.addEventListener("qti-assessment-item-connected", (e) => {
|
|
279
|
+
this._updateItemInTestContext(e.detail);
|
|
280
|
+
});
|
|
281
|
+
this.addEventListener("qti-outcome-changed", (e) => {
|
|
282
|
+
const assessmentitem = e.composedPath()[0];
|
|
283
|
+
this._updateItemVariablesInTestContext(assessmentitem.identifier, assessmentitem.variables);
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
get context() {
|
|
287
|
+
return this._testContext;
|
|
288
|
+
}
|
|
289
|
+
// /* restores the context by updating existing items and adding new items from the "contextToRestore" parameter into the "this._context.items" array. */
|
|
290
|
+
set context(testContext2) {
|
|
291
|
+
if (testContext2 === null || testContext2 === void 0) return;
|
|
292
|
+
this._testContext = { ...testContext2 };
|
|
293
|
+
testContext2.items?.forEach((itemContext) => {
|
|
294
|
+
const existingItemContext = this._testContext.items.find((i) => i.identifier === itemContext.identifier);
|
|
295
|
+
if (existingItemContext) {
|
|
296
|
+
existingItemContext.variables = itemContext.variables;
|
|
297
|
+
} else {
|
|
298
|
+
this._testContext.items.push(itemContext);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
_updateItemVariablesInTestContext(identifier, variables) {
|
|
303
|
+
this._testContext = {
|
|
304
|
+
...this._testContext,
|
|
305
|
+
// Spread existing test context properties
|
|
306
|
+
items: this._testContext.items.map((itemContext) => {
|
|
307
|
+
if (itemContext.identifier !== identifier) {
|
|
308
|
+
return itemContext;
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
...itemContext,
|
|
312
|
+
// Keep other properties of the item context
|
|
313
|
+
variables: variables.map((variable) => {
|
|
314
|
+
const matchingVariable = itemContext.variables.find((v) => v.identifier === variable.identifier);
|
|
315
|
+
return matchingVariable ? { ...matchingVariable, ...variable } : variable;
|
|
316
|
+
})
|
|
317
|
+
};
|
|
318
|
+
})
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
// private _addItemToTestContext(
|
|
322
|
+
// e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }
|
|
323
|
+
// ): void {
|
|
324
|
+
// const { href, identifier, category } = e.detail;
|
|
325
|
+
// // Update test context items, adding a new item if the identifier is not already in the list
|
|
326
|
+
// if (!this._testContext.items.some(item => item.identifier === identifier)) {
|
|
327
|
+
// this._testContext.items.push({
|
|
328
|
+
// href,
|
|
329
|
+
// identifier,
|
|
330
|
+
// category,
|
|
331
|
+
// variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]
|
|
332
|
+
// // category: e.target.category
|
|
333
|
+
// });
|
|
334
|
+
// }
|
|
335
|
+
// }
|
|
336
|
+
connectedCallback() {
|
|
337
|
+
super.connectedCallback();
|
|
338
|
+
this.setAttribute("qti-test", "");
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
__decorateClass([
|
|
342
|
+
state2(),
|
|
343
|
+
provide({ context: testContext })
|
|
344
|
+
], TestBase.prototype, "_testContext", 2);
|
|
345
|
+
__decorateClass([
|
|
346
|
+
state2(),
|
|
347
|
+
provide({ context: testElement })
|
|
348
|
+
], TestBase.prototype, "testElement", 2);
|
|
349
|
+
|
|
350
|
+
// src/lib/qti-test/core/qti-test.ts
|
|
351
|
+
var QtiTest = class extends TestLoaderMixin(TestNavigationMixin(TestViewMixin(TestBase))) {
|
|
352
|
+
/**
|
|
353
|
+
* Renders the component's template.
|
|
354
|
+
* Provides a default `<slot>` for content projection.
|
|
355
|
+
*/
|
|
356
|
+
render() {
|
|
357
|
+
return html2`<slot></slot>`;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
QtiTest = __decorateClass([
|
|
361
|
+
customElement2("qti-test")
|
|
362
|
+
], QtiTest);
|
|
363
|
+
|
|
364
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-assessment-item-ref.ts
|
|
365
|
+
import { consume } from "@lit/context";
|
|
366
|
+
import { html as html3, LitElement as LitElement3 } from "lit";
|
|
367
|
+
import { property as property2 } from "lit/decorators.js";
|
|
368
|
+
var stringToBooleanConverter = {
|
|
369
|
+
fromAttribute(value) {
|
|
370
|
+
return value === "true";
|
|
371
|
+
},
|
|
372
|
+
toAttribute(value) {
|
|
373
|
+
return value ? "true" : "false";
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
var QtiAssessmentItemRef = class extends LitElement3 {
|
|
377
|
+
constructor() {
|
|
378
|
+
super(...arguments);
|
|
379
|
+
this.weigths = /* @__PURE__ */ new Map();
|
|
380
|
+
}
|
|
381
|
+
// the XMLDocument
|
|
382
|
+
createRenderRoot() {
|
|
383
|
+
return this;
|
|
384
|
+
}
|
|
385
|
+
get assessmentItem() {
|
|
386
|
+
return this.renderRoot?.querySelector("qti-assessment-item");
|
|
387
|
+
}
|
|
388
|
+
async connectedCallback() {
|
|
389
|
+
super.connectedCallback();
|
|
390
|
+
await this.updateComplete;
|
|
391
|
+
this.dispatchEvent(
|
|
392
|
+
new CustomEvent("qti-assessment-item-ref-connected", {
|
|
393
|
+
bubbles: true,
|
|
394
|
+
composed: true,
|
|
395
|
+
detail: { identifier: this.identifier, href: this.href, category: this.category }
|
|
396
|
+
})
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
render() {
|
|
400
|
+
return html3`${this.xmlDoc}`;
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
__decorateClass([
|
|
404
|
+
property2({ type: String })
|
|
405
|
+
], QtiAssessmentItemRef.prototype, "category", 2);
|
|
406
|
+
__decorateClass([
|
|
407
|
+
property2({ type: String })
|
|
408
|
+
], QtiAssessmentItemRef.prototype, "identifier", 2);
|
|
409
|
+
__decorateClass([
|
|
410
|
+
property2({ type: Boolean, converter: stringToBooleanConverter })
|
|
411
|
+
], QtiAssessmentItemRef.prototype, "required", 2);
|
|
412
|
+
__decorateClass([
|
|
413
|
+
property2({ type: Boolean, converter: stringToBooleanConverter })
|
|
414
|
+
], QtiAssessmentItemRef.prototype, "fixed", 2);
|
|
415
|
+
__decorateClass([
|
|
416
|
+
property2({ type: String })
|
|
417
|
+
], QtiAssessmentItemRef.prototype, "href", 2);
|
|
418
|
+
__decorateClass([
|
|
419
|
+
consume({ context: testContext, subscribe: true })
|
|
420
|
+
], QtiAssessmentItemRef.prototype, "_testContext", 2);
|
|
421
|
+
__decorateClass([
|
|
422
|
+
property2({ type: Object, attribute: false })
|
|
423
|
+
], QtiAssessmentItemRef.prototype, "xmlDoc", 2);
|
|
424
|
+
if (!customElements.get("qti-assessment-item-ref")) {
|
|
425
|
+
customElements.define("qti-assessment-item-ref", QtiAssessmentItemRef);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-assessment-section.ts
|
|
429
|
+
import { consume as consume2 } from "@lit/context";
|
|
430
|
+
import { html as html4, LitElement as LitElement4 } from "lit";
|
|
431
|
+
import { property as property3 } from "lit/decorators.js";
|
|
432
|
+
var stringToBooleanConverter2 = {
|
|
433
|
+
fromAttribute(value) {
|
|
434
|
+
return value === "true";
|
|
435
|
+
},
|
|
436
|
+
toAttribute(value) {
|
|
437
|
+
return value ? "true" : "false";
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
var QtiAssessmentSection = class extends LitElement4 {
|
|
441
|
+
async connectedCallback() {
|
|
442
|
+
super.connectedCallback();
|
|
443
|
+
await this.updateComplete;
|
|
444
|
+
this.dispatchEvent(
|
|
445
|
+
new Event("qti-assessment-section-connected", {
|
|
446
|
+
bubbles: true,
|
|
447
|
+
composed: true
|
|
448
|
+
})
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
render() {
|
|
452
|
+
return html4`<slot name="qti-rubric-block"></slot><slot></slot>`;
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
__decorateClass([
|
|
456
|
+
property3({ type: String })
|
|
457
|
+
], QtiAssessmentSection.prototype, "identifier", 2);
|
|
458
|
+
__decorateClass([
|
|
459
|
+
property3({ type: String })
|
|
460
|
+
], QtiAssessmentSection.prototype, "required", 2);
|
|
461
|
+
__decorateClass([
|
|
462
|
+
property3({ type: Boolean, converter: stringToBooleanConverter2 })
|
|
463
|
+
], QtiAssessmentSection.prototype, "fixed", 2);
|
|
464
|
+
__decorateClass([
|
|
465
|
+
property3({ type: String })
|
|
466
|
+
], QtiAssessmentSection.prototype, "title", 2);
|
|
467
|
+
__decorateClass([
|
|
468
|
+
property3({ type: Boolean, converter: stringToBooleanConverter2 })
|
|
469
|
+
], QtiAssessmentSection.prototype, "visible", 2);
|
|
470
|
+
__decorateClass([
|
|
471
|
+
property3({ type: Boolean, converter: stringToBooleanConverter2, attribute: "keep-together" })
|
|
472
|
+
], QtiAssessmentSection.prototype, "keepTogether", 2);
|
|
473
|
+
__decorateClass([
|
|
474
|
+
consume2({ context: testContext, subscribe: true })
|
|
475
|
+
], QtiAssessmentSection.prototype, "_testContext", 2);
|
|
476
|
+
if (!customElements.get("qti-assessment-section")) {
|
|
477
|
+
customElements.define("qti-assessment-section", QtiAssessmentSection);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-assessment-test.ts
|
|
481
|
+
import { consume as consume3 } from "@lit/context";
|
|
482
|
+
import { html as html5, LitElement as LitElement5 } from "lit";
|
|
483
|
+
import { customElement as customElement3, property as property4 } from "lit/decorators.js";
|
|
484
|
+
var QtiAssessmentTest = class extends LitElement5 {
|
|
485
|
+
async connectedCallback() {
|
|
486
|
+
super.connectedCallback();
|
|
487
|
+
await this.updateComplete;
|
|
488
|
+
this.dispatchEvent(
|
|
489
|
+
new CustomEvent("qti-assessment-test-connected", {
|
|
490
|
+
detail: this,
|
|
491
|
+
bubbles: true,
|
|
492
|
+
composed: true
|
|
493
|
+
})
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
render() {
|
|
497
|
+
return html5` <slot></slot>`;
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
__decorateClass([
|
|
501
|
+
property4({ type: String })
|
|
502
|
+
], QtiAssessmentTest.prototype, "identifier", 2);
|
|
503
|
+
__decorateClass([
|
|
504
|
+
property4({ type: String })
|
|
505
|
+
], QtiAssessmentTest.prototype, "title", 2);
|
|
506
|
+
__decorateClass([
|
|
507
|
+
consume3({ context: testContext, subscribe: true })
|
|
508
|
+
], QtiAssessmentTest.prototype, "_testContext", 2);
|
|
509
|
+
QtiAssessmentTest = __decorateClass([
|
|
510
|
+
customElement3("qti-assessment-test")
|
|
511
|
+
], QtiAssessmentTest);
|
|
512
|
+
|
|
513
|
+
// src/lib/qti-test/core/qti-assessment-test/qti-test-part.ts
|
|
514
|
+
import { html as html6, LitElement as LitElement6 } from "lit";
|
|
515
|
+
import { customElement as customElement4, property as property5 } from "lit/decorators.js";
|
|
516
|
+
var QtiTestPart = class extends LitElement6 {
|
|
517
|
+
constructor() {
|
|
518
|
+
super(...arguments);
|
|
519
|
+
this.identifier = "";
|
|
520
|
+
this.title = "";
|
|
521
|
+
this.class = "";
|
|
522
|
+
this.NavigationMode = "nonlinear";
|
|
523
|
+
this.submissionMode = "individual";
|
|
524
|
+
}
|
|
525
|
+
async connectedCallback() {
|
|
526
|
+
super.connectedCallback();
|
|
527
|
+
await this.updateComplete;
|
|
528
|
+
this.dispatchEvent(
|
|
529
|
+
new Event("qti-test-part-connected", {
|
|
530
|
+
bubbles: true,
|
|
531
|
+
composed: true
|
|
532
|
+
})
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
render() {
|
|
536
|
+
return html6` <slot></slot>`;
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
__decorateClass([
|
|
540
|
+
property5({ type: String })
|
|
541
|
+
], QtiTestPart.prototype, "identifier", 2);
|
|
542
|
+
__decorateClass([
|
|
543
|
+
property5({ type: String })
|
|
544
|
+
], QtiTestPart.prototype, "title", 2);
|
|
545
|
+
__decorateClass([
|
|
546
|
+
property5({ type: String })
|
|
547
|
+
], QtiTestPart.prototype, "class", 2);
|
|
548
|
+
__decorateClass([
|
|
549
|
+
property5({ type: String, attribute: "navigation-mode" })
|
|
550
|
+
], QtiTestPart.prototype, "NavigationMode", 2);
|
|
551
|
+
__decorateClass([
|
|
552
|
+
property5({ type: String, attribute: "submission-mode" })
|
|
553
|
+
], QtiTestPart.prototype, "submissionMode", 2);
|
|
554
|
+
QtiTestPart = __decorateClass([
|
|
555
|
+
customElement4("qti-test-part")
|
|
556
|
+
], QtiTestPart);
|
|
557
|
+
if (!customElements.get("qti-test-part")) {
|
|
558
|
+
customElements.define("qti-test-part", QtiTestPart);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export {
|
|
562
|
+
TestContainer,
|
|
563
|
+
QtiTest,
|
|
564
|
+
QtiAssessmentItemRef,
|
|
565
|
+
QtiAssessmentSection,
|
|
566
|
+
QtiAssessmentTest,
|
|
567
|
+
QtiTestPart
|
|
568
|
+
};
|
|
569
|
+
//# sourceMappingURL=chunk-CNQYM52B.js.map
|