@citolab/qti-components 7.16.0 → 7.17.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.
Files changed (64) hide show
  1. package/dist/base.d.ts +48 -8
  2. package/dist/base.js +49 -2
  3. package/dist/base.js.map +1 -1
  4. package/dist/chunk-2DOYPVF5.js +481 -0
  5. package/dist/chunk-2DOYPVF5.js.map +1 -0
  6. package/dist/chunk-2ZEJ3RR5.js +89 -0
  7. package/dist/chunk-2ZEJ3RR5.js.map +1 -0
  8. package/dist/chunk-352OTVTY.js +3330 -0
  9. package/dist/chunk-352OTVTY.js.map +1 -0
  10. package/dist/chunk-C2HQFI2C.js +5927 -0
  11. package/dist/chunk-C2HQFI2C.js.map +1 -0
  12. package/dist/chunk-DWIRLYDS.js +20 -0
  13. package/dist/chunk-DWIRLYDS.js.map +1 -0
  14. package/dist/chunk-EUXUH3YW.js +15 -0
  15. package/dist/chunk-EUXUH3YW.js.map +1 -0
  16. package/dist/chunk-F44CI35W.js +145 -0
  17. package/dist/chunk-F44CI35W.js.map +1 -0
  18. package/dist/chunk-INKI27D5.js +493 -0
  19. package/dist/chunk-INKI27D5.js.map +1 -0
  20. package/dist/chunk-JEUY3MYB.js +2010 -0
  21. package/dist/chunk-JEUY3MYB.js.map +1 -0
  22. package/dist/chunk-O4XIWHTF.js +1139 -0
  23. package/dist/chunk-O4XIWHTF.js.map +1 -0
  24. package/dist/chunk-RI47B4ZT.js +1753 -0
  25. package/dist/chunk-RI47B4ZT.js.map +1 -0
  26. package/dist/chunk-VEV4DGPH.js +31 -0
  27. package/dist/chunk-VEV4DGPH.js.map +1 -0
  28. package/dist/chunk-W4SQRNWO.js +3844 -0
  29. package/dist/chunk-W4SQRNWO.js.map +1 -0
  30. package/dist/computed-item.context-CiddHLPz.d.ts +22 -0
  31. package/dist/computed.context-CH09_LCR.d.ts +45 -0
  32. package/dist/config.context-DAdkDDf5.d.ts +14 -0
  33. package/dist/elements.d.ts +318 -1
  34. package/dist/elements.js +41 -2
  35. package/dist/elements.js.map +1 -1
  36. package/dist/index.d.ts +21 -8
  37. package/dist/index.js +327 -9
  38. package/dist/index.js.map +1 -1
  39. package/dist/interaction-C5Up6-68.d.ts +56 -0
  40. package/dist/interactions.d.ts +913 -1
  41. package/dist/interactions.js +71 -2
  42. package/dist/interactions.js.map +1 -1
  43. package/dist/item.context-BRKXBC3m.d.ts +10 -0
  44. package/dist/item.d.ts +147 -1
  45. package/dist/item.js +22 -2
  46. package/dist/item.js.map +1 -1
  47. package/dist/loader.d.ts +21 -1
  48. package/dist/loader.js +10 -2
  49. package/dist/loader.js.map +1 -1
  50. package/dist/processing.d.ts +393 -1
  51. package/dist/processing.js +102 -2
  52. package/dist/processing.js.map +1 -1
  53. package/dist/qti-feedback-B4cMzOcq.d.ts +21 -0
  54. package/dist/qti-rule-base-dL4opfvi.d.ts +39 -0
  55. package/dist/qti-transform-test-Bz9A3hmD.d.ts +63 -0
  56. package/dist/test.context-Bpw1HNAZ.d.ts +28 -0
  57. package/dist/test.d.ts +569 -1
  58. package/dist/test.js +60 -2
  59. package/dist/test.js.map +1 -1
  60. package/dist/transformers.d.ts +18 -1
  61. package/dist/transformers.js +11 -2
  62. package/dist/transformers.js.map +1 -1
  63. package/dist/variables-CusMRnyJ.d.ts +69 -0
  64. package/package.json +8 -14
package/dist/base.d.ts CHANGED
@@ -1,8 +1,48 @@
1
- export * from '@qti-components/base';
2
- import '@qti-components/elements';
3
- import '@qti-components/test';
4
- import '@qti-components/item';
5
- import '@qti-components/interactions';
6
- import '@qti-components/transformers';
7
- import '@qti-components/loader';
8
- import '@qti-components/processing';
1
+ export { C as ComputedItemContext, c as computedItemContext } from './computed-item.context-CiddHLPz.js';
2
+ export { a as ComputedContext, C as ComputedItem, I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, c as computedContext, s as sessionContext } from './computed.context-CH09_LCR.js';
3
+ export { a as ConfigContext, C as CorrectResponseMode, c as configContext } from './config.context-DAdkDDf5.js';
4
+ import { I as ItemContext } from './item.context-BRKXBC3m.js';
5
+ export { i as itemContextVariables } from './item.context-BRKXBC3m.js';
6
+ export { I as INITIAL_TEST_CONTEXT, a as QtiContext, Q as QtiContextType, T as TestContext, q as qtiContext, t as testContext } from './test.context-Bpw1HNAZ.js';
7
+ export { C as Correctness, a as IInteraction, I as Interaction } from './interaction-C5Up6-68.js';
8
+ export { a as QtiFeedback, Q as QtiVariableDeclaration } from './qti-feedback-B4cMzOcq.js';
9
+ export { Q as QtiConditionExpression, b as QtiExpression, a as QtiExpressionBase, c as QtiRuleBase, d as QtiRuleElement } from './qti-rule-base-dL4opfvi.js';
10
+ import { B as BaseType } from './variables-CusMRnyJ.js';
11
+ export { C as Calculate, a as Cardinality, M as Multiple, O as Ordered, j as OutcomeVariable, b as QtiAreaMapEntry, Q as QtiAreaMapping, e as QtiMapEntry, c as QtiMapping, R as ResponseInteraction, k as ResponseVariable, T as TemplateVariable, h as VariableDeclaration, V as VariableValue, g as areaShape, d as directedPair, f as float, i as integer } from './variables-CusMRnyJ.js';
12
+ import 'lit';
13
+
14
+ declare const itemContext: {
15
+ __context__: ItemContext;
16
+ };
17
+
18
+ declare class ScoringHelper {
19
+ /**
20
+ * Checks if a given point is within a specified area.
21
+ * @param point The point to test, represented as a string "x y" (e.g., "102 113").
22
+ * @param areaKey The area definition, including shape and coordinates (e.g., "circle,102,113,16").
23
+ * @param baseType The base type of the response, must be "point" for this method to proceed.
24
+ * @returns True if the point is within the area; false otherwise.
25
+ */
26
+ static isPointInArea(point: string, areaKey: string, baseType: string): boolean;
27
+ /**
28
+ * Checks if a point is inside a polygon using the ray-casting algorithm.
29
+ * @param point The point to test.
30
+ * @param vertices The vertices of the polygon in order (array of {x, y} objects).
31
+ * @returns True if the point is inside the polygon; false otherwise.
32
+ */
33
+ static isPointInPolygon(point: {
34
+ x: number;
35
+ y: number;
36
+ }, vertices: {
37
+ x: number;
38
+ y: number;
39
+ }[]): boolean;
40
+ static compareSingleValues(value1: Readonly<string>, value2: Readonly<string>, baseType: BaseType): boolean;
41
+ }
42
+
43
+ declare const decimalSeparator: () => string;
44
+ declare const convertNumberToUniversalFormat: (number: number | string) => string;
45
+ declare function IsNullOrUndefined(value: unknown): boolean;
46
+ declare function removeDoubleSlashes(str: string): string;
47
+
48
+ export { BaseType, IsNullOrUndefined, ItemContext, ScoringHelper, convertNumberToUniversalFormat, decimalSeparator, itemContext, removeDoubleSlashes };
package/dist/base.js CHANGED
@@ -1,3 +1,50 @@
1
- // src/base.ts
2
- export * from "@qti-components/base";
1
+ import {
2
+ Correctness,
3
+ INITIAL_SESSION_CONTEXT,
4
+ INITIAL_TEST_CONTEXT,
5
+ Interaction,
6
+ IsNullOrUndefined,
7
+ QtiConditionExpression,
8
+ QtiExpression,
9
+ QtiFeedback,
10
+ QtiRuleElement,
11
+ QtiVariableDeclaration,
12
+ ScoringHelper,
13
+ computedContext,
14
+ computedItemContext,
15
+ configContext,
16
+ convertNumberToUniversalFormat,
17
+ decimalSeparator,
18
+ itemContext,
19
+ itemContextVariables,
20
+ qtiContext,
21
+ removeDoubleSlashes,
22
+ sessionContext,
23
+ testContext
24
+ } from "./chunk-JEUY3MYB.js";
25
+ import "./chunk-EUXUH3YW.js";
26
+ export {
27
+ Correctness,
28
+ INITIAL_SESSION_CONTEXT,
29
+ INITIAL_TEST_CONTEXT,
30
+ Interaction,
31
+ IsNullOrUndefined,
32
+ QtiConditionExpression,
33
+ QtiExpression,
34
+ QtiFeedback,
35
+ QtiRuleElement,
36
+ QtiVariableDeclaration,
37
+ ScoringHelper,
38
+ computedContext,
39
+ computedItemContext,
40
+ configContext,
41
+ convertNumberToUniversalFormat,
42
+ decimalSeparator,
43
+ itemContext,
44
+ itemContextVariables,
45
+ qtiContext,
46
+ removeDoubleSlashes,
47
+ sessionContext,
48
+ testContext
49
+ };
3
50
  //# sourceMappingURL=base.js.map
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/base.ts"],"sourcesContent":["export * from '@qti-components/base';\n"],"mappings":";AAAA,cAAc;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,481 @@
1
+ import {
2
+ item_default,
3
+ m
4
+ } from "./chunk-W4SQRNWO.js";
5
+ import {
6
+ watch
7
+ } from "./chunk-2ZEJ3RR5.js";
8
+ import {
9
+ qtiTransformItem
10
+ } from "./chunk-INKI27D5.js";
11
+ import {
12
+ c,
13
+ computedItemContext,
14
+ configContext,
15
+ e,
16
+ i,
17
+ i2,
18
+ n,
19
+ r,
20
+ t,
21
+ x
22
+ } from "./chunk-JEUY3MYB.js";
23
+ import {
24
+ __decorateClass
25
+ } from "./chunk-EUXUH3YW.js";
26
+
27
+ // ../qti-item/src/components/item-container/item-container.ts
28
+ var ItemContainer = class extends i2 {
29
+ constructor() {
30
+ super(...arguments);
31
+ this.itemURL = null;
32
+ this.itemDoc = null;
33
+ this.itemXML = null;
34
+ /** Template content if provided */
35
+ this.templateContent = null;
36
+ }
37
+ async handleItemURLChange() {
38
+ if (!this.itemURL) return;
39
+ try {
40
+ const api = await qtiTransformItem().load(this.itemURL);
41
+ this.itemDoc = api.htmlDoc();
42
+ } catch (error) {
43
+ console.error("Error loading or parsing XML:", error);
44
+ }
45
+ }
46
+ handleItemXMLChange() {
47
+ if (!this.itemXML) return;
48
+ try {
49
+ this.itemDoc = qtiTransformItem().parse(this.itemXML).htmlDoc();
50
+ } catch (error) {
51
+ console.error("Error parsing XML:", error);
52
+ }
53
+ }
54
+ async connectedCallback() {
55
+ super.connectedCallback();
56
+ this.initializeTemplateContent();
57
+ this.applyStyles();
58
+ if (this.itemURL) {
59
+ this.handleItemURLChange();
60
+ }
61
+ if (this.itemXML) {
62
+ this.handleItemXMLChange();
63
+ }
64
+ }
65
+ initializeTemplateContent() {
66
+ const template = this.querySelector("template");
67
+ this.templateContent = template ? template.content : x``;
68
+ }
69
+ applyStyles() {
70
+ const sheet = new CSSStyleSheet();
71
+ sheet.replaceSync(item_default);
72
+ this.shadowRoot.adoptedStyleSheets = [sheet];
73
+ }
74
+ render() {
75
+ return x`
76
+ ${this.templateContent}
77
+ <slot></slot>
78
+ ${m(this.itemDoc, x`<span>Loading...</span>`)}
79
+ `;
80
+ }
81
+ };
82
+ __decorateClass([
83
+ n({ type: String, attribute: "item-url" })
84
+ ], ItemContainer.prototype, "itemURL", 2);
85
+ __decorateClass([
86
+ r()
87
+ ], ItemContainer.prototype, "itemDoc", 2);
88
+ __decorateClass([
89
+ r()
90
+ ], ItemContainer.prototype, "itemXML", 2);
91
+ __decorateClass([
92
+ watch("itemURL", { waitUntilFirstUpdate: true })
93
+ ], ItemContainer.prototype, "handleItemURLChange", 1);
94
+ __decorateClass([
95
+ watch("itemXML", { waitUntilFirstUpdate: true })
96
+ ], ItemContainer.prototype, "handleItemXMLChange", 1);
97
+ ItemContainer = __decorateClass([
98
+ t("item-container")
99
+ ], ItemContainer);
100
+
101
+ // ../qti-item/src/components/item-correct-response-mode/item-correct-response-mode.ts
102
+ var ItemCorrectResponseMode = class extends i2 {
103
+ constructor() {
104
+ super(...arguments);
105
+ this.label = "Correct response mode";
106
+ this._options = {
107
+ internal: "Internal",
108
+ full: "Full (copy)"
109
+ };
110
+ }
111
+ _switchMode(view) {
112
+ this.dispatchEvent(
113
+ new CustomEvent("item-switch-correct-response-mode", {
114
+ detail: view,
115
+ bubbles: true
116
+ })
117
+ );
118
+ }
119
+ render() {
120
+ return x`
121
+ <label part="label" for="modeSelect">${this.label}</label>
122
+ <select
123
+ part="select"
124
+ id="modeSelect"
125
+ @change=${(e2) => {
126
+ const el = e2.target;
127
+ this._switchMode(el.value);
128
+ }}
129
+ >
130
+ ${Object.keys(this._options).map(
131
+ (value) => x`<option value="${value}" ?selected=${value === this.itemContext?.correctResponseMode}>
132
+ ${this._options[value]}
133
+ </option>`
134
+ )}
135
+ </select>
136
+ `;
137
+ }
138
+ };
139
+ __decorateClass([
140
+ c({ context: configContext, subscribe: true })
141
+ ], ItemCorrectResponseMode.prototype, "itemContext", 2);
142
+ __decorateClass([
143
+ n({ type: String })
144
+ ], ItemCorrectResponseMode.prototype, "label", 2);
145
+ __decorateClass([
146
+ r()
147
+ ], ItemCorrectResponseMode.prototype, "_options", 2);
148
+ ItemCorrectResponseMode = __decorateClass([
149
+ t("item-correct-response-mode")
150
+ ], ItemCorrectResponseMode);
151
+
152
+ // ../qti-item/src/components/styles.ts
153
+ var form = i`
154
+ display: inline-flex;
155
+ align-items: center;
156
+ cursor: pointer;
157
+ padding: 0.5rem 1rem;
158
+ border-radius: 0.25rem;
159
+ user-select: none;
160
+ `;
161
+ var btn = i`
162
+ background-color: lightgray;
163
+ ${form};
164
+ `;
165
+ var dis = i`
166
+ cursor: not-allowed;
167
+ opacity: 0.8;
168
+ `;
169
+ var ind = i`
170
+ ${form};
171
+ border: 1px solid gray;
172
+ `;
173
+
174
+ // ../qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.ts
175
+ var ItemShowCandidateCorrection = class extends i2 {
176
+ // Store previous active item reference
177
+ constructor() {
178
+ super();
179
+ this.shown = false;
180
+ this.disabled = false;
181
+ this.showCandidateCorrectionText = "Show candidate correction";
182
+ this.hideCandidateCorrectionText = "Hide candidate correction";
183
+ this.noCorrectResponseText = "No correct response specified";
184
+ this._hasCorrectResponse = false;
185
+ // correct response is removed on certain point
186
+ this._previousActiveItem = "";
187
+ }
188
+ updated() {
189
+ if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {
190
+ this._previousActiveItem = this.computedContext?.identifier;
191
+ const containsCorrectResponse = !!this.computedContext?.variables.some((v) => v["correctResponse"]);
192
+ const containsMapping = !!this.computedContext?.variables.some((v) => {
193
+ return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
194
+ });
195
+ this._hasCorrectResponse = containsCorrectResponse || containsMapping;
196
+ }
197
+ this.disabled = !this._hasCorrectResponse;
198
+ }
199
+ _toggleState() {
200
+ if (this.disabled) return;
201
+ this.dispatchEvent(
202
+ new CustomEvent("item-show-candidate-correction", {
203
+ detail: !this.shown,
204
+ bubbles: true
205
+ })
206
+ );
207
+ }
208
+ _getDisplayedText() {
209
+ return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCandidateCorrectionText : this.showCandidateCorrectionText;
210
+ }
211
+ render() {
212
+ return x` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `;
213
+ }
214
+ };
215
+ ItemShowCandidateCorrection.styles = i`
216
+ :host {
217
+ ${btn};
218
+ }
219
+ :host([disabled]) {
220
+ ${dis};
221
+ }
222
+ `;
223
+ __decorateClass([
224
+ c({ context: computedItemContext, subscribe: true })
225
+ ], ItemShowCandidateCorrection.prototype, "computedContext", 2);
226
+ __decorateClass([
227
+ n({ type: Boolean, reflect: true })
228
+ ], ItemShowCandidateCorrection.prototype, "shown", 2);
229
+ __decorateClass([
230
+ n({ type: Boolean, reflect: true })
231
+ ], ItemShowCandidateCorrection.prototype, "disabled", 2);
232
+ __decorateClass([
233
+ n({ type: String })
234
+ ], ItemShowCandidateCorrection.prototype, "showCandidateCorrectionText", 2);
235
+ __decorateClass([
236
+ n({ type: String })
237
+ ], ItemShowCandidateCorrection.prototype, "hideCandidateCorrectionText", 2);
238
+ __decorateClass([
239
+ n({ type: String })
240
+ ], ItemShowCandidateCorrection.prototype, "noCorrectResponseText", 2);
241
+ ItemShowCandidateCorrection = __decorateClass([
242
+ t("item-show-candidate-correction")
243
+ ], ItemShowCandidateCorrection);
244
+
245
+ // ../qti-item/src/components/item-show-correct-response/item-show-correct-response.ts
246
+ var ItemShowCorrectResponse = class extends i2 {
247
+ constructor() {
248
+ super(...arguments);
249
+ this.shown = false;
250
+ this.disabled = false;
251
+ this.showCorrectText = "Show correct response";
252
+ this.hideCorrectText = "Hide correct response";
253
+ this.noCorrectResponseText = "No correct response specified";
254
+ this._hasCorrectResponse = false;
255
+ // correct response is removed on certain point
256
+ this._previousActiveItem = "";
257
+ }
258
+ // Store previous active item reference
259
+ updated() {
260
+ if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {
261
+ this._previousActiveItem = this.computedContext?.identifier;
262
+ const containsCorrectResponse = !!this.computedContext?.variables.some((v) => v["correctResponse"]);
263
+ const containsMapping = !!this.computedContext?.variables.some((v) => {
264
+ return v["mapping"]?.mapEntries?.length > 0 || v["areaMapping"]?.areaMapEntries?.length > 0;
265
+ });
266
+ this._hasCorrectResponse = containsCorrectResponse || containsMapping;
267
+ }
268
+ this.disabled = !this._hasCorrectResponse;
269
+ }
270
+ _toggleState() {
271
+ if (this.disabled) return;
272
+ this.dispatchEvent(
273
+ new CustomEvent("item-show-correct-response", {
274
+ detail: !this.shown,
275
+ bubbles: true
276
+ })
277
+ );
278
+ }
279
+ _getDisplayedText() {
280
+ return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;
281
+ }
282
+ render() {
283
+ return x` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `;
284
+ }
285
+ };
286
+ ItemShowCorrectResponse.styles = i`
287
+ :host {
288
+ ${btn};
289
+ }
290
+ :host([disabled]) {
291
+ ${dis};
292
+ }
293
+ `;
294
+ __decorateClass([
295
+ c({ context: computedItemContext, subscribe: true })
296
+ ], ItemShowCorrectResponse.prototype, "computedContext", 2);
297
+ __decorateClass([
298
+ n({ type: Boolean, reflect: true })
299
+ ], ItemShowCorrectResponse.prototype, "shown", 2);
300
+ __decorateClass([
301
+ n({ type: Boolean, reflect: true })
302
+ ], ItemShowCorrectResponse.prototype, "disabled", 2);
303
+ __decorateClass([
304
+ n({ type: String })
305
+ ], ItemShowCorrectResponse.prototype, "showCorrectText", 2);
306
+ __decorateClass([
307
+ n({ type: String })
308
+ ], ItemShowCorrectResponse.prototype, "hideCorrectText", 2);
309
+ __decorateClass([
310
+ n({ type: String })
311
+ ], ItemShowCorrectResponse.prototype, "noCorrectResponseText", 2);
312
+ ItemShowCorrectResponse = __decorateClass([
313
+ t("item-show-correct-response")
314
+ ], ItemShowCorrectResponse);
315
+
316
+ // ../qti-item/src/components/item-print-variables/item-print-variables.ts
317
+ var ItemPrintVariables = class extends i2 {
318
+ render() {
319
+ const activeItem = this.computedContext;
320
+ if (!activeItem || !activeItem.variables) return x``;
321
+ const responseVariables = activeItem.variables.filter((v) => v.type === "response");
322
+ const outcomeVariables = activeItem.variables.filter((v) => v.type === "outcome");
323
+ const renderTable = (variables, title) => x`
324
+ <h3>${title}</h3>
325
+ <table>
326
+ <thead>
327
+ <tr>
328
+ <th>Identifier</th>
329
+ <th>Value</th>
330
+ <th>Cardinality</th>
331
+ <th>Base Type</th>
332
+ <th>Correct Response / Mappings</th>
333
+ </tr>
334
+ </thead>
335
+ <tbody>
336
+ ${variables.map((v) => {
337
+ const correctResponse = v.correctResponse ? Array.isArray(v.correctResponse) ? v.correctResponse.join(", ") : v.correctResponse : "";
338
+ const mapEntries = v.mapping?.mapEntries?.map((m2) => `${m2.mapKey}=${m2.mappedValue}pt`).join(", ") || "";
339
+ const areaMapEntries = v.areaMapping?.areaMapEntries?.map((m2) => `${m2.shape}(${m2.coords})=${m2.mappedValue}pt`).join(", ") || "";
340
+ return x`
341
+ <tr>
342
+ <td>${v.identifier}</td>
343
+ <td>${Array.isArray(v.value) ? v.value.join(", ") : v.value}</td>
344
+ <td>${v.cardinality}</td>
345
+ <td>${v.baseType}</td>
346
+ <td>${correctResponse || mapEntries || areaMapEntries}</td>
347
+ </tr>
348
+ `;
349
+ })}
350
+ </tbody>
351
+ </table>
352
+ `;
353
+ return x`
354
+ ${renderTable(responseVariables, "Response Variables")} ${renderTable(outcomeVariables, "Outcome Variables")}
355
+ `;
356
+ }
357
+ };
358
+ ItemPrintVariables.styles = i`
359
+ table {
360
+ width: 100%;
361
+ border-collapse: collapse;
362
+ margin: 20px 0;
363
+ font-size: 14px;
364
+ text-align: left;
365
+ }
366
+ th,
367
+ td {
368
+ border: 1px solid #ddd;
369
+ padding: 8px;
370
+ }
371
+ th {
372
+ background-color: #f4f4f4;
373
+ font-weight: bold;
374
+ }
375
+ h3 {
376
+ margin-top: 20px;
377
+ font-size: 16px;
378
+ }
379
+ `;
380
+ __decorateClass([
381
+ c({ context: computedItemContext, subscribe: true })
382
+ ], ItemPrintVariables.prototype, "computedContext", 2);
383
+ ItemPrintVariables = __decorateClass([
384
+ t("item-print-variables")
385
+ ], ItemPrintVariables);
386
+
387
+ // ../qti-item/src/components/qti-item/qti-item.ts
388
+ var QtiItem = class extends i2 {
389
+ constructor() {
390
+ super();
391
+ this.configContext = {};
392
+ // Store event handlers as instance properties
393
+ this._onItemContextChanged = this._handleItemContextChanged.bind(this);
394
+ this._onAssessmentItemConnected = this._handleAssessmentItemConnected.bind(this);
395
+ this._onHandleShowCorrectResponse = this._handleShowCorrectResponse.bind(this);
396
+ this._onHandleShowCandidateCorrection = this._handleShowCandidateCorrection.bind(this);
397
+ this._onHandleSwitchCorrectResponseMode = this._handleSwitchCorrectResponseMode.bind(this);
398
+ this.addEventListener("qti-item-context-updated", this._onItemContextChanged);
399
+ this.addEventListener("qti-assessment-item-connected", this._onAssessmentItemConnected);
400
+ this.addEventListener("item-show-correct-response", this._onHandleShowCorrectResponse);
401
+ this.addEventListener("item-show-candidate-correction", this._onHandleShowCandidateCorrection);
402
+ this.addEventListener("item-switch-correct-response-mode", this._onHandleSwitchCorrectResponseMode);
403
+ }
404
+ _handleItemContextChanged(e2) {
405
+ this._updateItemVariablesInTestContext(e2.detail.itemContext.identifier, e2.detail?.itemContext?.variables || []);
406
+ }
407
+ _handleAssessmentItemConnected(e2) {
408
+ const fullVariables = e2.detail._context.variables;
409
+ this._qtiAssessmentItem = e2.detail;
410
+ this.computedContext = this.computedContext?.identifier === this._qtiAssessmentItem.identifier ? { ...this.computedContext, title: this._qtiAssessmentItem.title } : {
411
+ identifier: this._qtiAssessmentItem.identifier,
412
+ title: this._qtiAssessmentItem.title,
413
+ adaptive: this._qtiAssessmentItem.getAttribute("adaptive")?.toLowerCase() === "true" || false,
414
+ variables: fullVariables,
415
+ correctResponseMode: "internal"
416
+ };
417
+ this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier, fullVariables || []);
418
+ }
419
+ _handleShowCorrectResponse(e2) {
420
+ if (this._qtiAssessmentItem) {
421
+ this._qtiAssessmentItem.showCorrectResponse(e2.detail);
422
+ }
423
+ }
424
+ _handleShowCandidateCorrection(e2) {
425
+ if (this._qtiAssessmentItem) {
426
+ this._qtiAssessmentItem.showCandidateCorrection(e2.detail);
427
+ }
428
+ }
429
+ _handleSwitchCorrectResponseMode(e2) {
430
+ this._handleShowCorrectResponse(new CustomEvent("item-show-correct-response", { detail: false, bubbles: true }));
431
+ this.configContext = {
432
+ ...this.configContext,
433
+ correctResponseMode: e2.detail
434
+ };
435
+ }
436
+ _updateItemVariablesInTestContext(identifier, variables) {
437
+ const rawscore = variables?.find((vr) => vr.identifier == "SCORE")?.value;
438
+ const score = parseFloat(rawscore?.toString());
439
+ const completionStatus = variables?.find((v) => v.identifier === "completionStatus")?.value;
440
+ const correct = score !== void 0 && !isNaN(score) && score > 0;
441
+ const incorrect = score !== void 0 && !isNaN(score) && score <= 0;
442
+ const completed = completionStatus === "completed";
443
+ this.computedContext = {
444
+ ...this.computedContext,
445
+ identifier,
446
+ correct,
447
+ incorrect,
448
+ completed,
449
+ variables
450
+ };
451
+ }
452
+ render() {
453
+ return x`<slot></slot>`;
454
+ }
455
+ disconnectedCallback() {
456
+ super.disconnectedCallback();
457
+ this.removeEventListener("qti-item-context-changed", this._onItemContextChanged);
458
+ this.removeEventListener("qti-assessment-item-connected", this._onAssessmentItemConnected);
459
+ }
460
+ };
461
+ __decorateClass([
462
+ r(),
463
+ e({ context: computedItemContext })
464
+ ], QtiItem.prototype, "computedContext", 2);
465
+ __decorateClass([
466
+ r(),
467
+ e({ context: configContext })
468
+ ], QtiItem.prototype, "configContext", 2);
469
+ QtiItem = __decorateClass([
470
+ t("qti-item")
471
+ ], QtiItem);
472
+
473
+ export {
474
+ ItemContainer,
475
+ ItemCorrectResponseMode,
476
+ ItemShowCandidateCorrection,
477
+ ItemShowCorrectResponse,
478
+ ItemPrintVariables,
479
+ QtiItem
480
+ };
481
+ //# sourceMappingURL=chunk-2DOYPVF5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../qti-item/src/components/item-container/item-container.ts","../../qti-item/src/components/item-correct-response-mode/item-correct-response-mode.ts","../../qti-item/src/components/styles.ts","../../qti-item/src/components/item-show-candidate-correction/item-show-candidate-correction.ts","../../qti-item/src/components/item-show-correct-response/item-show-correct-response.ts","../../qti-item/src/components/item-print-variables/item-print-variables.ts","../../qti-item/src/components/qti-item/qti-item.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\n\nimport { watch } from '@qti-components/utilities';\nimport { qtiTransformItem } from '@qti-components/transformers';\nimport itemCss from '@qti-components/theme/src/item.css?inline';\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@customElement('item-container')\nexport class ItemContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'item-url' })\n itemURL: string = null;\n\n /** A parsed HTML document */\n @state()\n itemDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n itemXML: string = null;\n\n /** Template content if provided */\n private templateContent: unknown = null;\n\n @watch('itemURL', { waitUntilFirstUpdate: true })\n protected async handleItemURLChange() {\n if (!this.itemURL) return;\n try {\n const api = await qtiTransformItem().load(this.itemURL);\n this.itemDoc = api.htmlDoc();\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().parse(this.itemXML).htmlDoc();\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 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 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 { html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { configContext } from '@qti-components/base';\n\nimport type { ConfigContext, CorrectResponseMode } from '@qti-components/base';\n\n@customElement('item-correct-response-mode')\nexport class ItemCorrectResponseMode extends LitElement {\n @consume({ context: configContext, subscribe: true })\n private itemContext: ConfigContext;\n\n @property({ type: String })\n label = 'Correct response mode';\n\n @state()\n private _options = {\n internal: 'Internal',\n full: 'Full (copy)'\n };\n\n private _switchMode(view: CorrectResponseMode) {\n this.dispatchEvent(\n new CustomEvent('item-switch-correct-response-mode', {\n detail: view,\n bubbles: true\n })\n );\n }\n\n override render() {\n return html`\n <label part=\"label\" for=\"modeSelect\">${this.label}</label>\n <select\n part=\"select\"\n id=\"modeSelect\"\n @change=${(e: Event) => {\n const el = e.target as HTMLSelectElement;\n this._switchMode(el.value as CorrectResponseMode);\n }}\n >\n ${Object.keys(this._options).map(\n value =>\n html`<option value=\"${value}\" ?selected=${value === this.itemContext?.correctResponseMode}>\n ${this._options[value as keyof typeof this._options]}\n </option>`\n )}\n </select>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-correct-response-mode': ItemCorrectResponseMode;\n }\n}\n","import { 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.8;\n`;\n\nexport const ind = css`\n ${form};\n border: 1px solid gray;\n`;\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedItemContext } from '@qti-components/base';\n\n@customElement('item-show-candidate-correction')\nexport class ItemShowCandidateCorrection extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCandidateCorrectionText = 'Show candidate correction';\n @property({ type: String }) hideCandidateCorrectionText = 'Hide candidate correction';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n private _hasCorrectResponse = false; // correct response is removed on certain point\n private _previousActiveItem = ''; // Store previous active item reference\n\n constructor() {\n super();\n }\n\n override updated() {\n if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {\n this._previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => (v as any)['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return (v as any)['mapping']?.mapEntries?.length > 0 || (v as any)['areaMapping']?.areaMapEntries?.length > 0;\n });\n this._hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this._hasCorrectResponse;\n }\n\n private _toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-candidate-correction', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n private _getDisplayedText(): string {\n return this.disabled\n ? this.noCorrectResponseText\n : this.shown\n ? this.hideCandidateCorrectionText\n : this.showCandidateCorrectionText;\n }\n\n override render() {\n return html` <div @click=\"${this._toggleState}\">${this._getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-candidate-correction': ItemShowCandidateCorrection;\n }\n}\n","import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport * as styles from '../styles';\n\nimport type { ComputedItemContext } from '@qti-components/base';\n\n@customElement('item-show-correct-response')\nexport class ItemShowCorrectResponse extends LitElement {\n @consume({ context: computedItemContext, subscribe: true })\n public computedContext?: ComputedItemContext;\n\n static override styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: Boolean, reflect: true }) shown = false;\n @property({ type: Boolean, reflect: true }) disabled = false; // Reflects to `disabled` attribute\n @property({ type: String }) showCorrectText = 'Show correct response';\n @property({ type: String }) hideCorrectText = 'Hide correct response';\n @property({ type: String }) noCorrectResponseText = 'No correct response specified';\n\n private _hasCorrectResponse = false; // correct response is removed on certain point\n private _previousActiveItem = ''; // Store previous active item reference\n\n override updated() {\n if (!this._hasCorrectResponse || this._previousActiveItem !== this.computedContext?.identifier) {\n this._previousActiveItem = this.computedContext?.identifier;\n const containsCorrectResponse = !!this.computedContext?.variables.some(v => (v as any)['correctResponse']);\n const containsMapping = !!this.computedContext?.variables.some(v => {\n return (v as any)['mapping']?.mapEntries?.length > 0 || (v as any)['areaMapping']?.areaMapEntries?.length > 0;\n });\n this._hasCorrectResponse = containsCorrectResponse || containsMapping;\n }\n this.disabled = !this._hasCorrectResponse;\n }\n\n private _toggleState() {\n if (this.disabled) return; // Prevent toggle if disabled\n\n this.dispatchEvent(\n new CustomEvent('item-show-correct-response', {\n detail: !this.shown,\n bubbles: true\n })\n );\n }\n\n private _getDisplayedText(): string {\n return this.disabled ? this.noCorrectResponseText : this.shown ? this.hideCorrectText : this.showCorrectText;\n }\n\n override render() {\n return html` <div @click=\"${this._toggleState}\">${this._getDisplayedText()}</div> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'item-show-correct-response': ItemShowCorrectResponse;\n }\n}\n","import { consume } from '@lit/context';\nimport { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport { computedItemContext } from '@qti-components/base';\n\nimport type { ResponseVariable } from '@qti-components/base';\nimport type { ComputedItemContext } from '@qti-components/base';\n\n@customElement('item-print-variables')\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 { customElement, state } from 'lit/decorators.js';\n\nimport { computedItemContext } from '@qti-components/base';\nimport { configContext } from '@qti-components/base';\n\nimport type { QtiAssessmentItem } from '@qti-components/elements';\nimport type { ConfigContext, CorrectResponseMode } 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@customElement('qti-item')\nexport class QtiItem extends LitElement {\n @state()\n @provide({ context: computedItemContext })\n public computedContext: ComputedItemContext;\n private _qtiAssessmentItem?: QtiAssessmentItem;\n\n @state()\n @provide({ context: configContext })\n public configContext: ConfigContext = {};\n\n // Store event handlers as instance properties\n private _onItemContextChanged = this._handleItemContextChanged.bind(this);\n private _onAssessmentItemConnected = this._handleAssessmentItemConnected.bind(this);\n\n private _onHandleShowCorrectResponse = this._handleShowCorrectResponse.bind(this);\n private _onHandleShowCandidateCorrection = this._handleShowCandidateCorrection.bind(this);\n private _onHandleSwitchCorrectResponseMode = this._handleSwitchCorrectResponseMode.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 this.addEventListener('item-show-correct-response', this._onHandleShowCorrectResponse);\n this.addEventListener('item-show-candidate-correction', this._onHandleShowCandidateCorrection);\n this.addEventListener('item-switch-correct-response-mode', this._onHandleSwitchCorrectResponseMode);\n }\n\n private _handleItemContextChanged(e: CustomEvent<{ itemContext: ItemContext }>) {\n this._updateItemVariablesInTestContext(e.detail.itemContext.identifier, e.detail?.itemContext?.variables || []);\n }\n\n private _handleAssessmentItemConnected(e: CustomEvent<QtiAssessmentItem>) {\n const fullVariables = (e.detail as any)._context.variables;\n this._qtiAssessmentItem = e.detail;\n this.computedContext =\n this.computedContext?.identifier === this._qtiAssessmentItem.identifier\n ? { ...this.computedContext, title: this._qtiAssessmentItem.title }\n : ({\n identifier: this._qtiAssessmentItem.identifier,\n title: this._qtiAssessmentItem.title,\n adaptive: this._qtiAssessmentItem.getAttribute('adaptive')?.toLowerCase() === 'true' || false,\n variables: fullVariables,\n correctResponseMode: 'internal'\n } as ComputedItemContext);\n this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier, fullVariables || []);\n }\n\n private _handleShowCorrectResponse(e: CustomEvent<boolean>) {\n if (this._qtiAssessmentItem) {\n this._qtiAssessmentItem.showCorrectResponse(e.detail);\n }\n }\n\n private _handleShowCandidateCorrection(e: CustomEvent<boolean>) {\n if (this._qtiAssessmentItem) {\n this._qtiAssessmentItem.showCandidateCorrection(e.detail);\n }\n }\n\n private _handleSwitchCorrectResponseMode(e: CustomEvent<CorrectResponseMode>) {\n // Switch off the correct response first\n this._handleShowCorrectResponse(new CustomEvent('item-show-correct-response', { detail: false, bubbles: true }));\n\n this.configContext = {\n ...this.configContext,\n correctResponseMode: e.detail\n };\n }\n\n private _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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBO,IAAM,gBAAN,cAA4BA,GAAW;AAAA,EAAvC;AAAA;AAGL,mBAAkB;AAIlB,mBAA4B;AAI5B,mBAAkB;AAGlB;AAAA,SAAQ,kBAA2B;AAAA;AAAA,EAGnC,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,S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