@qti-components/elements 1.8.0 → 1.9.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/dist/components/qti-assessment-item/qti-assessment-item.d.ts +15 -2
- package/dist/components/qti-assessment-item/qti-assessment-item.js +92 -46
- package/dist/components/qti-assessment-item/qti-assessment-item.js.map +1 -1
- package/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.d.ts +29 -0
- package/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.js +30 -0
- package/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.js.map +1 -0
- package/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.styles.d.ts +2 -0
- package/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.styles.js +11 -0
- package/dist/components/qti-assessment-stimulus/qti-assessment-stimulus.styles.js.map +1 -0
- package/dist/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.js +5 -3
- package/dist/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.js.map +1 -1
- package/dist/elements.d.ts +5 -1
- package/dist/elements.js +3 -1
- package/dist/elements.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import type { PropertyValues } from 'lit';
|
|
2
3
|
import type { ResponseInteraction } from '@qti-components/base';
|
|
3
4
|
import type { RegisteredInteraction } from '@qti-components/base';
|
|
4
5
|
import type { VariableDeclaration, VariableValue } from '@qti-components/base';
|
|
@@ -21,10 +22,17 @@ export declare class QtiAssessmentItem extends LitElement {
|
|
|
21
22
|
timeDependent: 'true' | 'false' | null;
|
|
22
23
|
get title(): string;
|
|
23
24
|
set title(value: string);
|
|
25
|
+
/**
|
|
26
|
+
* Locks the item, for example once it is submitted. Published in the item context, which the
|
|
27
|
+
* interactions inside follow, so the item keeps no list of them to set it on.
|
|
28
|
+
*/
|
|
24
29
|
disabled: boolean;
|
|
25
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Shows the item for reading only. Published in the item context, which the interactions inside
|
|
32
|
+
* follow, so the item keeps no list of them to set it on.
|
|
33
|
+
*/
|
|
26
34
|
readonly: boolean;
|
|
27
|
-
protected
|
|
35
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
28
36
|
private _context;
|
|
29
37
|
/**
|
|
30
38
|
* Sets the identifier for the assessment item reference if this item is in a test.
|
|
@@ -33,6 +41,11 @@ export declare class QtiAssessmentItem extends LitElement {
|
|
|
33
41
|
*/
|
|
34
42
|
set assessmentItemRefId(identifier: string);
|
|
35
43
|
get assessmentItemRefId(): string;
|
|
44
|
+
/**
|
|
45
|
+
* The item's whole context, declarations included, for reading. `variables` is the trimmed view
|
|
46
|
+
* for hosts; the test needs the declarations too, and used to reach for the private field.
|
|
47
|
+
*/
|
|
48
|
+
get itemContext(): Readonly<ItemContext>;
|
|
36
49
|
get variables(): VariableValue<string | string[] | null>[];
|
|
37
50
|
set variables(value: VariableValue<string | string[] | null>[]);
|
|
38
51
|
get state(): ItemContext['state'];
|
|
@@ -8,7 +8,6 @@ import { provide } from '@lit/context';
|
|
|
8
8
|
import { LitElement, html } from 'lit';
|
|
9
9
|
import { property } from 'lit/decorators.js';
|
|
10
10
|
import { itemContext, itemContextVariables } from '@qti-components/base';
|
|
11
|
-
import { watch } from '@qti-components/utilities';
|
|
12
11
|
/**
|
|
13
12
|
* @summary The qti-assessment-item element contains all the other QTI 3 item structures.
|
|
14
13
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
|
|
@@ -33,32 +32,28 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
33
32
|
* item context.
|
|
34
33
|
*/
|
|
35
34
|
this.timeDependent = null;
|
|
36
|
-
this._handleDisabledChange = (_, disabled) => {
|
|
37
|
-
this.interactionElements.forEach(ch => (ch.disabled = disabled));
|
|
38
|
-
};
|
|
39
|
-
this._handleReadonlyChange = (_, readonly) => this.interactionElements.forEach(ch => (ch.readonly = readonly));
|
|
40
35
|
this._context = {
|
|
41
36
|
variables: itemContextVariables
|
|
42
37
|
};
|
|
43
38
|
this.#initialContext = { ...this._context, variables: this._context.variables };
|
|
44
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Template values handed in through `variables` — drawn in an earlier visit or session. Template
|
|
41
|
+
* processing keeps them instead of drawing again, so the candidate sees the question they
|
|
42
|
+
* answered, and still runs, so correct responses are derived from them.
|
|
43
|
+
*/
|
|
44
|
+
this.#restoredTemplateValues = new Map();
|
|
45
|
+
this.#templatesProcessed = false;
|
|
45
46
|
/** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */
|
|
46
47
|
this.interactionElements = [];
|
|
47
48
|
this.#handleRegisterVariable = (e) => {
|
|
48
49
|
e.stopImmediatePropagation();
|
|
49
|
-
|
|
50
|
+
const { variable } = e.detail;
|
|
51
|
+
const restored = variable.type === 'template' ? this.#restoredTemplateValues.get(variable.identifier) : undefined;
|
|
52
|
+
const registered = restored !== undefined ? { ...variable, value: restored } : variable;
|
|
53
|
+
this._context = { ...this._context, variables: [...this._context.variables, registered] };
|
|
50
54
|
this.#initialContext = this._context;
|
|
51
55
|
e.stopPropagation();
|
|
52
56
|
};
|
|
53
|
-
this.#handleRegisterFeedback = (e) => {
|
|
54
|
-
e.stopImmediatePropagation();
|
|
55
|
-
const feedbackElement = e.detail;
|
|
56
|
-
this.#feedbackElements.push(feedbackElement);
|
|
57
|
-
const numAttempts = Number(this._context.variables.find(v => v.identifier === 'numAttempts')?.value) || 0;
|
|
58
|
-
if (numAttempts > 0) {
|
|
59
|
-
feedbackElement.checkShowFeedback(feedbackElement.outcomeIdentifier);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
57
|
this.#handleRegisterInteraction = (e) => {
|
|
63
58
|
e.stopImmediatePropagation();
|
|
64
59
|
this.interactionElements.push(e.detail.interactionElement);
|
|
@@ -79,7 +74,9 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
79
74
|
this.#handleSetTemplateValue = (e) => {
|
|
80
75
|
e.stopImmediatePropagation();
|
|
81
76
|
const { templateIdentifier, value } = e.detail;
|
|
82
|
-
this.
|
|
77
|
+
if (!this.#restoredTemplateValues.has(templateIdentifier)) {
|
|
78
|
+
this.updateTemplateVariable(templateIdentifier, value ?? undefined);
|
|
79
|
+
}
|
|
83
80
|
e.stopPropagation();
|
|
84
81
|
};
|
|
85
82
|
this.#handleSetCorrectResponse = (e) => {
|
|
@@ -101,6 +98,8 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
101
98
|
}
|
|
102
99
|
};
|
|
103
100
|
}
|
|
101
|
+
// The interaction has updated its own validity by now; publish the verdict with the answer.
|
|
102
|
+
this.validate(false);
|
|
104
103
|
this.dispatchEvent(new CustomEvent('qti-item-context-updated', {
|
|
105
104
|
bubbles: true,
|
|
106
105
|
composed: true,
|
|
@@ -118,6 +117,18 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
118
117
|
this.removeAttribute('title');
|
|
119
118
|
this.setAttribute('data-title', value);
|
|
120
119
|
}
|
|
120
|
+
willUpdate(changed) {
|
|
121
|
+
super.willUpdate(changed);
|
|
122
|
+
const readonlyChanged = changed.has('readonly') && (this.readonly ?? false) !== (this._context.readonly ?? false);
|
|
123
|
+
const disabledChanged = changed.has('disabled') && (this.disabled ?? false) !== (this._context.disabled ?? false);
|
|
124
|
+
if (readonlyChanged || disabledChanged) {
|
|
125
|
+
this._context = {
|
|
126
|
+
...this._context,
|
|
127
|
+
...(readonlyChanged ? { readonly: !!this.readonly } : {}),
|
|
128
|
+
...(disabledChanged ? { disabled: !!this.disabled } : {})
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
121
132
|
/**
|
|
122
133
|
* Sets the identifier for the assessment item reference if this item is in a test.
|
|
123
134
|
*
|
|
@@ -129,6 +140,13 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
129
140
|
get assessmentItemRefId() {
|
|
130
141
|
return this._context.identifier;
|
|
131
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* The item's whole context, declarations included, for reading. `variables` is the trimmed view
|
|
145
|
+
* for hosts; the test needs the declarations too, and used to reach for the private field.
|
|
146
|
+
*/
|
|
147
|
+
get itemContext() {
|
|
148
|
+
return this._context;
|
|
149
|
+
}
|
|
132
150
|
get variables() {
|
|
133
151
|
return this._context.variables.map(v => ({
|
|
134
152
|
identifier: v.identifier,
|
|
@@ -145,6 +163,16 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
145
163
|
console.warn('variables property should be an array of VariableDeclaration');
|
|
146
164
|
return;
|
|
147
165
|
}
|
|
166
|
+
const previous = this._context.variables;
|
|
167
|
+
// Recognised by their declaration, or by their own type: a template declaration registers after
|
|
168
|
+
// its first render, so a test restoring on connect can get here before it has.
|
|
169
|
+
const restoredTemplates = value.filter(v => v.value !== null &&
|
|
170
|
+
v.value !== undefined &&
|
|
171
|
+
(v.type === 'template' ||
|
|
172
|
+
previous.some(declared => declared.identifier === v.identifier && declared.type === 'template')));
|
|
173
|
+
restoredTemplates.forEach(v => this.#restoredTemplateValues.set(v.identifier, v.value));
|
|
174
|
+
const templatesChanged = restoredTemplates.some(v => JSON.stringify(previous.find(declared => declared.identifier === v.identifier)?.value) !==
|
|
175
|
+
JSON.stringify(v.value));
|
|
148
176
|
this._context = {
|
|
149
177
|
...this._context,
|
|
150
178
|
variables: this._context.variables.map(variable => {
|
|
@@ -160,19 +188,13 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
160
188
|
return variable;
|
|
161
189
|
})
|
|
162
190
|
};
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
});
|
|
171
|
-
this.variables.forEach(variable => {
|
|
172
|
-
if (variable.type === 'outcome') {
|
|
173
|
-
this.#feedbackElements.forEach(fe => fe.checkShowFeedback(variable.identifier));
|
|
174
|
-
}
|
|
175
|
-
});
|
|
191
|
+
// Restored after the first processing run: correct responses still follow the values it drew.
|
|
192
|
+
if (this.#templatesProcessed && templatesChanged) {
|
|
193
|
+
this.#runTemplateProcessing();
|
|
194
|
+
}
|
|
195
|
+
// The interactions take the answers over from the context, some of them a moment from now, and
|
|
196
|
+
// a different answer can mean a different verdict. Look once they have.
|
|
197
|
+
void this.updateComplete.then(() => this.#revalidate());
|
|
176
198
|
}
|
|
177
199
|
get state() {
|
|
178
200
|
return this._context.state;
|
|
@@ -184,7 +206,13 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
184
206
|
};
|
|
185
207
|
}
|
|
186
208
|
#initialContext;
|
|
187
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Template values handed in through `variables` — drawn in an earlier visit or session. Template
|
|
211
|
+
* processing keeps them instead of drawing again, so the candidate sees the question they
|
|
212
|
+
* answered, and still runs, so correct responses are derived from them.
|
|
213
|
+
*/
|
|
214
|
+
#restoredTemplateValues;
|
|
215
|
+
#templatesProcessed;
|
|
188
216
|
/** @deprecated use variables property instead */
|
|
189
217
|
set responses(myResponses) {
|
|
190
218
|
if (myResponses) {
|
|
@@ -207,6 +235,8 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
207
235
|
this.#attachEventListeners();
|
|
208
236
|
super.connectedCallback();
|
|
209
237
|
this.updateComplete.then(() => {
|
|
238
|
+
// The verdict goes in first, so whoever hears the item connect reads it with the rest.
|
|
239
|
+
this.validate(false);
|
|
210
240
|
this.dispatchEvent(new CustomEvent('qti-assessment-item-connected', {
|
|
211
241
|
bubbles: true,
|
|
212
242
|
composed: true,
|
|
@@ -221,7 +251,6 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
221
251
|
}
|
|
222
252
|
#attachEventListeners() {
|
|
223
253
|
this.addEventListener('qti-register-variable', this.#handleRegisterVariable);
|
|
224
|
-
this.addEventListener('qti-register-feedback', this.#handleRegisterFeedback);
|
|
225
254
|
this.addEventListener('qti-register-interaction', this.#handleRegisterInteraction);
|
|
226
255
|
this.addEventListener('end-attempt', this.#handleEndAttempt);
|
|
227
256
|
this.addEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);
|
|
@@ -231,7 +260,6 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
231
260
|
}
|
|
232
261
|
#removeEventListeners() {
|
|
233
262
|
this.removeEventListener('qti-register-variable', this.#handleRegisterVariable);
|
|
234
|
-
this.removeEventListener('qti-register-feedback', this.#handleRegisterFeedback);
|
|
235
263
|
this.removeEventListener('qti-register-interaction', this.#handleRegisterInteraction);
|
|
236
264
|
this.removeEventListener('end-attempt', this.#handleEndAttempt);
|
|
237
265
|
this.removeEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);
|
|
@@ -240,7 +268,6 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
240
268
|
this.removeEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);
|
|
241
269
|
}
|
|
242
270
|
#handleRegisterVariable;
|
|
243
|
-
#handleRegisterFeedback;
|
|
244
271
|
#handleRegisterInteraction;
|
|
245
272
|
#handleEndAttempt;
|
|
246
273
|
#handleSetOutcomeValue;
|
|
@@ -254,11 +281,15 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
254
281
|
await Promise.resolve();
|
|
255
282
|
}
|
|
256
283
|
this.#templateProcessing = this.querySelector('qti-template-processing');
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
284
|
+
this.#templatesProcessed = true;
|
|
285
|
+
// Run template processing before first presentation
|
|
286
|
+
this.#runTemplateProcessing();
|
|
287
|
+
}
|
|
288
|
+
#runTemplateProcessing() {
|
|
289
|
+
if (!this.#templateProcessing)
|
|
290
|
+
return;
|
|
291
|
+
this.#templateProcessing.process();
|
|
292
|
+
this.#initialContext = { ...this._context, variables: this._context.variables };
|
|
262
293
|
}
|
|
263
294
|
processResponse(countNumAttempts = true, reportValidityAfterScoring = true) {
|
|
264
295
|
this.validate(reportValidityAfterScoring);
|
|
@@ -436,7 +467,6 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
436
467
|
};
|
|
437
468
|
})
|
|
438
469
|
};
|
|
439
|
-
this.#feedbackElements.forEach(fe => fe.checkShowFeedback(identifier));
|
|
440
470
|
this.dispatchEvent(new CustomEvent('qti-outcome-changed', {
|
|
441
471
|
bubbles: true,
|
|
442
472
|
composed: true,
|
|
@@ -449,11 +479,33 @@ export class QtiAssessmentItem extends LitElement {
|
|
|
449
479
|
}
|
|
450
480
|
validate(reportValidity = true) {
|
|
451
481
|
const isValid = this.interactionElements.every(interactionElement => interactionElement.validate());
|
|
482
|
+
this.#publishValidity(isValid);
|
|
452
483
|
if (reportValidity) {
|
|
453
484
|
this.reportValidity();
|
|
454
485
|
}
|
|
455
486
|
return isValid;
|
|
456
487
|
}
|
|
488
|
+
/** Puts the verdict in the item context, where the test and anything else can read it. */
|
|
489
|
+
#publishValidity(valid) {
|
|
490
|
+
if (this._context.valid !== valid) {
|
|
491
|
+
this._context = { ...this._context, valid };
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Checks again after something the interactions' validity depends on changed without them saying
|
|
496
|
+
* so (an answer handed in through `variables`), and tells the test if the verdict moved.
|
|
497
|
+
*/
|
|
498
|
+
#revalidate() {
|
|
499
|
+
const before = this._context.valid;
|
|
500
|
+
this.validate(false);
|
|
501
|
+
if (this._context.valid !== before) {
|
|
502
|
+
this.dispatchEvent(new CustomEvent('qti-item-context-updated', {
|
|
503
|
+
bubbles: true,
|
|
504
|
+
composed: true,
|
|
505
|
+
detail: { itemContext: this._context }
|
|
506
|
+
}));
|
|
507
|
+
}
|
|
508
|
+
}
|
|
457
509
|
reportValidity() {
|
|
458
510
|
for (const interactionElement of this.interactionElements) {
|
|
459
511
|
interactionElement.reportValidity();
|
|
@@ -504,15 +556,9 @@ __decorate([
|
|
|
504
556
|
__decorate([
|
|
505
557
|
property({ type: Boolean })
|
|
506
558
|
], QtiAssessmentItem.prototype, "disabled", void 0);
|
|
507
|
-
__decorate([
|
|
508
|
-
watch('disabled', { waitUntilFirstUpdate: true })
|
|
509
|
-
], QtiAssessmentItem.prototype, "_handleDisabledChange", void 0);
|
|
510
559
|
__decorate([
|
|
511
560
|
property({ type: Boolean })
|
|
512
561
|
], QtiAssessmentItem.prototype, "readonly", void 0);
|
|
513
|
-
__decorate([
|
|
514
|
-
watch('readonly', { waitUntilFirstUpdate: true })
|
|
515
|
-
], QtiAssessmentItem.prototype, "_handleReadonlyChange", void 0);
|
|
516
562
|
__decorate([
|
|
517
563
|
provide({ context: itemContext })
|
|
518
564
|
], QtiAssessmentItem.prototype, "_context", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qti-assessment-item.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-item/qti-assessment-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAYlD;;;;;;;;;GASG;AAEH,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAAjD;;QAEE,wBAAmB,GAAiC,IAAI,CAAC;QAE7B,eAAU,GAAW,EAAE,CAAC;QACxB,aAAQ,GAAqB,OAAO,CAAC;QACjE;;;;;;WAMG;QACsD,kBAAa,GAA4B,IAAI,CAAC;QAc7F,0BAAqB,GAAG,CAAC,CAAU,EAAE,QAAiB,EAAE,EAAE;YAClE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,C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html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { itemContext, itemContextVariables } from '@qti-components/base';\nimport { watch } from '@qti-components/utilities';\n\nimport type { QtiTemplateProcessing } from '../qti-template-processing/qti-template-processing.js';\nimport type { InteractionChangedDetails, OutcomeChangedDetails } from '../../internal/event-types.ts';\nimport type { QtiFeedback, ResponseInteraction } from '@qti-components/base';\nimport type { RegisteredInteraction } from '@qti-components/base';\nimport type { VariableDeclaration, VariableValue } from '@qti-components/base';\nimport type { OutcomeVariable, ResponseVariable, TemplateVariable } from '@qti-components/base';\nimport type { QtiResponseProcessing } from '../qti-response-processing/qti-response-processing.ts';\nimport type QtiRegisterVariable from '../../internal/events/qti-register-variable.ts';\nimport type { ItemContext } from '@qti-components/base';\n\n/**\n * @summary The qti-assessment-item element contains all the other QTI 3 item structures.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj\n *\n * @dependency qti-feedback\n * @dependency qti-responseprocessing\n *\n * @event qti-item-context-updated - Emitted when through a user action the itemContext is updated,\n * typically on interaction with the interactions, or calling response processing.\n */\n\nexport class QtiAssessmentItem extends LitElement {\n #itemTitle: string | undefined;\n #templateProcessing: QtiTemplateProcessing | null = null;\n\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) adaptive: 'true' | 'false' = 'false';\n /*\n * `attribute` spelled out: Lit derives `timedependent` from the property\n * name, while QTI writes `time-dependent`. Without it the attribute never\n * reached the property, so an item declaring `time-dependent=\"true\"` still\n * reported false to `test-navigation`, which reads this to build the computed\n * item context.\n */\n @property({ type: String, attribute: 'time-dependent' }) timeDependent: 'true' | 'false' | null = null;\n\n @property({ type: String })\n override get title(): string {\n return this.#itemTitle;\n }\n override set title(value: string) {\n this.#itemTitle = value;\n this.removeAttribute('title');\n this.setAttribute('data-title', value);\n }\n\n @property({ type: Boolean }) disabled: boolean;\n @watch('disabled', { waitUntilFirstUpdate: true })\n protected _handleDisabledChange = (_: boolean, disabled: boolean) => {\n this.interactionElements.forEach(ch => (ch.disabled = disabled));\n };\n\n @property({ type: Boolean }) readonly: boolean;\n @watch('readonly', { waitUntilFirstUpdate: true })\n protected _handleReadonlyChange = (_: boolean, readonly: boolean) =>\n this.interactionElements.forEach(ch => (ch.readonly = readonly));\n\n @provide({ context: itemContext })\n private _context: ItemContext = {\n variables: itemContextVariables\n };\n\n /**\n * Sets the identifier for the assessment item reference if this item is in a test.\n *\n * @param identifier - The identifier for the assessment item reference.\n */\n public set assessmentItemRefId(identifier: string) {\n this._context = { ...this._context, identifier };\n }\n\n public get assessmentItemRefId(): string {\n return this._context.identifier;\n }\n\n public get variables(): VariableValue<string | string[] | null>[] {\n return this._context.variables.map(v => ({\n identifier: v.identifier,\n value: v.value,\n type: v.type,\n // add externalscored, a fixed prop to the test, so the testcontext can read and decide how to score this item\n ...(v.type === 'outcome' && v.identifier === 'SCORE'\n ? { externalScored: (v as OutcomeVariable).externalScored }\n : {})\n }));\n }\n\n public set variables(value: VariableValue<string | string[] | null>[]) {\n if (!Array.isArray(value) || value.some(v => !('identifier' in v))) {\n console.warn('variables property should be an array of VariableDeclaration');\n return;\n }\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n const matchingValue = value.find(v => v.identifier === variable.identifier);\n if (matchingValue) {\n return {\n ...variable,\n ...matchingValue,\n interpolationTable: (variable as OutcomeVariable).interpolationTable,\n matchTable: (variable as OutcomeVariable).matchTable\n };\n }\n return variable;\n })\n };\n\n this._context.variables.forEach(variable => {\n if (variable.type === 'response') {\n const interactionElement = this.interactionElements.find(\n (el: RegisteredInteraction) => el.responseIdentifier === variable.identifier\n );\n if (interactionElement) {\n interactionElement.response = variable.value as string | string[];\n }\n }\n });\n\n this.variables.forEach(variable => {\n if (variable.type === 'outcome') {\n this.#feedbackElements.forEach(fe => fe.checkShowFeedback(variable.identifier));\n }\n });\n }\n\n public get state(): ItemContext['state'] {\n return this._context.state;\n }\n\n public set state(value: ItemContext['state']) {\n this._context = {\n ...this._context,\n state: value ? { ...value } : undefined\n };\n }\n\n #initialContext: Readonly<ItemContext> = { ...this._context, variables: this._context.variables };\n #feedbackElements: QtiFeedback[] = [];\n /** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */\n protected interactionElements: RegisteredInteraction[] = [];\n\n /** @deprecated use variables property instead */\n set responses(myResponses: ResponseInteraction[]) {\n if (myResponses) {\n for (const response of myResponses) {\n const responseVariable = this.getResponse(response.responseIdentifier);\n if (responseVariable) {\n this.updateResponseVariable(response.responseIdentifier, response.response);\n }\n\n const interaction: RegisteredInteraction | undefined = this.interactionElements.find(\n i => i.getAttribute('response-identifier') === response.responseIdentifier\n );\n if (interaction) {\n interaction.response = response.response;\n }\n }\n }\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n this.#attachEventListeners();\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.dispatchEvent(\n new CustomEvent<QtiAssessmentItem>('qti-assessment-item-connected', {\n bubbles: true,\n composed: true,\n detail: this\n })\n );\n this.#processTemplates();\n });\n }\n\n override disconnectedCallback(): void {\n this.#removeEventListeners();\n super.disconnectedCallback();\n }\n\n #attachEventListeners() {\n this.addEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.addEventListener('qti-register-feedback', this.#handleRegisterFeedback);\n this.addEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.addEventListener('end-attempt', this.#handleEndAttempt);\n this.addEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.addEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.addEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.addEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #removeEventListeners() {\n this.removeEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.removeEventListener('qti-register-feedback', this.#handleRegisterFeedback);\n this.removeEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.removeEventListener('end-attempt', this.#handleEndAttempt);\n this.removeEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.removeEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.removeEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.removeEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #handleRegisterVariable = (e: QtiRegisterVariable) => {\n e.stopImmediatePropagation();\n this._context = { ...this._context, variables: [...this._context.variables, e.detail.variable] };\n this.#initialContext = this._context;\n e.stopPropagation();\n };\n\n #handleRegisterFeedback = (e: CustomEvent<QtiFeedback>) => {\n e.stopImmediatePropagation();\n const feedbackElement = e.detail;\n this.#feedbackElements.push(feedbackElement);\n const numAttempts = Number(this._context.variables.find(v => v.identifier === 'numAttempts')?.value) || 0;\n if (numAttempts > 0) {\n feedbackElement.checkShowFeedback(feedbackElement.outcomeIdentifier);\n }\n };\n\n #handleRegisterInteraction = (e: CustomEvent<{ interaction: string; interactionElement: RegisteredInteraction }>) => {\n e.stopImmediatePropagation();\n this.interactionElements.push(e.detail.interactionElement);\n };\n\n #handleEndAttempt = (e: CustomEvent<{ responseIdentifier: string; countAttempt: boolean }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, countAttempt } = e.detail;\n this.validate();\n this.updateResponseVariable(responseIdentifier, 'true');\n this.processResponse(countAttempt);\n };\n\n #handleSetOutcomeValue = (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n e.stopImmediatePropagation();\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n };\n\n #handleSetTemplateValue = (e: CustomEvent<{ templateIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { templateIdentifier, value } = e.detail;\n this.updateTemplateVariable(templateIdentifier, value ?? undefined);\n e.stopPropagation();\n };\n\n #handleSetCorrectResponse = (e: CustomEvent<{ responseIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, value } = e.detail;\n this.updateCorrectResponse(responseIdentifier, value ?? undefined);\n e.stopPropagation();\n };\n\n #handleUpdateResponseVariable = (e: CustomEvent<ResponseInteraction>) => {\n e.stopImmediatePropagation();\n\n const { responseIdentifier, response, state } = e.detail;\n this.updateResponseVariable(responseIdentifier, response);\n if (state !== undefined) {\n this._context = {\n ...this._context,\n state: {\n ...(this._context.state || {}),\n [responseIdentifier]: state\n }\n };\n }\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n };\n\n async #processTemplates(): Promise<void> {\n const templateDeclarations = Array.from(this.querySelectorAll<LitElement>('qti-template-declaration'));\n if (templateDeclarations.length > 0) {\n await Promise.all(templateDeclarations.map(declaration => declaration.updateComplete));\n await Promise.resolve();\n }\n\n this.#templateProcessing = this.querySelector<QtiTemplateProcessing>('qti-template-processing');\n if (this.#templateProcessing) {\n // Run template processing before first presentation\n this.#templateProcessing.process();\n this.#initialContext = { ...this._context, variables: this._context.variables };\n }\n }\n\n public processResponse(countNumAttempts = true, reportValidityAfterScoring = true): boolean {\n this.validate(reportValidityAfterScoring);\n\n if (countNumAttempts) {\n this.updateOutcomeVariable(\n 'numAttempts',\n (+this._context.variables.find(v => v.identifier === 'numAttempts')?.value + 1).toString()\n );\n }\n\n if (this.adaptive === 'false') {\n this.#resetOutcomeVariablesBeforeResponseProcessing();\n }\n\n const responseProcessor = this.querySelector<QtiResponseProcessing>('qti-response-processing');\n const canProcess = !!(responseProcessor && typeof responseProcessor.process === 'function');\n if (canProcess) {\n responseProcessor.process();\n }\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n\n // `responseProcessed` marks this as the end of an attempt (vs. a plain\n // selection, which fires the same event without the flag). Lets listeners\n // react only when an attempt actually ends.\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext; responseProcessed: boolean }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context, responseProcessed: true }\n })\n );\n\n return canProcess;\n }\n\n public resetResponses() {\n this._context = this.#initialContext;\n }\n\n protected getResponse(identifier: string): Readonly<ResponseVariable> {\n return this.getVariable(identifier) as ResponseVariable;\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n\n protected getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this._context.variables.find(v => v.identifier === identifier) || null;\n }\n\n /** Extension point for presentation packages reacting to a candidate response change. */\n protected afterResponseVariableUpdated(): void {}\n\n // saving privates here: ------------------------------------------------------------------------------\n\n /**\n * Updates the response variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateResponseVariable(identifier: string, value: string | string[] | undefined) {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => (v.identifier !== identifier ? v : { ...v, value: value }))\n };\n\n this.afterResponseVariableUpdated();\n\n this.dispatchEvent(\n new CustomEvent<InteractionChangedDetails>('qti-interaction-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n responseIdentifier: identifier,\n response: Array.isArray(value) ? [...value] : value\n }\n })\n );\n\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n }\n\n /**\n * Updates the template variable with the specified identifier to the given value.\n */\n public updateTemplateVariable(identifier: string, value: string | string[] | undefined) {\n const templateVariable = this._context.variables.find(v => v.identifier === identifier && v.type === 'template') as\n | TemplateVariable\n | undefined;\n\n if (!templateVariable) {\n console.warn(`Can not set qti-template-identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n templateVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n value: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the correct response for the specified response variable.\n */\n public updateCorrectResponse(identifier: string, value: string | string[] | undefined) {\n const responseVariable = this.getResponse(identifier);\n\n if (!responseVariable) {\n console.warn(`Can not set correct response for identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n responseVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n correctResponse: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n public setOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n this.updateOutcomeVariable(identifier, value);\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the outcome variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : Array.isArray(value) ? value : [value]\n };\n })\n };\n this.#feedbackElements.forEach(fe => fe.checkShowFeedback(identifier));\n\n this.dispatchEvent(\n new CustomEvent<OutcomeChangedDetails>('qti-outcome-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n outcomeIdentifier: identifier,\n value: this._context.variables.find(v => v.identifier === identifier)?.value\n }\n })\n );\n }\n\n public validate(reportValidity = true): boolean {\n const isValid = this.interactionElements.every(interactionElement => interactionElement.validate());\n\n if (reportValidity) {\n this.reportValidity();\n }\n\n return isValid;\n }\n\n public reportValidity() {\n for (const interactionElement of this.interactionElements) {\n interactionElement.reportValidity();\n }\n }\n\n #getCompletionStatus(): 'completed' | 'incomplete' | 'not_attempted' | 'unknown' {\n const valid = this.validate(false);\n if (valid === true) return 'completed';\n if (valid === false) return 'incomplete';\n return 'not_attempted';\n }\n\n #resetOutcomeVariablesBeforeResponseProcessing(): void {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n if (variable.type !== 'outcome') {\n return variable;\n }\n\n const hasDefaultValue = 'defaultValue' in variable;\n const declaredDefault = hasDefaultValue ? variable.defaultValue : null;\n\n let value = declaredDefault ?? null;\n if (\n (value === null || value === undefined) &&\n (variable.baseType === 'integer' || variable.baseType === 'float')\n ) {\n value = '0';\n }\n\n return {\n ...variable,\n value\n };\n })\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item': QtiAssessmentItem;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"qti-assessment-item.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-item/qti-assessment-item.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,C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,CAAC;gBAED,OAAO;oBACL,GAAG,QAAQ;oBACX,KAAK;iBACN,CAAC;YACJ,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;CACF;AApnB6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAsC;AAQR;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;wDAA+C;AAGvG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAG1B;AAW4B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAAmB;AAMlB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAAmB;AAgBvC;IADP,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;mDAGhC","sourcesContent":["import { provide } from '@lit/context';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { itemContext, itemContextVariables } from '@qti-components/base';\n\nimport type { PropertyValues } from 'lit';\nimport type { QtiTemplateProcessing } from '../qti-template-processing/qti-template-processing.js';\nimport type { InteractionChangedDetails, OutcomeChangedDetails } from '../../internal/event-types.ts';\nimport type { ResponseInteraction } from '@qti-components/base';\nimport type { RegisteredInteraction } from '@qti-components/base';\nimport type { VariableDeclaration, VariableValue } from '@qti-components/base';\nimport type { OutcomeVariable, ResponseVariable, TemplateVariable } from '@qti-components/base';\nimport type { QtiResponseProcessing } from '../qti-response-processing/qti-response-processing.ts';\nimport type QtiRegisterVariable from '../../internal/events/qti-register-variable.ts';\nimport type { ItemContext } from '@qti-components/base';\n\n/**\n * @summary The qti-assessment-item element contains all the other QTI 3 item structures.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj\n *\n * @dependency qti-feedback\n * @dependency qti-responseprocessing\n *\n * @event qti-item-context-updated - Emitted when through a user action the itemContext is updated,\n * typically on interaction with the interactions, or calling response processing.\n */\n\nexport class QtiAssessmentItem extends LitElement {\n #itemTitle: string | undefined;\n #templateProcessing: QtiTemplateProcessing | null = null;\n\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) adaptive: 'true' | 'false' = 'false';\n /*\n * `attribute` spelled out: Lit derives `timedependent` from the property\n * name, while QTI writes `time-dependent`. Without it the attribute never\n * reached the property, so an item declaring `time-dependent=\"true\"` still\n * reported false to `test-navigation`, which reads this to build the computed\n * item context.\n */\n @property({ type: String, attribute: 'time-dependent' }) timeDependent: 'true' | 'false' | null = null;\n\n @property({ type: String })\n override get title(): string {\n return this.#itemTitle;\n }\n override set title(value: string) {\n this.#itemTitle = value;\n this.removeAttribute('title');\n this.setAttribute('data-title', value);\n }\n\n /**\n * Locks the item, for example once it is submitted. Published in the item context, which the\n * interactions inside follow, so the item keeps no list of them to set it on.\n */\n @property({ type: Boolean }) disabled: boolean;\n\n /**\n * Shows the item for reading only. Published in the item context, which the interactions inside\n * follow, so the item keeps no list of them to set it on.\n */\n @property({ type: Boolean }) readonly: boolean;\n\n protected override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n const readonlyChanged = changed.has('readonly') && (this.readonly ?? false) !== (this._context.readonly ?? false);\n const disabledChanged = changed.has('disabled') && (this.disabled ?? false) !== (this._context.disabled ?? false);\n if (readonlyChanged || disabledChanged) {\n this._context = {\n ...this._context,\n ...(readonlyChanged ? { readonly: !!this.readonly } : {}),\n ...(disabledChanged ? { disabled: !!this.disabled } : {})\n };\n }\n }\n\n @provide({ context: itemContext })\n private _context: ItemContext = {\n variables: itemContextVariables\n };\n\n /**\n * Sets the identifier for the assessment item reference if this item is in a test.\n *\n * @param identifier - The identifier for the assessment item reference.\n */\n public set assessmentItemRefId(identifier: string) {\n this._context = { ...this._context, identifier };\n }\n\n public get assessmentItemRefId(): string {\n return this._context.identifier;\n }\n\n /**\n * The item's whole context, declarations included, for reading. `variables` is the trimmed view\n * for hosts; the test needs the declarations too, and used to reach for the private field.\n */\n public get itemContext(): Readonly<ItemContext> {\n return this._context;\n }\n\n public get variables(): VariableValue<string | string[] | null>[] {\n return this._context.variables.map(v => ({\n identifier: v.identifier,\n value: v.value,\n type: v.type,\n // add externalscored, a fixed prop to the test, so the testcontext can read and decide how to score this item\n ...(v.type === 'outcome' && v.identifier === 'SCORE'\n ? { externalScored: (v as OutcomeVariable).externalScored }\n : {})\n }));\n }\n\n public set variables(value: VariableValue<string | string[] | null>[]) {\n if (!Array.isArray(value) || value.some(v => !('identifier' in v))) {\n console.warn('variables property should be an array of VariableDeclaration');\n return;\n }\n const previous = this._context.variables;\n // Recognised by their declaration, or by their own type: a template declaration registers after\n // its first render, so a test restoring on connect can get here before it has.\n const restoredTemplates = value.filter(\n v =>\n v.value !== null &&\n v.value !== undefined &&\n (v.type === 'template' ||\n previous.some(declared => declared.identifier === v.identifier && declared.type === 'template'))\n );\n restoredTemplates.forEach(v =>\n this.#restoredTemplateValues.set(v.identifier, v.value as Readonly<string | string[]>)\n );\n const templatesChanged = restoredTemplates.some(\n v =>\n JSON.stringify(previous.find(declared => declared.identifier === v.identifier)?.value) !==\n JSON.stringify(v.value)\n );\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n const matchingValue = value.find(v => v.identifier === variable.identifier);\n if (matchingValue) {\n return {\n ...variable,\n ...matchingValue,\n interpolationTable: (variable as OutcomeVariable).interpolationTable,\n matchTable: (variable as OutcomeVariable).matchTable\n };\n }\n return variable;\n })\n };\n\n // Restored after the first processing run: correct responses still follow the values it drew.\n if (this.#templatesProcessed && templatesChanged) {\n this.#runTemplateProcessing();\n }\n\n // The interactions take the answers over from the context, some of them a moment from now, and\n // a different answer can mean a different verdict. Look once they have.\n void this.updateComplete.then(() => this.#revalidate());\n }\n\n public get state(): ItemContext['state'] {\n return this._context.state;\n }\n\n public set state(value: ItemContext['state']) {\n this._context = {\n ...this._context,\n state: value ? { ...value } : undefined\n };\n }\n\n #initialContext: Readonly<ItemContext> = { ...this._context, variables: this._context.variables };\n /**\n * Template values handed in through `variables` — drawn in an earlier visit or session. Template\n * processing keeps them instead of drawing again, so the candidate sees the question they\n * answered, and still runs, so correct responses are derived from them.\n */\n #restoredTemplateValues = new Map<string, Readonly<string | string[]>>();\n #templatesProcessed = false;\n /** Registered candidate-input interactions. Correction packages may extend their presentation behavior. */\n protected interactionElements: RegisteredInteraction[] = [];\n\n /** @deprecated use variables property instead */\n set responses(myResponses: ResponseInteraction[]) {\n if (myResponses) {\n for (const response of myResponses) {\n const responseVariable = this.getResponse(response.responseIdentifier);\n if (responseVariable) {\n this.updateResponseVariable(response.responseIdentifier, response.response);\n }\n\n const interaction: RegisteredInteraction | undefined = this.interactionElements.find(\n i => i.getAttribute('response-identifier') === response.responseIdentifier\n );\n if (interaction) {\n interaction.response = response.response;\n }\n }\n }\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n this.#attachEventListeners();\n super.connectedCallback();\n this.updateComplete.then(() => {\n // The verdict goes in first, so whoever hears the item connect reads it with the rest.\n this.validate(false);\n this.dispatchEvent(\n new CustomEvent<QtiAssessmentItem>('qti-assessment-item-connected', {\n bubbles: true,\n composed: true,\n detail: this\n })\n );\n this.#processTemplates();\n });\n }\n\n override disconnectedCallback(): void {\n this.#removeEventListeners();\n super.disconnectedCallback();\n }\n\n #attachEventListeners() {\n this.addEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.addEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.addEventListener('end-attempt', this.#handleEndAttempt);\n this.addEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.addEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.addEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.addEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #removeEventListeners() {\n this.removeEventListener('qti-register-variable', this.#handleRegisterVariable);\n this.removeEventListener('qti-register-interaction', this.#handleRegisterInteraction);\n this.removeEventListener('end-attempt', this.#handleEndAttempt);\n this.removeEventListener('qti-set-outcome-value', this.#handleSetOutcomeValue);\n this.removeEventListener('qti-set-template-value', this.#handleSetTemplateValue);\n this.removeEventListener('qti-set-correct-response', this.#handleSetCorrectResponse);\n this.removeEventListener('qti-interaction-response', this.#handleUpdateResponseVariable);\n }\n\n #handleRegisterVariable = (e: QtiRegisterVariable) => {\n e.stopImmediatePropagation();\n const { variable } = e.detail;\n const restored = variable.type === 'template' ? this.#restoredTemplateValues.get(variable.identifier) : undefined;\n const registered = restored !== undefined ? { ...variable, value: restored } : variable;\n this._context = { ...this._context, variables: [...this._context.variables, registered] };\n this.#initialContext = this._context;\n e.stopPropagation();\n };\n\n #handleRegisterInteraction = (e: CustomEvent<{ interaction: string; interactionElement: RegisteredInteraction }>) => {\n e.stopImmediatePropagation();\n this.interactionElements.push(e.detail.interactionElement);\n };\n\n #handleEndAttempt = (e: CustomEvent<{ responseIdentifier: string; countAttempt: boolean }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, countAttempt } = e.detail;\n this.validate();\n this.updateResponseVariable(responseIdentifier, 'true');\n this.processResponse(countAttempt);\n };\n\n #handleSetOutcomeValue = (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n e.stopImmediatePropagation();\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n };\n\n #handleSetTemplateValue = (e: CustomEvent<{ templateIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { templateIdentifier, value } = e.detail;\n if (!this.#restoredTemplateValues.has(templateIdentifier)) {\n this.updateTemplateVariable(templateIdentifier, value ?? undefined);\n }\n e.stopPropagation();\n };\n\n #handleSetCorrectResponse = (e: CustomEvent<{ responseIdentifier: string; value: string | string[] | null }>) => {\n e.stopImmediatePropagation();\n const { responseIdentifier, value } = e.detail;\n this.updateCorrectResponse(responseIdentifier, value ?? undefined);\n e.stopPropagation();\n };\n\n #handleUpdateResponseVariable = (e: CustomEvent<ResponseInteraction>) => {\n e.stopImmediatePropagation();\n\n const { responseIdentifier, response, state } = e.detail;\n this.updateResponseVariable(responseIdentifier, response);\n if (state !== undefined) {\n this._context = {\n ...this._context,\n state: {\n ...(this._context.state || {}),\n [responseIdentifier]: state\n }\n };\n }\n\n // The interaction has updated its own validity by now; publish the verdict with the answer.\n this.validate(false);\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n };\n\n async #processTemplates(): Promise<void> {\n const templateDeclarations = Array.from(this.querySelectorAll<LitElement>('qti-template-declaration'));\n if (templateDeclarations.length > 0) {\n await Promise.all(templateDeclarations.map(declaration => declaration.updateComplete));\n await Promise.resolve();\n }\n\n this.#templateProcessing = this.querySelector<QtiTemplateProcessing>('qti-template-processing');\n this.#templatesProcessed = true;\n // Run template processing before first presentation\n this.#runTemplateProcessing();\n }\n\n #runTemplateProcessing(): void {\n if (!this.#templateProcessing) return;\n this.#templateProcessing.process();\n this.#initialContext = { ...this._context, variables: this._context.variables };\n }\n\n public processResponse(countNumAttempts = true, reportValidityAfterScoring = true): boolean {\n this.validate(reportValidityAfterScoring);\n\n if (countNumAttempts) {\n this.updateOutcomeVariable(\n 'numAttempts',\n (+this._context.variables.find(v => v.identifier === 'numAttempts')?.value + 1).toString()\n );\n }\n\n if (this.adaptive === 'false') {\n this.#resetOutcomeVariablesBeforeResponseProcessing();\n }\n\n const responseProcessor = this.querySelector<QtiResponseProcessing>('qti-response-processing');\n const canProcess = !!(responseProcessor && typeof responseProcessor.process === 'function');\n if (canProcess) {\n responseProcessor.process();\n }\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n\n // `responseProcessed` marks this as the end of an attempt (vs. a plain\n // selection, which fires the same event without the flag). Lets listeners\n // react only when an attempt actually ends.\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext; responseProcessed: boolean }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context, responseProcessed: true }\n })\n );\n\n return canProcess;\n }\n\n public resetResponses() {\n this._context = this.#initialContext;\n }\n\n protected getResponse(identifier: string): Readonly<ResponseVariable> {\n return this.getVariable(identifier) as ResponseVariable;\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n\n protected getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this._context.variables.find(v => v.identifier === identifier) || null;\n }\n\n /** Extension point for presentation packages reacting to a candidate response change. */\n protected afterResponseVariableUpdated(): void {}\n\n // saving privates here: ------------------------------------------------------------------------------\n\n /**\n * Updates the response variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateResponseVariable(identifier: string, value: string | string[] | undefined) {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => (v.identifier !== identifier ? v : { ...v, value: value }))\n };\n\n this.afterResponseVariableUpdated();\n\n this.dispatchEvent(\n new CustomEvent<InteractionChangedDetails>('qti-interaction-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n responseIdentifier: identifier,\n response: Array.isArray(value) ? [...value] : value\n }\n })\n );\n\n if (this.adaptive === 'false') {\n // if adaptive, completionStatus is set by the processing template\n this.updateOutcomeVariable('completionStatus', this.#getCompletionStatus());\n }\n }\n\n /**\n * Updates the template variable with the specified identifier to the given value.\n */\n public updateTemplateVariable(identifier: string, value: string | string[] | undefined) {\n const templateVariable = this._context.variables.find(v => v.identifier === identifier && v.type === 'template') as\n | TemplateVariable\n | undefined;\n\n if (!templateVariable) {\n console.warn(`Can not set qti-template-identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n templateVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n value: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the correct response for the specified response variable.\n */\n public updateCorrectResponse(identifier: string, value: string | string[] | undefined) {\n const responseVariable = this.getResponse(identifier);\n\n if (!responseVariable) {\n console.warn(`Can not set correct response for identifier: ${identifier}, it is not available`);\n return;\n }\n\n const normalizedValue =\n responseVariable.cardinality === 'single'\n ? Array.isArray(value)\n ? value[0]\n : (value ?? null)\n : value === undefined || value === null\n ? null\n : Array.isArray(value)\n ? value\n : [value];\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v =>\n v.identifier !== identifier\n ? v\n : {\n ...v,\n correctResponse: normalizedValue\n }\n )\n };\n\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n public setOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n this.updateOutcomeVariable(identifier, value);\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n\n /**\n * Updates the outcome variable with the specified identifier to the given value.\n *\n * @protected\n *\n * This method is intended for internal use within the class and subclasses.\n * It should not be called externally by third parties.\n *\n * @param identifier - The identifier of the response variable to update.\n * @param value - The new value for the response variable.\n */\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n\n this._context = {\n ...this._context,\n variables: this._context.variables.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : Array.isArray(value) ? value : [value]\n };\n })\n };\n\n this.dispatchEvent(\n new CustomEvent<OutcomeChangedDetails>('qti-outcome-changed', {\n bubbles: true,\n composed: true,\n detail: {\n item: this.identifier,\n outcomeIdentifier: identifier,\n value: this._context.variables.find(v => v.identifier === identifier)?.value\n }\n })\n );\n }\n\n public validate(reportValidity = true): boolean {\n const isValid = this.interactionElements.every(interactionElement => interactionElement.validate());\n this.#publishValidity(isValid);\n\n if (reportValidity) {\n this.reportValidity();\n }\n\n return isValid;\n }\n\n /** Puts the verdict in the item context, where the test and anything else can read it. */\n #publishValidity(valid: boolean): void {\n if (this._context.valid !== valid) {\n this._context = { ...this._context, valid };\n }\n }\n\n /**\n * Checks again after something the interactions' validity depends on changed without them saying\n * so (an answer handed in through `variables`), and tells the test if the verdict moved.\n */\n #revalidate(): void {\n const before = this._context.valid;\n this.validate(false);\n if (this._context.valid !== before) {\n this.dispatchEvent(\n new CustomEvent<{ itemContext: ItemContext }>('qti-item-context-updated', {\n bubbles: true,\n composed: true,\n detail: { itemContext: this._context }\n })\n );\n }\n }\n\n public reportValidity() {\n for (const interactionElement of this.interactionElements) {\n interactionElement.reportValidity();\n }\n }\n\n #getCompletionStatus(): 'completed' | 'incomplete' | 'not_attempted' | 'unknown' {\n const valid = this.validate(false);\n if (valid === true) return 'completed';\n if (valid === false) return 'incomplete';\n return 'not_attempted';\n }\n\n #resetOutcomeVariablesBeforeResponseProcessing(): void {\n this._context = {\n ...this._context,\n variables: this._context.variables.map(variable => {\n if (variable.type !== 'outcome') {\n return variable;\n }\n\n const hasDefaultValue = 'defaultValue' in variable;\n const declaredDefault = hasDefaultValue ? variable.defaultValue : null;\n\n let value = declaredDefault ?? null;\n if (\n (value === null || value === undefined) &&\n (variable.baseType === 'integer' || variable.baseType === 'float')\n ) {\n value = '0';\n }\n\n return {\n ...variable,\n value\n };\n })\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item': QtiAssessmentItem;\n }\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { CSSResultGroup } from 'lit';
|
|
3
|
+
/**
|
|
4
|
+
* @summary Root of a shared stimulus, placed as a whole wherever the stimulus is rendered.
|
|
5
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info#Root_AssessmentStimulus
|
|
6
|
+
* @status stable
|
|
7
|
+
* @since 4.0
|
|
8
|
+
*
|
|
9
|
+
* Generates no box of its own (`display: contents`), so the stimulus lays out as if only its
|
|
10
|
+
* `qti-stimulus-body` were placed. It is kept in the DOM because it carries the stimulus'
|
|
11
|
+
* `xml:lang` (transformed to `lang`): the content inherits its language from here, which is what
|
|
12
|
+
* text-to-speech and screen readers use to pick a voice.
|
|
13
|
+
*
|
|
14
|
+
* Its QTI `title` is removed on connect: it names the stimulus for authors browsing a repository,
|
|
15
|
+
* and as an HTML `title` it would show as a tooltip over the whole passage and be announced by
|
|
16
|
+
* screen readers.
|
|
17
|
+
*
|
|
18
|
+
* @slot - stimulus content: `qti-stylesheet`, `qti-stimulus-body` and `qti-catalog-info` (hidden).
|
|
19
|
+
*/
|
|
20
|
+
export declare class QtiAssessmentStimulus extends LitElement {
|
|
21
|
+
static styles: CSSResultGroup;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
render(): import("lit").TemplateResult<1>;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'qti-assessment-stimulus': QtiAssessmentStimulus;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
import styles from './qti-assessment-stimulus.styles';
|
|
3
|
+
/**
|
|
4
|
+
* @summary Root of a shared stimulus, placed as a whole wherever the stimulus is rendered.
|
|
5
|
+
* @documentation https://www.imsglobal.org/spec/qti/v3p0/info#Root_AssessmentStimulus
|
|
6
|
+
* @status stable
|
|
7
|
+
* @since 4.0
|
|
8
|
+
*
|
|
9
|
+
* Generates no box of its own (`display: contents`), so the stimulus lays out as if only its
|
|
10
|
+
* `qti-stimulus-body` were placed. It is kept in the DOM because it carries the stimulus'
|
|
11
|
+
* `xml:lang` (transformed to `lang`): the content inherits its language from here, which is what
|
|
12
|
+
* text-to-speech and screen readers use to pick a voice.
|
|
13
|
+
*
|
|
14
|
+
* Its QTI `title` is removed on connect: it names the stimulus for authors browsing a repository,
|
|
15
|
+
* and as an HTML `title` it would show as a tooltip over the whole passage and be announced by
|
|
16
|
+
* screen readers.
|
|
17
|
+
*
|
|
18
|
+
* @slot - stimulus content: `qti-stylesheet`, `qti-stimulus-body` and `qti-catalog-info` (hidden).
|
|
19
|
+
*/
|
|
20
|
+
export class QtiAssessmentStimulus extends LitElement {
|
|
21
|
+
static { this.styles = styles; }
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback();
|
|
24
|
+
this.removeAttribute('title');
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
return html `<slot></slot>`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=qti-assessment-stimulus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qti-assessment-stimulus.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-stimulus/qti-assessment-stimulus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,MAAM,MAAM,kCAAkC,CAAC;AAItD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;aACnC,WAAM,GAAmB,MAAM,CAAC;IAEvC,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC","sourcesContent":["import { html, LitElement } from 'lit';\n\nimport styles from './qti-assessment-stimulus.styles';\n\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Root of a shared stimulus, placed as a whole wherever the stimulus is rendered.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/info#Root_AssessmentStimulus\n * @status stable\n * @since 4.0\n *\n * Generates no box of its own (`display: contents`), so the stimulus lays out as if only its\n * `qti-stimulus-body` were placed. It is kept in the DOM because it carries the stimulus'\n * `xml:lang` (transformed to `lang`): the content inherits its language from here, which is what\n * text-to-speech and screen readers use to pick a voice.\n *\n * Its QTI `title` is removed on connect: it names the stimulus for authors browsing a repository,\n * and as an HTML `title` it would show as a tooltip over the whole passage and be announced by\n * screen readers.\n *\n * @slot - stimulus content: `qti-stylesheet`, `qti-stimulus-body` and `qti-catalog-info` (hidden).\n */\nexport class QtiAssessmentStimulus extends LitElement {\n static override styles: CSSResultGroup = styles;\n\n override connectedCallback() {\n super.connectedCallback();\n this.removeAttribute('title');\n }\n\n override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-stimulus': QtiAssessmentStimulus;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qti-assessment-stimulus.styles.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-stimulus/qti-assessment-stimulus.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,eAAe,GAAG,CAAA;;;;;;;;CAQjB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport default css`\n :host {\n display: contents;\n }\n\n ::slotted(qti-catalog-info) {\n display: none;\n }\n`;\n"]}
|
|
@@ -50,10 +50,12 @@ export class QtiAssessmentStimulusRef extends LitElement {
|
|
|
50
50
|
const stimulus = await qtiTransformItem()
|
|
51
51
|
.load(this.href)
|
|
52
52
|
.then(api => api.htmlDoc());
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
// Place the whole qti-assessment-stimulus, not just its body: its `lang` is what the stimulus
|
|
54
|
+
// content inherits its language from.
|
|
55
|
+
const root = stimulus?.querySelector('qti-assessment-stimulus');
|
|
56
|
+
if (root) {
|
|
55
57
|
stimulusRef.innerHTML = '';
|
|
56
|
-
stimulusRef.append(
|
|
58
|
+
stimulusRef.append(root);
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qti-assessment-stimulus-ref.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIhE,MAAM,OAAO,sCAAuC,SAAQ,KAAK;aACjD,cAAS,GAAG,uCAAuC,CAAC;IAClE,YACS,OAAiC,EACjC,IAAuB;QAE9B,KAAK,CAAC,sCAAsC,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAHtG,YAAO,GAAP,OAAO,CAA0B;QACjC,SAAI,GAAJ,IAAI,CAAmB;IAGhC,CAAC;;AAGH;;GAEG;AAEH,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IAAxD;;QAC8B,eAAU,GAAG,EAAE,CAAC;QAChB,SAAI,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"qti-assessment-stimulus-ref.js","sourceRoot":"","sources":["../../../src/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIhE,MAAM,OAAO,sCAAuC,SAAQ,KAAK;aACjD,cAAS,GAAG,uCAAuC,CAAC;IAClE,YACS,OAAiC,EACjC,IAAuB;QAE9B,KAAK,CAAC,sCAAsC,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAHtG,YAAO,GAAP,OAAO,CAA0B;QACjC,SAAI,GAAJ,IAAI,CAAmB;IAGhC,CAAC;;AAGH;;GAEG;AAEH,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IAAxD;;QAC8B,eAAU,GAAG,EAAE,CAAC;QAChB,SAAI,GAAG,EAAE,CAAC;IAwCxC,CAAC;IAtCC;;;;OAIG;IACa,KAAK,CAAC,iBAAiB;QACrC,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,mGAAmG;QACnG,mEAAmE;QACnE,MAAM,IAAI,CAAC,cAAc,CAAC;QAE1B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAoB,qBAAqB,CAAC,CAAC;QAEpE,MAAM,KAAK,GAAG,IAAI,sCAAsC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE1B,MAAM,WAAW,GAAG,IAAI,EAAE,aAAa,CAAC,yBAAyB,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;QACtF,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,WAAW,EAAE,CAAC;YAC3C,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,iBAAiB,CAAC,WAAoB;QACjD,MAAM,QAAQ,GAAG,MAAM,gBAAgB,EAAE;aACtC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9B,8FAA8F;QAC9F,sCAAsC;QACtC,MAAM,IAAI,GAAG,QAAQ,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;QAChE,IAAI,IAAI,EAAE,CAAC;YACT,WAAW,CAAC,SAAS,GAAG,EAAE,CAAC;YAC3B,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF;AAzC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAAW","sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { qtiTransformItem } from '@qti-components/transformers';\n\nimport type { QtiAssessmentItem } from '../qti-assessment-item/qti-assessment-item';\n\nexport class QtiAssessmentStimulusRefConnectedEvent extends Event {\n public static eventName = 'qti-assessment-stimulus-ref-connected';\n constructor(\n public element: QtiAssessmentStimulusRef,\n public item: QtiAssessmentItem\n ) {\n super(QtiAssessmentStimulusRefConnectedEvent.eventName, { bubbles: true, composed: true, cancelable: true });\n }\n}\n\n/**\n * Represents a custom element for referencing an assessment stimulus.\n */\n\nexport class QtiAssessmentStimulusRef extends LitElement {\n @property({ type: String }) identifier = '';\n @property({ type: String }) href = '';\n\n /**\n * Lifecycle method called when the element is connected to the DOM.\n * First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly.\n * If not found, delegates to the delivery platform via an event.\n */\n public override async connectedCallback(): Promise<void> {\n super.connectedCallback();\n // VERY important to wait for updateComplete to ensure that the stimulusRef is connected after item\n // for the test-navigation to correctly process everything in order\n await this.updateComplete;\n\n const item = this.closest<QtiAssessmentItem>('qti-assessment-item');\n\n const event = new QtiAssessmentStimulusRefConnectedEvent(this, item);\n this.dispatchEvent(event);\n\n const stimulusRef = item?.querySelector(`[data-stimulus-idref=\"${this.identifier}\"]`);\n if (!event.defaultPrevented && stimulusRef) {\n await this.updateStimulusRef(stimulusRef);\n }\n }\n\n /**\n * Loads and appends the stimulus to the specified element.\n * @param stimulusRef - The element to which the stimulus will be appended.\n */\n public async updateStimulusRef(stimulusRef: Element) {\n const stimulus = await qtiTransformItem()\n .load(this.href)\n .then(api => api.htmlDoc());\n // Place the whole qti-assessment-stimulus, not just its body: its `lang` is what the stimulus\n // content inherits its language from.\n const root = stimulus?.querySelector('qti-assessment-stimulus');\n if (root) {\n stimulusRef.innerHTML = '';\n stimulusRef.append(root);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-stimulus-ref': QtiAssessmentStimulusRef;\n }\n}\n"]}
|
package/dist/elements.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';
|
|
2
|
+
import { QtiAssessmentStimulus } from './components/qti-assessment-stimulus/qti-assessment-stimulus';
|
|
2
3
|
import { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
|
|
3
4
|
import { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';
|
|
4
5
|
import { QtiContentBody } from './components/qti-content-body/qti-content-body';
|
|
@@ -16,10 +17,13 @@ import { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';
|
|
|
16
17
|
import { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';
|
|
17
18
|
import { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';
|
|
18
19
|
import { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';
|
|
19
|
-
export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
|
|
20
|
+
export { QtiAssessmentItem, QtiAssessmentStimulus, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
|
|
20
21
|
export declare const qtiContentElements: readonly [{
|
|
21
22
|
readonly tag: "qti-assessment-item";
|
|
22
23
|
readonly ctor: typeof QtiAssessmentItem;
|
|
24
|
+
}, {
|
|
25
|
+
readonly tag: "qti-assessment-stimulus";
|
|
26
|
+
readonly ctor: typeof QtiAssessmentStimulus;
|
|
23
27
|
}, {
|
|
24
28
|
readonly tag: "qti-assessment-stimulus-ref";
|
|
25
29
|
readonly ctor: typeof QtiAssessmentStimulusRef;
|
package/dist/elements.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';
|
|
2
|
+
import { QtiAssessmentStimulus } from './components/qti-assessment-stimulus/qti-assessment-stimulus';
|
|
2
3
|
import { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
|
|
3
4
|
import { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';
|
|
4
5
|
import { QtiContentBody } from './components/qti-content-body/qti-content-body';
|
|
@@ -16,9 +17,10 @@ import { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';
|
|
|
16
17
|
import { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';
|
|
17
18
|
import { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';
|
|
18
19
|
import { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';
|
|
19
|
-
export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
|
|
20
|
+
export { QtiAssessmentItem, QtiAssessmentStimulus, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
|
|
20
21
|
export const qtiContentElements = [
|
|
21
22
|
{ tag: 'qti-assessment-item', ctor: QtiAssessmentItem },
|
|
23
|
+
{ tag: 'qti-assessment-stimulus', ctor: QtiAssessmentStimulus },
|
|
22
24
|
{ tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },
|
|
23
25
|
{ tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },
|
|
24
26
|
{ tag: 'qti-content-body', ctor: QtiContentBody },
|
package/dist/elements.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts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entItem } from './components/qti-assessment-item/qti-assessment-item';\nimport { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nimport { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';\nimport { QtiContentBody } from './components/qti-content-body/qti-content-body';\nimport { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';\nimport { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';\nimport { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';\nimport { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';\nimport { QtiItemBody } from './components/qti-item-body/qti-item-body';\nimport { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';\nimport { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';\nimport { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';\nimport { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';\nimport { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';\nimport { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';\nimport { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';\nimport { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';\nimport { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';\n\nexport {\n QtiAssessmentItem,\n QtiAssessmentStimulusRef,\n QtiCompanionMaterialsInfo,\n QtiContentBody,\n QtiContextDeclaration,\n QtiCustomOperator,\n QtiFeedbackBlock,\n QtiFeedbackInline,\n QtiItemBody,\n QtiModalFeedback,\n QtiOutcomeDeclaration,\n QtiResponseDeclaration,\n QtiResponseProcessing,\n QtiRubricBlock,\n QtiStylesheet,\n QtiTemplateConstraint,\n QtiTemplateDeclaration,\n QtiTemplateProcessing\n};\n\nexport const qtiContentElements = [\n { tag: 'qti-assessment-item', ctor: QtiAssessmentItem },\n { tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },\n { tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },\n { tag: 'qti-content-body', ctor: QtiContentBody },\n { tag: 'qti-context-declaration', ctor: QtiContextDeclaration },\n { tag: 'qti-custom-operator', ctor: QtiCustomOperator },\n { tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },\n { tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },\n { tag: 'qti-item-body', ctor: QtiItemBody },\n { tag: 'qti-modal-feedback', ctor: QtiModalFeedback },\n { tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },\n { tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },\n { tag: 'qti-response-processing', ctor: QtiResponseProcessing },\n { tag: 'qti-rubric-block', ctor: QtiRubricBlock },\n { tag: 'qti-stylesheet', ctor: QtiStylesheet },\n { tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },\n { tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },\n { tag: 'qti-template-processing', ctor: QtiTemplateProcessing }\n] as const;\n"]}
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sEAAsE,CAAC;AAChH,OAAO,EAAE,yBAAyB,EAAE,MAAM,wEAAwE,CAAC;AACnH,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,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I,EAAE,iBAAiB,EAAE;IACvD,EAAE,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACrD,EAAE,GAAG,EAAE,qBAAqB,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACvD,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACrD,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/D,EAAE,GAAG,EAAE,0BAA0B,EAAE,IAAI,EAAE,sBAAsB,EAAE;IACjE,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/D,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;IACjD,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE;IAC9C,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/D,EAAE,GAAG,EAAE,0BAA0B,EAAE,IAAI,EAAE,sBAAsB,EAAE;IACjE,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;CACvD,CAAC","sourcesContent":["import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';\nimport { QtiAssessmentStimulus } from './components/qti-assessment-stimulus/qti-assessment-stimulus';\nimport { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nimport { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';\nimport { QtiContentBody } from './components/qti-content-body/qti-content-body';\nimport { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';\nimport { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';\nimport { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';\nimport { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';\nimport { QtiItemBody } from './components/qti-item-body/qti-item-body';\nimport { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';\nimport { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';\nimport { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';\nimport { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';\nimport { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';\nimport { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';\nimport { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';\nimport { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';\nimport { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';\n\nexport {\n QtiAssessmentItem,\n QtiAssessmentStimulus,\n QtiAssessmentStimulusRef,\n QtiCompanionMaterialsInfo,\n QtiContentBody,\n QtiContextDeclaration,\n QtiCustomOperator,\n QtiFeedbackBlock,\n QtiFeedbackInline,\n QtiItemBody,\n QtiModalFeedback,\n QtiOutcomeDeclaration,\n QtiResponseDeclaration,\n QtiResponseProcessing,\n QtiRubricBlock,\n QtiStylesheet,\n QtiTemplateConstraint,\n QtiTemplateDeclaration,\n QtiTemplateProcessing\n};\n\nexport const qtiContentElements = [\n { tag: 'qti-assessment-item', ctor: QtiAssessmentItem },\n { tag: 'qti-assessment-stimulus', ctor: QtiAssessmentStimulus },\n { tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },\n { tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },\n { tag: 'qti-content-body', ctor: QtiContentBody },\n { tag: 'qti-context-declaration', ctor: QtiContextDeclaration },\n { tag: 'qti-custom-operator', ctor: QtiCustomOperator },\n { tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },\n { tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },\n { tag: 'qti-item-body', ctor: QtiItemBody },\n { tag: 'qti-modal-feedback', ctor: QtiModalFeedback },\n { tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },\n { tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },\n { tag: 'qti-response-processing', ctor: QtiResponseProcessing },\n { tag: 'qti-rubric-block', ctor: QtiRubricBlock },\n { tag: 'qti-stylesheet', ctor: QtiStylesheet },\n { tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },\n { tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },\n { tag: 'qti-template-processing', ctor: QtiTemplateProcessing }\n] as const;\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './register';
|
|
2
2
|
export * from './components/qti-assessment-item/qti-assessment-item';
|
|
3
|
+
export * from './components/qti-assessment-stimulus/qti-assessment-stimulus';
|
|
3
4
|
export * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
|
|
4
5
|
export * from './components/qti-companion-materials-info/qti-companion-materials-info';
|
|
5
6
|
export * from './components/qti-custom-operator/qti-custom-operator';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import './register';
|
|
2
2
|
export * from './components/qti-assessment-item/qti-assessment-item';
|
|
3
|
+
export * from './components/qti-assessment-stimulus/qti-assessment-stimulus';
|
|
3
4
|
export * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
|
|
4
5
|
export * from './components/qti-companion-materials-info/qti-companion-materials-info';
|
|
5
6
|
export * from './components/qti-custom-operator/qti-custom-operator';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,cAAc,sDAAsD,CAAC;AACrE,cAAc,sEAAsE,CAAC;AACrF,cAAc,wEAAwE,CAAC;AACvF,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC","sourcesContent":["import './register';\n\nexport * from './components/qti-assessment-item/qti-assessment-item';\nexport * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nexport * from './components/qti-companion-materials-info/qti-companion-materials-info';\nexport * from './components/qti-custom-operator/qti-custom-operator';\nexport * from './components/qti-feedback-block/qti-feedback-block';\nexport * from './components/qti-feedback-inline/qti-feedback-inline';\nexport * from './components/qti-modal-feedback/qti-modal-feedback';\nexport * from './components/qti-item-body/qti-item-body';\nexport * from './components/qti-content-body/qti-content-body';\nexport * from './components/qti-rubric-block/qti-rubric-block';\nexport * from './components/qti-stylesheet/qti-stylesheet';\nexport * from './components/qti-response-declaration/qti-response-declaration';\nexport * from './components/qti-outcome-declaration/qti-outcome-declaration';\nexport * from './components/qti-response-processing/qti-response-processing';\nexport * from './components/qti-template-declaration/qti-template-declaration';\nexport * from './components/qti-template-processing/qti-template-processing';\nexport * from './components/qti-template-constraint/qti-template-constraint';\nexport * from './components/qti-context-declaration/qti-context-declaration';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,sEAAsE,CAAC;AACrF,cAAc,wEAAwE,CAAC;AACvF,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC","sourcesContent":["import './register';\n\nexport * from './components/qti-assessment-item/qti-assessment-item';\nexport * from './components/qti-assessment-stimulus/qti-assessment-stimulus';\nexport * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nexport * from './components/qti-companion-materials-info/qti-companion-materials-info';\nexport * from './components/qti-custom-operator/qti-custom-operator';\nexport * from './components/qti-feedback-block/qti-feedback-block';\nexport * from './components/qti-feedback-inline/qti-feedback-inline';\nexport * from './components/qti-modal-feedback/qti-modal-feedback';\nexport * from './components/qti-item-body/qti-item-body';\nexport * from './components/qti-content-body/qti-content-body';\nexport * from './components/qti-rubric-block/qti-rubric-block';\nexport * from './components/qti-stylesheet/qti-stylesheet';\nexport * from './components/qti-response-declaration/qti-response-declaration';\nexport * from './components/qti-outcome-declaration/qti-outcome-declaration';\nexport * from './components/qti-response-processing/qti-response-processing';\nexport * from './components/qti-template-declaration/qti-template-declaration';\nexport * from './components/qti-template-processing/qti-template-processing';\nexport * from './components/qti-template-constraint/qti-template-constraint';\nexport * from './components/qti-context-declaration/qti-context-declaration';\n"]}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qti-components/elements",
|
|
3
3
|
"description": "QTI elements utilities",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.0",
|
|
5
5
|
"author": "",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@qti-components/base": "^2.
|
|
7
|
+
"@qti-components/base": "^2.4.0",
|
|
8
8
|
"@qti-components/transformers": "^1.7.3",
|
|
9
9
|
"@qti-components/utilities": "^1.3.3"
|
|
10
10
|
},
|