@citolab/qti-components 8.0.1 → 8.1.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/index.global.js +1 -1
- package/cdn/index.js +648 -816
- package/dist/base.d.ts +61 -4
- package/dist/base.js +7 -1
- package/dist/{chunk-V5G7X53Y.js → chunk-3IACYIU2.js} +2 -2
- package/dist/chunk-4DB4SC5K.js +100 -0
- package/dist/chunk-4DB4SC5K.js.map +1 -0
- package/dist/{chunk-F4BNJWYN.js → chunk-4XR2JHCP.js} +646 -677
- package/dist/chunk-4XR2JHCP.js.map +1 -0
- package/dist/{chunk-7V4HJFHW.js → chunk-6ITD55QE.js} +2 -2
- package/dist/{chunk-3AJOQCDU.js → chunk-6V3A7NQP.js} +2 -2
- package/dist/{chunk-WVVMNF74.js → chunk-6XJUP55A.js} +248 -234
- package/dist/chunk-6XJUP55A.js.map +1 -0
- package/dist/{chunk-XU7HNT4F.js → chunk-CF3DXJWM.js} +145 -119
- package/dist/{chunk-XU7HNT4F.js.map → chunk-CF3DXJWM.js.map} +1 -1
- package/dist/chunk-EKXZI26R.js +917 -0
- package/dist/chunk-EKXZI26R.js.map +1 -0
- package/dist/{chunk-IJD53WY6.js → chunk-HDEG6BAZ.js} +15 -15
- package/dist/{chunk-IJD53WY6.js.map → chunk-HDEG6BAZ.js.map} +1 -1
- package/dist/{chunk-LVBIQDPM.js → chunk-IXPDMYKH.js} +147 -101
- package/dist/chunk-IXPDMYKH.js.map +1 -0
- package/dist/chunk-IYC7LZV6.js +7 -0
- package/dist/chunk-IYC7LZV6.js.map +1 -0
- package/dist/{chunk-NA2N2WSG.js → chunk-MK2I3MQB.js} +244 -193
- package/dist/chunk-MK2I3MQB.js.map +1 -0
- package/dist/{chunk-CAO4JRLY.js → chunk-NZLW6EX7.js} +2 -2
- package/dist/{chunk-RXGDQDOV.js → chunk-Q52IJELT.js} +479 -393
- package/dist/chunk-Q52IJELT.js.map +1 -0
- package/dist/{chunk-QECOPVPO.js → chunk-TXIB3SKC.js} +60 -59
- package/dist/chunk-TXIB3SKC.js.map +1 -0
- package/dist/{computed.types.d-rKLSPvVG.d.ts → computed.types.d-DpKIYO6e.d.ts} +2 -0
- package/dist/corrections.d.ts +12 -29
- package/dist/corrections.js +9 -10
- package/dist/elements.d.ts +86 -87
- package/dist/elements.js +5 -6
- package/dist/index.d.ts +8 -39
- package/dist/index.js +29 -16
- package/dist/{interaction.d-D4MstYRz.d.ts → interaction.d-CJiMv8H7.d.ts} +13 -2
- package/dist/interactions.d.ts +11 -1299
- package/dist/interactions.js +4 -5
- package/dist/item.css +370 -532
- package/dist/item.d.ts +3 -3
- package/dist/item.js +6 -6
- package/dist/loader.js +2 -2
- package/dist/processing.d.ts +61 -11
- package/dist/processing.js +10 -2
- package/dist/qti-components-jsx.d.ts +293 -69
- package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
- package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
- package/dist/test.d.ts +11 -678
- package/dist/test.js +7 -8
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +1 -1
- package/package.json +11 -10
- package/dist/chunk-64XSIBGO.js +0 -241
- package/dist/chunk-64XSIBGO.js.map +0 -1
- package/dist/chunk-7HC5SMCU.js +0 -102
- package/dist/chunk-7HC5SMCU.js.map +0 -1
- package/dist/chunk-F4BNJWYN.js.map +0 -1
- package/dist/chunk-H3J7LFRO.js +0 -2243
- package/dist/chunk-H3J7LFRO.js.map +0 -1
- package/dist/chunk-LVBIQDPM.js.map +0 -1
- package/dist/chunk-NA2N2WSG.js.map +0 -1
- package/dist/chunk-QECOPVPO.js.map +0 -1
- package/dist/chunk-RXGDQDOV.js.map +0 -1
- package/dist/chunk-WVVMNF74.js.map +0 -1
- package/dist/chunk-X3E5HXG2.js +0 -20
- package/dist/chunk-X3E5HXG2.js.map +0 -1
- /package/dist/{chunk-V5G7X53Y.js.map → chunk-3IACYIU2.js.map} +0 -0
- /package/dist/{chunk-7V4HJFHW.js.map → chunk-6ITD55QE.js.map} +0 -0
- /package/dist/{chunk-3AJOQCDU.js.map → chunk-6V3A7NQP.js.map} +0 -0
- /package/dist/{chunk-CAO4JRLY.js.map → chunk-NZLW6EX7.js.map} +0 -0
|
@@ -1,34 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
-
item_default
|
|
3
|
-
|
|
4
|
-
} from "./chunk-7HC5SMCU.js";
|
|
2
|
+
item_default
|
|
3
|
+
} from "./chunk-IYC7LZV6.js";
|
|
5
4
|
import {
|
|
6
5
|
watch
|
|
7
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4DB4SC5K.js";
|
|
8
7
|
import {
|
|
9
8
|
qtiTransformItem
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HDEG6BAZ.js";
|
|
11
10
|
import {
|
|
12
|
-
T,
|
|
13
|
-
c,
|
|
14
11
|
computedItemContext,
|
|
15
12
|
configContext,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
i2,
|
|
19
|
-
n2 as n,
|
|
20
|
-
qtiContext,
|
|
21
|
-
r
|
|
22
|
-
} from "./chunk-H3J7LFRO.js";
|
|
13
|
+
qtiContext
|
|
14
|
+
} from "./chunk-EKXZI26R.js";
|
|
23
15
|
|
|
24
16
|
// ../qti-item/dist/components/item-container/item-container.js
|
|
17
|
+
import { consume } from "@lit/context";
|
|
18
|
+
import { LitElement, html } from "lit";
|
|
19
|
+
import { property, state } from "lit/decorators.js";
|
|
20
|
+
import { until } from "lit/directives/until.js";
|
|
25
21
|
var __decorate = function(decorators, target, key, desc) {
|
|
26
|
-
var
|
|
27
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
28
|
-
else for (var
|
|
29
|
-
return
|
|
22
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
24
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
25
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
30
26
|
};
|
|
31
|
-
var ItemContainer = class extends
|
|
27
|
+
var ItemContainer = class extends LitElement {
|
|
32
28
|
constructor() {
|
|
33
29
|
super(...arguments);
|
|
34
30
|
this.customElementRegistry = null;
|
|
@@ -85,7 +81,7 @@ var ItemContainer = class extends i2 {
|
|
|
85
81
|
}
|
|
86
82
|
#initializeTemplateContent() {
|
|
87
83
|
const template = this.querySelector("template");
|
|
88
|
-
this.#templateContent = template ? template.content :
|
|
84
|
+
this.#templateContent = template ? template.content : html``;
|
|
89
85
|
}
|
|
90
86
|
#applyStyles() {
|
|
91
87
|
const sheet = new CSSStyleSheet();
|
|
@@ -93,28 +89,28 @@ var ItemContainer = class extends i2 {
|
|
|
93
89
|
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
94
90
|
}
|
|
95
91
|
render() {
|
|
96
|
-
return
|
|
92
|
+
return html`
|
|
97
93
|
${this.#templateContent}
|
|
98
94
|
<slot></slot>
|
|
99
|
-
${
|
|
95
|
+
${until(this.itemDoc, html`<span>Loading...</span>`)}
|
|
100
96
|
`;
|
|
101
97
|
}
|
|
102
98
|
};
|
|
103
99
|
__decorate([
|
|
104
|
-
|
|
100
|
+
property({ attribute: false })
|
|
105
101
|
], ItemContainer.prototype, "customElementRegistry", void 0);
|
|
106
102
|
__decorate([
|
|
107
|
-
|
|
103
|
+
property({ type: String, attribute: "item-url" })
|
|
108
104
|
], ItemContainer.prototype, "itemURL", void 0);
|
|
109
105
|
__decorate([
|
|
110
|
-
|
|
106
|
+
state()
|
|
111
107
|
], ItemContainer.prototype, "itemDoc", void 0);
|
|
112
108
|
__decorate([
|
|
113
|
-
|
|
109
|
+
state()
|
|
114
110
|
], ItemContainer.prototype, "itemXML", void 0);
|
|
115
111
|
__decorate([
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
state(),
|
|
113
|
+
consume({ context: qtiContext, subscribe: true })
|
|
118
114
|
], ItemContainer.prototype, "qtiContext", void 0);
|
|
119
115
|
__decorate([
|
|
120
116
|
watch("itemURL", { waitUntilFirstUpdate: true })
|
|
@@ -124,15 +120,17 @@ __decorate([
|
|
|
124
120
|
], ItemContainer.prototype, "handleItemXMLChange", null);
|
|
125
121
|
|
|
126
122
|
// ../qti-item/dist/components/item-print-variables/item-print-variables.js
|
|
123
|
+
import { consume as consume2 } from "@lit/context";
|
|
124
|
+
import { css, html as html2, LitElement as LitElement2 } from "lit";
|
|
127
125
|
var __decorate2 = function(decorators, target, key, desc) {
|
|
128
|
-
var
|
|
129
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
130
|
-
else for (var
|
|
131
|
-
return
|
|
126
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
127
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
128
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
129
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
132
130
|
};
|
|
133
|
-
var ItemPrintVariables = class extends
|
|
131
|
+
var ItemPrintVariables = class extends LitElement2 {
|
|
134
132
|
static {
|
|
135
|
-
this.styles =
|
|
133
|
+
this.styles = css`
|
|
136
134
|
table {
|
|
137
135
|
width: 100%;
|
|
138
136
|
border-collapse: collapse;
|
|
@@ -158,10 +156,10 @@ var ItemPrintVariables = class extends i2 {
|
|
|
158
156
|
render() {
|
|
159
157
|
const activeItem = this.computedContext;
|
|
160
158
|
if (!activeItem || !activeItem.variables)
|
|
161
|
-
return
|
|
159
|
+
return html2``;
|
|
162
160
|
const responseVariables = activeItem.variables.filter((v) => v.type === "response");
|
|
163
161
|
const outcomeVariables = activeItem.variables.filter((v) => v.type === "outcome");
|
|
164
|
-
const renderTable = (variables, title) =>
|
|
162
|
+
const renderTable = (variables, title) => html2`
|
|
165
163
|
<h3>${title}</h3>
|
|
166
164
|
<table>
|
|
167
165
|
<thead>
|
|
@@ -176,9 +174,9 @@ var ItemPrintVariables = class extends i2 {
|
|
|
176
174
|
<tbody>
|
|
177
175
|
${variables.map((v) => {
|
|
178
176
|
const correctResponse = v.correctResponse ? Array.isArray(v.correctResponse) ? v.correctResponse.join(", ") : v.correctResponse : "";
|
|
179
|
-
const mapEntries = v.mapping?.mapEntries?.map((
|
|
180
|
-
const areaMapEntries = v.areaMapping?.areaMapEntries?.map((
|
|
181
|
-
return
|
|
177
|
+
const mapEntries = v.mapping?.mapEntries?.map((m) => `${m.mapKey}=${m.mappedValue}pt`).join(", ") || "";
|
|
178
|
+
const areaMapEntries = v.areaMapping?.areaMapEntries?.map((m) => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(", ") || "";
|
|
179
|
+
return html2`
|
|
182
180
|
<tr>
|
|
183
181
|
<td>${v.identifier}</td>
|
|
184
182
|
<td>${Array.isArray(v.value) ? v.value.join(", ") : v.value}</td>
|
|
@@ -191,23 +189,26 @@ var ItemPrintVariables = class extends i2 {
|
|
|
191
189
|
</tbody>
|
|
192
190
|
</table>
|
|
193
191
|
`;
|
|
194
|
-
return
|
|
192
|
+
return html2`
|
|
195
193
|
${renderTable(responseVariables, "Response Variables")} ${renderTable(outcomeVariables, "Outcome Variables")}
|
|
196
194
|
`;
|
|
197
195
|
}
|
|
198
196
|
};
|
|
199
197
|
__decorate2([
|
|
200
|
-
|
|
198
|
+
consume2({ context: computedItemContext, subscribe: true })
|
|
201
199
|
], ItemPrintVariables.prototype, "computedContext", void 0);
|
|
202
200
|
|
|
203
201
|
// ../qti-item/dist/components/qti-item/qti-item.js
|
|
202
|
+
import { provide } from "@lit/context";
|
|
203
|
+
import { html as html3, LitElement as LitElement3 } from "lit";
|
|
204
|
+
import { state as state2 } from "lit/decorators.js";
|
|
204
205
|
var __decorate3 = function(decorators, target, key, desc) {
|
|
205
|
-
var
|
|
206
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
207
|
-
else for (var
|
|
208
|
-
return
|
|
206
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
207
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
208
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
209
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
209
210
|
};
|
|
210
|
-
var QtiItem = class extends
|
|
211
|
+
var QtiItem = class extends LitElement3 {
|
|
211
212
|
// Store event handlers as instance properties
|
|
212
213
|
#onItemContextChanged;
|
|
213
214
|
#onAssessmentItemConnected;
|
|
@@ -226,12 +227,12 @@ var QtiItem = class extends i2 {
|
|
|
226
227
|
this.addEventListener("qti-item-context-updated", this.#onItemContextChanged);
|
|
227
228
|
this.addEventListener("qti-assessment-item-connected", this.#onAssessmentItemConnected);
|
|
228
229
|
}
|
|
229
|
-
#handleItemContextChanged(
|
|
230
|
-
this.#updateItemVariablesInTestContext(
|
|
230
|
+
#handleItemContextChanged(e) {
|
|
231
|
+
this.#updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);
|
|
231
232
|
}
|
|
232
|
-
#handleAssessmentItemConnected(
|
|
233
|
-
const fullVariables =
|
|
234
|
-
this.assessmentItem =
|
|
233
|
+
#handleAssessmentItemConnected(e) {
|
|
234
|
+
const fullVariables = e.detail._context.variables;
|
|
235
|
+
this.assessmentItem = e.detail;
|
|
235
236
|
this.computedContext = this.computedContext?.identifier === this.assessmentItem.identifier ? { ...this.computedContext, title: this.assessmentItem.title } : {
|
|
236
237
|
identifier: this.assessmentItem.identifier,
|
|
237
238
|
title: this.assessmentItem.title,
|
|
@@ -257,7 +258,7 @@ var QtiItem = class extends i2 {
|
|
|
257
258
|
};
|
|
258
259
|
}
|
|
259
260
|
render() {
|
|
260
|
-
return
|
|
261
|
+
return html3`<slot></slot>`;
|
|
261
262
|
}
|
|
262
263
|
disconnectedCallback() {
|
|
263
264
|
super.disconnectedCallback();
|
|
@@ -266,16 +267,16 @@ var QtiItem = class extends i2 {
|
|
|
266
267
|
}
|
|
267
268
|
};
|
|
268
269
|
__decorate3([
|
|
269
|
-
|
|
270
|
-
|
|
270
|
+
state2(),
|
|
271
|
+
provide({ context: computedItemContext })
|
|
271
272
|
], QtiItem.prototype, "computedContext", void 0);
|
|
272
273
|
__decorate3([
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
state2(),
|
|
275
|
+
provide({ context: configContext })
|
|
275
276
|
], QtiItem.prototype, "configContext", void 0);
|
|
276
277
|
__decorate3([
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
state2(),
|
|
279
|
+
provide({ context: qtiContext })
|
|
279
280
|
], QtiItem.prototype, "qtiContext", void 0);
|
|
280
281
|
|
|
281
282
|
// ../qti-item/dist/elements.js
|
|
@@ -291,4 +292,4 @@ export {
|
|
|
291
292
|
QtiItem,
|
|
292
293
|
qtiItemElements
|
|
293
294
|
};
|
|
294
|
-
//# sourceMappingURL=chunk-
|
|
295
|
+
//# sourceMappingURL=chunk-TXIB3SKC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../qti-item/src/components/item-container/item-container.ts","../../qti-item/src/components/item-print-variables/item-print-variables.ts","../../qti-item/src/components/qti-item/qti-item.ts","../../qti-item/src/elements.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport { qtiContext } from '@qti-components/base';\nimport { watch } from '@qti-components/utilities';\nimport { qtiTransformItem } from '@qti-components/transformers';\n\n// eslint-disable-next-line import/no-relative-packages\nimport itemCss from '../../../../qti-theme/src/item.css?inline';\n\nimport type { QtiContext } from '@qti-components/base';\n\n/**\n * `<item-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-item` will be placed inside the shadow DOM of this element.\n * The element loads the item from the provided URL and renders it inside the shadow DOM.\n *\n * ### Styling\n * Add a class to the element for styling.\n *\n * ```html\n * <qti-item>\n * <item-container class=\"m-4 bg-white\" item-url=\"./path/to/item.xml\"></item-container>\n * </qti-item>\n * ```\n */\n\nexport class ItemContainer extends LitElement {\n /** Scoped registry used by the item shadow root. Must be set before connection. */\n @property({ attribute: false })\n customElementRegistry: CustomElementRegistry | null = null;\n\n /** URL of the item to load */\n @property({ type: String, attribute: 'item-url' })\n itemURL: string | null = null;\n\n /** A parsed HTML document */\n @state()\n itemDoc: DocumentFragment | null = null;\n\n /** The raw XML string */\n @state()\n itemXML: string | null = null;\n\n @state()\n @consume({ context: qtiContext, subscribe: true })\n protected qtiContext: QtiContext = {\n QTI_CONTEXT: { testIdentifier: '', candidateIdentifier: '', environmentIdentifier: 'default' }\n };\n\n /** Template content if provided */\n #templateContent: unknown = null;\n #resolvedCustomElementRegistry: CustomElementRegistry | null = null;\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const registry = this.customElementRegistry;\n\n this.#resolvedCustomElementRegistry = registry;\n\n return (\n this.shadowRoot ??\n this.attachShadow({\n ...(this.constructor as typeof ItemContainer).shadowRootOptions,\n ...(registry ? { customElementRegistry: registry } : {})\n })\n );\n }\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const explicitSeed = this.qtiContext?.QTI_CONTEXT?.seed;\n const api = (await qtiTransformItem().load(this.itemURL)).shuffleInteractions(explicitSeed);\n this.itemDoc = api.htmlDoc(this.#resolvedCustomElementRegistry ?? undefined);\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('itemXML', { waitUntilFirstUpdate: true })\n protected handleItemXMLChange() {\n if (!this.itemXML) return;\n try {\n this.itemDoc = qtiTransformItem()\n .parse(this.itemXML)\n .htmlDoc(this.#resolvedCustomElementRegistry ?? undefined);\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.#initializeTemplateContent();\n this.#applyStyles();\n if (this.itemURL) {\n this.handleItemURLChange();\n }\n if (this.itemXML) {\n this.handleItemXMLChange();\n }\n }\n\n #initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.#templateContent = template ? template.content : html``;\n }\n\n #applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n override render() {\n return html`\n ${this.#templateContent}\n <slot></slot>\n ${until(this.itemDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-container': ItemContainer;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { ComputedItemContext } from '@qti-components/base';\n\nexport class ItemPrintVariables extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n protected computedContext?: ComputedItemContext;\n\n static override styles = css`\n table {\n width: 100%;\n border-collapse: collapse;\n margin: 20px 0;\n font-size: 14px;\n text-align: left;\n }\n th,\n td {\n border: 1px solid #ddd;\n padding: 8px;\n }\n th {\n background-color: #f4f4f4;\n font-weight: bold;\n }\n h3 {\n margin-top: 20px;\n font-size: 16px;\n }\n `;\n\n override render() {\n const activeItem = this.computedContext;\n\n if (!activeItem || !activeItem.variables) return html``;\n\n const responseVariables: ResponseVariable[] = activeItem.variables.filter(v => v.type === 'response');\n const outcomeVariables = activeItem.variables.filter(v => v.type === 'outcome');\n\n const renderTable = (variables: ResponseVariable[], title: string) => html`\n <h3>${title}</h3>\n <table>\n <thead>\n <tr>\n <th>Identifier</th>\n <th>Value</th>\n <th>Cardinality</th>\n <th>Base Type</th>\n <th>Correct Response / Mappings</th>\n </tr>\n </thead>\n <tbody>\n ${variables.map(v => {\n const correctResponse = v.correctResponse\n ? Array.isArray(v.correctResponse)\n ? v.correctResponse.join(', ')\n : v.correctResponse\n : '';\n\n const mapEntries = v.mapping?.mapEntries?.map(m => `${m.mapKey}=${m.mappedValue}pt`).join(', ') || '';\n\n const areaMapEntries =\n v.areaMapping?.areaMapEntries?.map(m => `${m.shape}(${m.coords})=${m.mappedValue}pt`).join(', ') || '';\n\n return html`\n <tr>\n <td>${v.identifier}</td>\n <td>${Array.isArray(v.value) ? v.value.join(', ') : v.value}</td>\n <td>${v.cardinality}</td>\n <td>${v.baseType}</td>\n <td>${correctResponse || mapEntries || areaMapEntries}</td>\n </tr>\n `;\n })}\n </tbody>\n </table>\n `;\n\n return html`\n ${renderTable(responseVariables, 'Response Variables')} ${renderTable(outcomeVariables, 'Outcome Variables')}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-print-variables': ItemPrintVariables;\n }\n}\n","import { provide } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\n\nimport { computedItemContext } from '@qti-components/base';\nimport { configContext } from '@qti-components/base';\nimport { qtiContext } from '@qti-components/base';\n\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { ConfigContext } from '@qti-components/base';\nimport type { QtiContext } from '@qti-components/base';\nimport type { ItemContext } from '@qti-components/base';\nimport type { VariableDeclaration } from '@qti-components/base';\nimport type { ComputedItemContext } from '@qti-components/base';\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\nexport class QtiItem extends LitElement {\n @state()\n @provide({ context: computedItemContext })\n public computedContext: ComputedItemContext;\n protected assessmentItem?: QtiAssessmentItem;\n\n @state()\n @provide({ context: configContext })\n public configContext: ConfigContext = {};\n\n /**\n * Provided so that descendants (e.g. `<item-container>`) can read the QTI runtime\n * context for standalone item delivery, including the optional shuffle `seed`.\n */\n @state()\n @provide({ context: qtiContext })\n public qtiContext: QtiContext = {\n QTI_CONTEXT: {\n testIdentifier: '',\n candidateIdentifier: '',\n environmentIdentifier: 'default'\n }\n };\n\n // Store event handlers as instance properties\n #onItemContextChanged = this.#handleItemContextChanged.bind(this);\n #onAssessmentItemConnected = this.#handleAssessmentItemConnected.bind(this);\n\n constructor() {\n super();\n this.addEventListener('qti-item-context-updated', this.#onItemContextChanged);\n this.addEventListener('qti-assessment-item-connected', this.#onAssessmentItemConnected);\n }\n\n #handleItemContextChanged(e: CustomEvent<{ itemContext: ItemContext }>) {\n this.#updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);\n }\n\n #handleAssessmentItemConnected(e: CustomEvent<QtiAssessmentItem>) {\n const fullVariables = (e.detail as any)._context.variables;\n this.assessmentItem = e.detail;\n this.computedContext =\n this.computedContext?.identifier === this.assessmentItem.identifier\n ? { ...this.computedContext, title: this.assessmentItem.title }\n : ({\n identifier: this.assessmentItem.identifier,\n title: this.assessmentItem.title,\n adaptive: this.assessmentItem.getAttribute('adaptive')?.toLowerCase() === 'true' || false,\n variables: fullVariables\n } as ComputedItemContext);\n this.#updateItemVariablesInTestContext(this.assessmentItem.identifier, fullVariables || []);\n }\n\n #updateItemVariablesInTestContext(\n identifier: string,\n variables: readonly VariableDeclaration<string | string[] | null>[]\n ): void {\n const rawscore = variables?.find(vr => vr.identifier == 'SCORE')?.value;\n const score = parseFloat(rawscore?.toString());\n const completionStatus = variables?.find(v => v.identifier === 'completionStatus')?.value;\n\n const correct = score !== undefined && !isNaN(score) && score > 0;\n const incorrect = score !== undefined && !isNaN(score) && score <= 0;\n const completed = completionStatus === 'completed';\n this.computedContext = {\n ...this.computedContext,\n identifier,\n correct,\n incorrect,\n completed,\n variables\n };\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('qti-item-context-changed', this.#onItemContextChanged);\n this.removeEventListener('qti-assessment-item-connected', this.#onAssessmentItemConnected);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-item': QtiItem;\n }\n}\n","import { ItemContainer } from './components/item-container/item-container';\nimport { ItemPrintVariables } from './components/item-print-variables/item-print-variables';\nimport { QtiItem } from './components/qti-item/qti-item';\n\nexport { ItemContainer, ItemPrintVariables, QtiItem };\n\nexport const qtiItemElements = [\n { tag: 'item-container', ctor: ItemContainer },\n { tag: 'item-print-variables', ctor: ItemPrintVariables },\n { tag: 'qti-item', ctor: QtiItem }\n] as const;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,YAAY,YAAY;AACjC,SAAS,UAAU,aAAa;AAChC,SAAS,aAAa;;;;;;;AA0BhB,IAAO,gBAAP,cAA6B,WAAU;EAA7C,cAAA;;AAGE,SAAA,wBAAsD;AAItD,SAAA,UAAyB;AAIzB,SAAA,UAAmC;AAInC,SAAA,UAAyB;AAIf,SAAA,aAAyB;MACjC,aAAa,EAAE,gBAAgB,IAAI,qBAAqB,IAAI,uBAAuB,UAAS;;AAI9F,SAAA,mBAA4B;AAC5B,SAAA,iCAA+D;EAsEjE;;EAvEE;EACA;EAEmB,mBAAgB;AACjC,UAAM,WAAW,KAAK;AAEtB,SAAK,iCAAiC;AAEtC,WACE,KAAK,cACL,KAAK,aAAa;MAChB,GAAI,KAAK,YAAqC;MAC9C,GAAI,WAA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AmB,WAAW,KAAK,OAAK,EAAE,eAAe,kBAAkB,GAAG;AAEpF,UAAM,UAAU,UAAU,UAAa,CAAC,MAAM,KAAK,KAAK,QAAQ;AAChE,UAAM,YAAY,UAAU,UAAa,CAAC,MAAM,KAAK,KAAK,SAAS;AACnE,UAAM,YAAY,qBAAqB;AACvC,SAAK,kBAAkB;MACrB,GAAG,KAAK;MACR;MACA;MACA;MACA;MACA;;EAEJ;EAES,SAAM;AACb,WAAOC;EACT;EAES,uBAAoB;AAC3B,UAAM,qBAAoB;AAC1B,SAAK,oBAAoB,4BAA4B,KAAK,qBAAqB;AAC/E,SAAK,oBAAoB,iCAAiC,KAAK,0BAA0B;EAC3F;;AA/EOC,YAAA;EAFNC,OAAK;EACL,QAAQ,EAAE,SAAS,oBAAmB,CAAE;;AAMlCD,YAAA;EAFNC,OAAK;EACL,QAAQ,EAAE,SAAS,cAAa,CAAE;;AAS5BD,YAAA;EAFNC,OAAK;EACL,QAAQ,EAAE,SAAS,WAAU,CAAE;;;;ACrC3B,IAAM,kBAAkB;EAC7B,EAAE,KAAK,kBAAkB,MAAM,cAAa;EAC5C,EAAE,KAAK,wBAAwB,MAAM,mBAAkB;EACvD,EAAE,KAAK,YAAY,MAAM,QAAO;;","names":["consume","html","LitElement","LitElement","html","__decorate","consume","html","LitElement","state","LitElement","html","__decorate","state"]}
|
package/dist/corrections.d.ts
CHANGED
|
@@ -1,40 +1,23 @@
|
|
|
1
|
-
import { I as Interaction } from './interaction.d-
|
|
1
|
+
import { I as Interaction } from './interaction.d-CJiMv8H7.js';
|
|
2
2
|
import { R as ResponseValue } from './response.d-_8y4kjGP.js';
|
|
3
3
|
import * as lit from 'lit';
|
|
4
4
|
import { LitElement } from 'lit';
|
|
5
|
-
import { QtiGapText } from '
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { QtiAssessmentItem } from '@qti-components/elements/elements';
|
|
11
|
-
import { QtiItem } from '@qti-components/item/elements';
|
|
12
|
-
import { QtiTest, TestCheckItem, TestNavigation } from '@qti-components/test/elements';
|
|
13
|
-
import { V as View, C as ComputedContext } from './computed.types.d-rKLSPvVG.js';
|
|
14
|
-
import { QtiAssessmentItem as QtiAssessmentItem$1 } from './elements.js';
|
|
5
|
+
import { g as QtiGapText, k as QtiHotspotChoice, m as QtiHottext, v as QtiSimpleAssociableChoice, w as QtiSimpleChoice, a as QtiAssociateInteraction, b as QtiChoiceInteraction, c as QtiExtendedTextInteraction, f as QtiGapMatchInteraction, h as QtiGraphicAssociateInteraction, i as QtiGraphicGapMatchInteraction, j as QtiGraphicOrderInteraction, C as Choice, l as QtiHotspotInteraction, n as QtiHottextInteraction, p as QtiInlineChoiceInteraction, q as QtiMatchInteraction, r as QtiOrderInteraction, s as QtiPortableCustomInteraction, u as QtiSelectPointInteraction, x as QtiSliderInteraction, y as QtiTextEntryInteraction } from './qti-text-entry-interaction.d-BGdfV9qG.js';
|
|
6
|
+
import { QtiAssessmentItem } from './elements.js';
|
|
7
|
+
import { QtiItem } from './item.js';
|
|
8
|
+
import { e as QtiTest, T as TestCheckItem, n as TestNavigation } from './qti-test.d-_YAlhDbt.js';
|
|
9
|
+
import { V as View, C as ComputedContext } from './computed.types.d-DpKIYO6e.js';
|
|
15
10
|
import { C as ComputedItemContext } from './computed-item.types.d-BKZdSLLJ.js';
|
|
16
|
-
import { QtiAssociateInteraction } from '@qti-components/associate-interaction/elements';
|
|
17
|
-
import { QtiChoiceInteraction } from '@qti-components/choice-interaction/elements';
|
|
18
|
-
import { QtiExtendedTextInteraction } from '@qti-components/extended-text-interaction/elements';
|
|
19
|
-
import { QtiGapMatchInteraction } from '@qti-components/gap-match-interaction/elements';
|
|
20
|
-
import { QtiGraphicAssociateInteraction } from '@qti-components/graphic-associate-interaction/elements';
|
|
21
|
-
import { QtiGraphicGapMatchInteraction } from '@qti-components/graphic-gap-match-interaction/elements';
|
|
22
|
-
import { QtiGraphicOrderInteraction } from '@qti-components/graphic-order-interaction/elements';
|
|
23
|
-
import { Choice } from '@qti-components/interactions-core/mixins/choices/choices.mixin';
|
|
24
|
-
import { QtiHotspotInteraction } from '@qti-components/hotspot-interaction/elements';
|
|
25
|
-
import { QtiHottextInteraction } from '@qti-components/hottext-interaction/elements';
|
|
26
|
-
import { QtiInlineChoiceInteraction } from '@qti-components/inline-choice-interaction/elements';
|
|
27
|
-
import { QtiMatchInteraction } from '@qti-components/match-interaction/elements';
|
|
28
|
-
import { QtiOrderInteraction } from '@qti-components/order-interaction/elements';
|
|
29
|
-
import { QtiPortableCustomInteraction } from '@qti-components/portable-custom-interaction/elements';
|
|
30
|
-
import { QtiSelectPointInteraction } from '@qti-components/select-point-interaction/elements';
|
|
31
|
-
import { QtiSliderInteraction } from '@qti-components/slider-interaction/elements';
|
|
32
|
-
import { QtiTextEntryInteraction } from '@qti-components/text-entry-interaction/elements';
|
|
33
11
|
import './config.context.d-BvU9r-Mg.js';
|
|
34
12
|
import './interaction.interface.d-CvjHM2bi.js';
|
|
35
13
|
import './item.types.d-QU7LljEK.js';
|
|
14
|
+
import './qti.context.d-CejJMlfZ.js';
|
|
15
|
+
import 'lit/directives/ref.js';
|
|
36
16
|
import './qti-feedback.d-DZbad0RN.js';
|
|
37
17
|
import './qti-rule-base.d-ajOnfGXY.js';
|
|
18
|
+
import './qti-transform-test.d-BL7GGFJj.js';
|
|
19
|
+
import '@heximal/templates';
|
|
20
|
+
import './qti-expression.d-BietT_8b.js';
|
|
38
21
|
|
|
39
22
|
type AbstractConstructor$2<T = {}> = abstract new (...args: any[]) => T;
|
|
40
23
|
declare enum Correctness {
|
|
@@ -179,7 +162,7 @@ declare class TestNavigationCorrection extends TestNavigation {
|
|
|
179
162
|
}
|
|
180
163
|
/** Test host extension that shows correct responses in scorer view. */
|
|
181
164
|
declare class QtiTestCorrection extends QtiTest {
|
|
182
|
-
updateAssessmentItemView(assessmentItem: QtiAssessmentItem
|
|
165
|
+
updateAssessmentItemView(assessmentItem: QtiAssessmentItem, view: View): void;
|
|
183
166
|
}
|
|
184
167
|
/** Check-item extension that reveals the correct response after scoring. */
|
|
185
168
|
declare class TestCheckItemCorrection extends TestCheckItem {
|
package/dist/corrections.js
CHANGED
|
@@ -34,16 +34,15 @@ import {
|
|
|
34
34
|
TestNavigationCorrection,
|
|
35
35
|
TestShowCorrectResponse,
|
|
36
36
|
correctionPart
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-H3J7LFRO.js";
|
|
37
|
+
} from "./chunk-CF3DXJWM.js";
|
|
38
|
+
import "./chunk-Q52IJELT.js";
|
|
39
|
+
import "./chunk-6XJUP55A.js";
|
|
40
|
+
import "./chunk-4XR2JHCP.js";
|
|
41
|
+
import "./chunk-TXIB3SKC.js";
|
|
42
|
+
import "./chunk-IYC7LZV6.js";
|
|
43
|
+
import "./chunk-4DB4SC5K.js";
|
|
44
|
+
import "./chunk-HDEG6BAZ.js";
|
|
45
|
+
import "./chunk-EKXZI26R.js";
|
|
47
46
|
export {
|
|
48
47
|
CandidateCorrectionMixin,
|
|
49
48
|
ChoiceCorrectionMixin,
|
package/dist/elements.d.ts
CHANGED
|
@@ -132,6 +132,35 @@ declare global {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
declare class QtiContentBody extends LitElement {
|
|
136
|
+
#private;
|
|
137
|
+
protected context?: ItemContext;
|
|
138
|
+
render(): lit.TemplateResult<1>;
|
|
139
|
+
connectedCallback(): void;
|
|
140
|
+
protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
141
|
+
}
|
|
142
|
+
declare global {
|
|
143
|
+
interface HTMLElementTagNameMap {
|
|
144
|
+
'qti-content-body': QtiContentBody;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @summary The qti-context-declaration element declares context variables for an item.
|
|
150
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.qti-context-declaration
|
|
151
|
+
*/
|
|
152
|
+
declare class QtiContextDeclaration extends LitElement {
|
|
153
|
+
identifier: string;
|
|
154
|
+
cardinality: 'single' | 'multiple' | 'ordered' | 'record';
|
|
155
|
+
static styles: lit.CSSResult[];
|
|
156
|
+
render(): lit.TemplateResult<1>;
|
|
157
|
+
}
|
|
158
|
+
declare global {
|
|
159
|
+
interface HTMLElementTagNameMap {
|
|
160
|
+
'qti-context-declaration': QtiContextDeclaration;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
135
164
|
/**
|
|
136
165
|
* https://www.imsglobal.org/spec/qti/v3p0/impl#h.fi29q8dubjgw
|
|
137
166
|
* <qti-custom-operator class="js.org">
|
|
@@ -178,20 +207,6 @@ declare global {
|
|
|
178
207
|
}
|
|
179
208
|
}
|
|
180
209
|
|
|
181
|
-
declare class QtiModalFeedback extends QtiFeedback {
|
|
182
|
-
static styles: lit.CSSResult;
|
|
183
|
-
render(): lit.TemplateResult<1>;
|
|
184
|
-
openFeedback(): void;
|
|
185
|
-
closeFeedback(): void;
|
|
186
|
-
connectedCallback(): void;
|
|
187
|
-
protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
188
|
-
}
|
|
189
|
-
declare global {
|
|
190
|
-
interface HTMLElementTagNameMap {
|
|
191
|
-
'qti-modal-feedback': QtiModalFeedback;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
210
|
/**
|
|
196
211
|
* @summary The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured.
|
|
197
212
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
|
|
@@ -212,80 +227,54 @@ declare global {
|
|
|
212
227
|
}
|
|
213
228
|
}
|
|
214
229
|
|
|
215
|
-
declare class
|
|
216
|
-
|
|
217
|
-
protected context?: ItemContext;
|
|
230
|
+
declare class QtiModalFeedback extends QtiFeedback {
|
|
231
|
+
static styles: lit.CSSResult;
|
|
218
232
|
render(): lit.TemplateResult<1>;
|
|
233
|
+
openFeedback(): void;
|
|
234
|
+
closeFeedback(): void;
|
|
219
235
|
connectedCallback(): void;
|
|
220
236
|
protected updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
221
237
|
}
|
|
222
238
|
declare global {
|
|
223
239
|
interface HTMLElementTagNameMap {
|
|
224
|
-
'qti-
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
declare class QtiRubricBlock extends LitElement {
|
|
229
|
-
id: string;
|
|
230
|
-
use: 'instructions' | 'scoring' | 'navigation';
|
|
231
|
-
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
232
|
-
classNames: string;
|
|
233
|
-
handleclassNamesChange(): void;
|
|
234
|
-
static styles: lit.CSSResult;
|
|
235
|
-
render(): lit.TemplateResult<1>;
|
|
236
|
-
}
|
|
237
|
-
declare global {
|
|
238
|
-
interface HTMLElementTagNameMap {
|
|
239
|
-
'qti-rubric-block': QtiRubricBlock;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
declare class QtiStylesheet extends LitElement {
|
|
244
|
-
#private;
|
|
245
|
-
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
246
|
-
disconnectedCallback(): void;
|
|
247
|
-
}
|
|
248
|
-
declare global {
|
|
249
|
-
interface HTMLElementTagNameMap {
|
|
250
|
-
'qti-stylesheet': QtiStylesheet;
|
|
240
|
+
'qti-modal-feedback': QtiModalFeedback;
|
|
251
241
|
}
|
|
252
242
|
}
|
|
253
243
|
|
|
254
|
-
declare class
|
|
255
|
-
#private;
|
|
244
|
+
declare class QtiOutcomeDeclaration extends QtiVariableDeclaration {
|
|
256
245
|
baseType: BaseType;
|
|
246
|
+
externalScored: 'human' | 'externalMachine' | null;
|
|
257
247
|
identifier: string;
|
|
258
248
|
cardinality: Cardinality;
|
|
259
249
|
itemContext?: ItemContext;
|
|
260
250
|
static styles: lit.CSSResult[];
|
|
261
251
|
render(): lit.TemplateResult<1>;
|
|
252
|
+
get interpolationTable(): Map<number, number> | null;
|
|
262
253
|
connectedCallback(): void;
|
|
263
254
|
}
|
|
264
255
|
declare global {
|
|
265
256
|
interface HTMLElementTagNameMap {
|
|
266
|
-
'qti-
|
|
257
|
+
'qti-outcome-declaration': QtiOutcomeDeclaration;
|
|
267
258
|
}
|
|
268
259
|
}
|
|
269
260
|
|
|
270
|
-
declare class
|
|
261
|
+
declare class QtiResponseDeclaration extends QtiVariableDeclaration {
|
|
262
|
+
#private;
|
|
271
263
|
baseType: BaseType;
|
|
272
|
-
externalScored: 'human' | 'externalMachine' | null;
|
|
273
264
|
identifier: string;
|
|
274
265
|
cardinality: Cardinality;
|
|
275
266
|
itemContext?: ItemContext;
|
|
276
267
|
static styles: lit.CSSResult[];
|
|
277
268
|
render(): lit.TemplateResult<1>;
|
|
278
|
-
get interpolationTable(): Map<number, number> | null;
|
|
279
269
|
connectedCallback(): void;
|
|
280
270
|
}
|
|
281
271
|
declare global {
|
|
282
272
|
interface HTMLElementTagNameMap {
|
|
283
|
-
'qti-
|
|
273
|
+
'qti-response-declaration': QtiResponseDeclaration;
|
|
284
274
|
}
|
|
285
275
|
}
|
|
286
276
|
|
|
287
277
|
declare class QtiResponseProcessing extends LitElement {
|
|
288
|
-
#private;
|
|
289
278
|
static styles: lit.CSSResult[];
|
|
290
279
|
render(): lit.TemplateResult<1>;
|
|
291
280
|
process(): void;
|
|
@@ -297,48 +286,29 @@ declare global {
|
|
|
297
286
|
}
|
|
298
287
|
}
|
|
299
288
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
cardinality: 'single' | 'multiple' | 'ordered' | 'record';
|
|
308
|
-
baseType: BaseType;
|
|
309
|
-
mathVariable: boolean;
|
|
310
|
-
paramVariable: boolean;
|
|
311
|
-
static styles: lit.CSSResult[];
|
|
289
|
+
declare class QtiRubricBlock extends LitElement {
|
|
290
|
+
id: string;
|
|
291
|
+
use: 'instructions' | 'scoring' | 'navigation';
|
|
292
|
+
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
293
|
+
classNames: string;
|
|
294
|
+
handleclassNamesChange(): void;
|
|
295
|
+
static styles: lit.CSSResult;
|
|
312
296
|
render(): lit.TemplateResult<1>;
|
|
313
|
-
connectedCallback(): void;
|
|
314
|
-
/**
|
|
315
|
-
* Get the template variable definition
|
|
316
|
-
*/
|
|
317
|
-
getTemplateVariable(): TemplateVariable;
|
|
318
297
|
}
|
|
319
298
|
declare global {
|
|
320
299
|
interface HTMLElementTagNameMap {
|
|
321
|
-
'qti-
|
|
300
|
+
'qti-rubric-block': QtiRubricBlock;
|
|
322
301
|
}
|
|
323
302
|
}
|
|
324
303
|
|
|
325
|
-
|
|
326
|
-
* @summary The qti-template-processing element contains template processing rules.
|
|
327
|
-
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing
|
|
328
|
-
*/
|
|
329
|
-
declare class QtiTemplateProcessing extends LitElement {
|
|
304
|
+
declare class QtiStylesheet extends LitElement {
|
|
330
305
|
#private;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Process template rules to set template variable values
|
|
335
|
-
*/
|
|
336
|
-
process(): void;
|
|
337
|
-
firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
306
|
+
protected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
307
|
+
disconnectedCallback(): void;
|
|
338
308
|
}
|
|
339
309
|
declare global {
|
|
340
310
|
interface HTMLElementTagNameMap {
|
|
341
|
-
'qti-
|
|
311
|
+
'qti-stylesheet': QtiStylesheet;
|
|
342
312
|
}
|
|
343
313
|
}
|
|
344
314
|
|
|
@@ -375,18 +345,47 @@ declare global {
|
|
|
375
345
|
}
|
|
376
346
|
|
|
377
347
|
/**
|
|
378
|
-
* @summary The qti-
|
|
379
|
-
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.
|
|
348
|
+
* @summary The qti-template-declaration element declares template variables for item cloning.
|
|
349
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration
|
|
380
350
|
*/
|
|
381
|
-
declare class
|
|
351
|
+
declare class QtiTemplateDeclaration extends LitElement {
|
|
352
|
+
#private;
|
|
382
353
|
identifier: string;
|
|
383
354
|
cardinality: 'single' | 'multiple' | 'ordered' | 'record';
|
|
355
|
+
baseType: BaseType;
|
|
356
|
+
mathVariable: boolean;
|
|
357
|
+
paramVariable: boolean;
|
|
384
358
|
static styles: lit.CSSResult[];
|
|
385
359
|
render(): lit.TemplateResult<1>;
|
|
360
|
+
connectedCallback(): void;
|
|
361
|
+
/**
|
|
362
|
+
* Get the template variable definition
|
|
363
|
+
*/
|
|
364
|
+
getTemplateVariable(): TemplateVariable;
|
|
386
365
|
}
|
|
387
366
|
declare global {
|
|
388
367
|
interface HTMLElementTagNameMap {
|
|
389
|
-
'qti-
|
|
368
|
+
'qti-template-declaration': QtiTemplateDeclaration;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* @summary The qti-template-processing element contains template processing rules.
|
|
374
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing
|
|
375
|
+
*/
|
|
376
|
+
declare class QtiTemplateProcessing extends LitElement {
|
|
377
|
+
#private;
|
|
378
|
+
static styles: lit.CSSResult[];
|
|
379
|
+
render(): lit.TemplateResult<1>;
|
|
380
|
+
/**
|
|
381
|
+
* Process template rules to set template variable values
|
|
382
|
+
*/
|
|
383
|
+
process(): void;
|
|
384
|
+
firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
385
|
+
}
|
|
386
|
+
declare global {
|
|
387
|
+
interface HTMLElementTagNameMap {
|
|
388
|
+
'qti-template-processing': QtiTemplateProcessing;
|
|
390
389
|
}
|
|
391
390
|
}
|
|
392
391
|
|