@citolab/qti-components 8.0.1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +648 -816
- package/dist/base.d.ts +61 -4
- package/dist/base.js +7 -1
- package/dist/{chunk-V5G7X53Y.js → chunk-3IACYIU2.js} +2 -2
- package/dist/chunk-4DB4SC5K.js +100 -0
- package/dist/chunk-4DB4SC5K.js.map +1 -0
- package/dist/{chunk-F4BNJWYN.js → chunk-4XR2JHCP.js} +646 -677
- package/dist/chunk-4XR2JHCP.js.map +1 -0
- package/dist/{chunk-7V4HJFHW.js → chunk-6ITD55QE.js} +2 -2
- package/dist/{chunk-3AJOQCDU.js → chunk-6V3A7NQP.js} +2 -2
- package/dist/{chunk-WVVMNF74.js → chunk-6XJUP55A.js} +248 -234
- package/dist/chunk-6XJUP55A.js.map +1 -0
- package/dist/{chunk-XU7HNT4F.js → chunk-CF3DXJWM.js} +145 -119
- package/dist/{chunk-XU7HNT4F.js.map → chunk-CF3DXJWM.js.map} +1 -1
- package/dist/chunk-EKXZI26R.js +917 -0
- package/dist/chunk-EKXZI26R.js.map +1 -0
- package/dist/{chunk-IJD53WY6.js → chunk-HDEG6BAZ.js} +15 -15
- package/dist/{chunk-IJD53WY6.js.map → chunk-HDEG6BAZ.js.map} +1 -1
- package/dist/{chunk-LVBIQDPM.js → chunk-IXPDMYKH.js} +147 -101
- package/dist/chunk-IXPDMYKH.js.map +1 -0
- package/dist/chunk-IYC7LZV6.js +7 -0
- package/dist/chunk-IYC7LZV6.js.map +1 -0
- package/dist/{chunk-NA2N2WSG.js → chunk-MK2I3MQB.js} +244 -193
- package/dist/chunk-MK2I3MQB.js.map +1 -0
- package/dist/{chunk-CAO4JRLY.js → chunk-NZLW6EX7.js} +2 -2
- package/dist/{chunk-RXGDQDOV.js → chunk-Q52IJELT.js} +479 -393
- package/dist/chunk-Q52IJELT.js.map +1 -0
- package/dist/{chunk-QECOPVPO.js → chunk-TXIB3SKC.js} +60 -59
- package/dist/chunk-TXIB3SKC.js.map +1 -0
- package/dist/{computed.types.d-rKLSPvVG.d.ts → computed.types.d-DpKIYO6e.d.ts} +2 -0
- package/dist/corrections.d.ts +12 -29
- package/dist/corrections.js +9 -10
- package/dist/elements.d.ts +86 -87
- package/dist/elements.js +5 -6
- package/dist/index.d.ts +8 -39
- package/dist/index.js +29 -16
- package/dist/{interaction.d-D4MstYRz.d.ts → interaction.d-CJiMv8H7.d.ts} +13 -2
- package/dist/interactions.d.ts +11 -1299
- package/dist/interactions.js +4 -5
- package/dist/item.css +370 -532
- package/dist/item.d.ts +3 -3
- package/dist/item.js +6 -6
- package/dist/loader.js +2 -2
- package/dist/processing.d.ts +61 -11
- package/dist/processing.js +10 -2
- package/dist/qti-components-jsx.d.ts +293 -69
- package/dist/qti-test.d-_YAlhDbt.d.ts +702 -0
- package/dist/qti-text-entry-interaction.d-BGdfV9qG.d.ts +1567 -0
- package/dist/test.d.ts +11 -678
- package/dist/test.js +7 -8
- package/dist/transformers.d.ts +1 -1
- package/dist/transformers.js +1 -1
- package/package.json +11 -10
- package/dist/chunk-64XSIBGO.js +0 -241
- package/dist/chunk-64XSIBGO.js.map +0 -1
- package/dist/chunk-7HC5SMCU.js +0 -102
- package/dist/chunk-7HC5SMCU.js.map +0 -1
- package/dist/chunk-F4BNJWYN.js.map +0 -1
- package/dist/chunk-H3J7LFRO.js +0 -2243
- package/dist/chunk-H3J7LFRO.js.map +0 -1
- package/dist/chunk-LVBIQDPM.js.map +0 -1
- package/dist/chunk-NA2N2WSG.js.map +0 -1
- package/dist/chunk-QECOPVPO.js.map +0 -1
- package/dist/chunk-RXGDQDOV.js.map +0 -1
- package/dist/chunk-WVVMNF74.js.map +0 -1
- package/dist/chunk-X3E5HXG2.js +0 -20
- package/dist/chunk-X3E5HXG2.js.map +0 -1
- /package/dist/{chunk-V5G7X53Y.js.map → chunk-3IACYIU2.js.map} +0 -0
- /package/dist/{chunk-7V4HJFHW.js.map → chunk-6ITD55QE.js.map} +0 -0
- /package/dist/{chunk-3AJOQCDU.js.map → chunk-6V3A7NQP.js.map} +0 -0
- /package/dist/{chunk-CAO4JRLY.js.map → chunk-NZLW6EX7.js.map} +0 -0
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
QtiHottext,
|
|
6
6
|
QtiSimpleAssociableChoice,
|
|
7
7
|
QtiSimpleChoice,
|
|
8
|
-
c as c2,
|
|
9
8
|
dragDropContext,
|
|
10
9
|
elements,
|
|
11
10
|
elements10,
|
|
@@ -23,25 +22,26 @@ import {
|
|
|
23
22
|
elements7,
|
|
24
23
|
elements8,
|
|
25
24
|
elements9
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-4XR2JHCP.js";
|
|
27
26
|
import {
|
|
28
27
|
Interaction,
|
|
29
|
-
T,
|
|
30
28
|
boxSizing,
|
|
31
|
-
c,
|
|
32
29
|
dropRegion,
|
|
33
|
-
i,
|
|
34
|
-
i2,
|
|
35
|
-
n2 as n,
|
|
36
|
-
r,
|
|
37
30
|
removeDoubleSlashes
|
|
38
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-EKXZI26R.js";
|
|
32
|
+
|
|
33
|
+
// ../interactions/core/dist/elements/qti-associable-hotspot/qti-associable-hotspot.js
|
|
34
|
+
import { LitElement, html } from "lit";
|
|
35
|
+
import { property, state } from "lit/decorators.js";
|
|
36
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
37
|
+
import { consume } from "@lit/context";
|
|
39
38
|
|
|
40
39
|
// ../interactions/core/dist/elements/qti-associable-hotspot/qti-associable-hotspot.styles.js
|
|
40
|
+
import { css } from "lit";
|
|
41
41
|
var qti_associable_hotspot_styles_default = [
|
|
42
42
|
boxSizing,
|
|
43
43
|
dropRegion,
|
|
44
|
-
|
|
44
|
+
css`
|
|
45
45
|
/* A drop target — see qti-gap.styles.ts. The interaction publishes the chip measurements as
|
|
46
46
|
custom properties on its host; the properties themselves live here. */
|
|
47
47
|
:host {
|
|
@@ -64,12 +64,12 @@ var qti_associable_hotspot_styles_default = [
|
|
|
64
64
|
|
|
65
65
|
// ../interactions/core/dist/elements/qti-associable-hotspot/qti-associable-hotspot.js
|
|
66
66
|
var __decorate = function(decorators, target, key, desc) {
|
|
67
|
-
var
|
|
68
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
69
|
-
else for (var
|
|
70
|
-
return
|
|
67
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
68
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
69
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
70
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
71
71
|
};
|
|
72
|
-
var QtiAssociableHotspot = class extends
|
|
72
|
+
var QtiAssociableHotspot = class extends LitElement {
|
|
73
73
|
constructor() {
|
|
74
74
|
super(...arguments);
|
|
75
75
|
this.internals = this.attachInternals();
|
|
@@ -91,24 +91,31 @@ var QtiAssociableHotspot = class extends i2 {
|
|
|
91
91
|
}));
|
|
92
92
|
}
|
|
93
93
|
render() {
|
|
94
|
-
return
|
|
95
|
-
${
|
|
94
|
+
return html`<div part="drop">
|
|
95
|
+
${repeat(this.drags, (node) => node.getAttribute("identifier"), (node) => node)}
|
|
96
96
|
</div>`;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
__decorate([
|
|
100
|
-
|
|
100
|
+
property({ type: String, reflect: true })
|
|
101
101
|
], QtiAssociableHotspot.prototype, "identifier", void 0);
|
|
102
102
|
__decorate([
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
consume({ context: dragDropContext, subscribe: true }),
|
|
104
|
+
state()
|
|
105
105
|
], QtiAssociableHotspot.prototype, "_dragDrop", void 0);
|
|
106
106
|
|
|
107
|
+
// ../interactions/core/dist/elements/qti-gap/qti-gap.js
|
|
108
|
+
import { html as html2, LitElement as LitElement2 } from "lit";
|
|
109
|
+
import { property as property2, state as state2 } from "lit/decorators.js";
|
|
110
|
+
import { repeat as repeat2 } from "lit/directives/repeat.js";
|
|
111
|
+
import { consume as consume2 } from "@lit/context";
|
|
112
|
+
|
|
107
113
|
// ../interactions/core/dist/elements/qti-gap/qti-gap.styles.js
|
|
114
|
+
import { css as css2 } from "lit";
|
|
108
115
|
var qti_gap_styles_default = [
|
|
109
116
|
boxSizing,
|
|
110
117
|
dropRegion,
|
|
111
|
-
|
|
118
|
+
css2`
|
|
112
119
|
/*
|
|
113
120
|
* A drop target. The interaction measures its chips and publishes the result as custom
|
|
114
121
|
* properties on its own host; the actual CSS properties live here, not in a style attribute.
|
|
@@ -158,12 +165,12 @@ var qti_gap_styles_default = [
|
|
|
158
165
|
|
|
159
166
|
// ../interactions/core/dist/elements/qti-gap/qti-gap.js
|
|
160
167
|
var __decorate2 = function(decorators, target, key, desc) {
|
|
161
|
-
var
|
|
162
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
163
|
-
else for (var
|
|
164
|
-
return
|
|
168
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
169
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
170
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
171
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
165
172
|
};
|
|
166
|
-
var QtiGap = class extends
|
|
173
|
+
var QtiGap = class extends LitElement2 {
|
|
167
174
|
constructor() {
|
|
168
175
|
super(...arguments);
|
|
169
176
|
this.internals = this.attachInternals();
|
|
@@ -178,26 +185,31 @@ var QtiGap = class extends i2 {
|
|
|
178
185
|
return this._dragDrop?.nodesByTarget?.[this.identifier] ?? [];
|
|
179
186
|
}
|
|
180
187
|
render() {
|
|
181
|
-
return
|
|
182
|
-
${
|
|
188
|
+
return html2`<div part="drop">
|
|
189
|
+
${repeat2(this.drags, (node) => node.getAttribute("identifier"), (node) => node)}
|
|
183
190
|
</div>`;
|
|
184
191
|
}
|
|
185
192
|
};
|
|
186
193
|
__decorate2([
|
|
187
|
-
|
|
194
|
+
property2({ type: Number, reflect: true })
|
|
188
195
|
], QtiGap.prototype, "tabindex", void 0);
|
|
189
196
|
__decorate2([
|
|
190
|
-
|
|
197
|
+
property2({ type: String, reflect: true })
|
|
191
198
|
], QtiGap.prototype, "identifier", void 0);
|
|
192
199
|
__decorate2([
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
consume2({ context: dragDropContext, subscribe: true }),
|
|
201
|
+
state2()
|
|
195
202
|
], QtiGap.prototype, "_dragDrop", void 0);
|
|
196
203
|
|
|
204
|
+
// ../interactions/core/dist/elements/qti-gap-img/qti-gap-img.js
|
|
205
|
+
import { LitElement as LitElement3 } from "lit";
|
|
206
|
+
import { property as property3 } from "lit/decorators.js";
|
|
207
|
+
|
|
197
208
|
// ../interactions/core/dist/elements/qti-gap-img/qti-gap-img.styles.js
|
|
209
|
+
import { css as css3 } from "lit";
|
|
198
210
|
var qti_gap_img_styles_default = [
|
|
199
211
|
boxSizing,
|
|
200
|
-
|
|
212
|
+
css3`
|
|
201
213
|
/* Centred, because a gap-img is a picture inside a drop the same size as it. Was in the theme's
|
|
202
214
|
graphic-gap-match rules, on the host from the document. */
|
|
203
215
|
:host {
|
|
@@ -211,12 +223,12 @@ var qti_gap_img_styles_default = [
|
|
|
211
223
|
|
|
212
224
|
// ../interactions/core/dist/elements/qti-gap-img/qti-gap-img.js
|
|
213
225
|
var __decorate3 = function(decorators, target, key, desc) {
|
|
214
|
-
var
|
|
215
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
216
|
-
else for (var
|
|
217
|
-
return
|
|
226
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
227
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
228
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
229
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
218
230
|
};
|
|
219
|
-
var QtiGapImg = class extends
|
|
231
|
+
var QtiGapImg = class extends LitElement3 {
|
|
220
232
|
constructor() {
|
|
221
233
|
super(...arguments);
|
|
222
234
|
this.tabindex = 0;
|
|
@@ -230,11 +242,16 @@ var QtiGapImg = class extends i2 {
|
|
|
230
242
|
}
|
|
231
243
|
};
|
|
232
244
|
__decorate3([
|
|
233
|
-
|
|
245
|
+
property3({ type: Number, reflect: true })
|
|
234
246
|
], QtiGapImg.prototype, "tabindex", void 0);
|
|
235
247
|
|
|
248
|
+
// ../interactions/core/dist/elements/qti-inline-choice/qti-inline-choice.js
|
|
249
|
+
import { html as html3, LitElement as LitElement4 } from "lit";
|
|
250
|
+
import { property as property4 } from "lit/decorators.js";
|
|
251
|
+
|
|
236
252
|
// ../interactions/core/dist/elements/qti-inline-choice/qti-inline-choice.styles.js
|
|
237
|
-
|
|
253
|
+
import { css as css4 } from "lit";
|
|
254
|
+
var styles = css4`
|
|
238
255
|
/*
|
|
239
256
|
* An option row: one line, clipped, with its text centred against the row's min-height. All four
|
|
240
257
|
* were in the theme, set on this host from the document — which is also why the 'display: block'
|
|
@@ -256,12 +273,12 @@ var qti_inline_choice_styles_default = styles;
|
|
|
256
273
|
|
|
257
274
|
// ../interactions/core/dist/elements/qti-inline-choice/qti-inline-choice.js
|
|
258
275
|
var __decorate4 = function(decorators, target, key, desc) {
|
|
259
|
-
var
|
|
260
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
261
|
-
else for (var
|
|
262
|
-
return
|
|
276
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
277
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
278
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
279
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
263
280
|
};
|
|
264
|
-
var QtiInlineChoice = class extends ActiveElementMixin(
|
|
281
|
+
var QtiInlineChoice = class extends ActiveElementMixin(LitElement4, "qti-inline-choice") {
|
|
265
282
|
static {
|
|
266
283
|
this.styles = qti_inline_choice_styles_default;
|
|
267
284
|
}
|
|
@@ -278,7 +295,7 @@ var QtiInlineChoice = class extends ActiveElementMixin(i2, "qti-inline-choice")
|
|
|
278
295
|
this.removeEventListener("click", this.#onSelectInlineChoice);
|
|
279
296
|
}
|
|
280
297
|
render() {
|
|
281
|
-
return
|
|
298
|
+
return html3` <slot></slot> `;
|
|
282
299
|
}
|
|
283
300
|
#onSelectInlineChoice() {
|
|
284
301
|
this.dispatchEvent(new CustomEvent("qti-inline-choice-select", {
|
|
@@ -290,13 +307,17 @@ var QtiInlineChoice = class extends ActiveElementMixin(i2, "qti-inline-choice")
|
|
|
290
307
|
}
|
|
291
308
|
};
|
|
292
309
|
__decorate4([
|
|
293
|
-
|
|
310
|
+
property4({ type: String })
|
|
294
311
|
], QtiInlineChoice.prototype, "identifier", void 0);
|
|
295
312
|
|
|
313
|
+
// ../interactions/core/dist/elements/qti-prompt/qti-prompt.js
|
|
314
|
+
import { html as html4, LitElement as LitElement5 } from "lit";
|
|
315
|
+
|
|
296
316
|
// ../interactions/core/dist/elements/qti-prompt/qti-prompt.styles.js
|
|
317
|
+
import { css as css5 } from "lit";
|
|
297
318
|
var qti_prompt_styles_default = [
|
|
298
319
|
boxSizing,
|
|
299
|
-
|
|
320
|
+
css5`
|
|
300
321
|
:host {
|
|
301
322
|
display: block;
|
|
302
323
|
margin: var(--qti-gap) 0;
|
|
@@ -306,12 +327,12 @@ var qti_prompt_styles_default = [
|
|
|
306
327
|
];
|
|
307
328
|
|
|
308
329
|
// ../interactions/core/dist/elements/qti-prompt/qti-prompt.js
|
|
309
|
-
var QtiPrompt = class extends
|
|
330
|
+
var QtiPrompt = class extends LitElement5 {
|
|
310
331
|
static {
|
|
311
332
|
this.styles = qti_prompt_styles_default;
|
|
312
333
|
}
|
|
313
334
|
render() {
|
|
314
|
-
return
|
|
335
|
+
return html4`<slot></slot>`;
|
|
315
336
|
}
|
|
316
337
|
connectedCallback() {
|
|
317
338
|
super.connectedCallback();
|
|
@@ -322,10 +343,15 @@ var QtiPrompt = class extends i2 {
|
|
|
322
343
|
}
|
|
323
344
|
};
|
|
324
345
|
|
|
346
|
+
// ../interactions/custom-interaction/dist/qti-custom-interaction.js
|
|
347
|
+
import { html as html5 } from "lit";
|
|
348
|
+
import { property as property5, state as state3 } from "lit/decorators.js";
|
|
349
|
+
|
|
325
350
|
// ../interactions/custom-interaction/dist/qti-custom-interaction.styles.js
|
|
351
|
+
import { css as css6 } from "lit";
|
|
326
352
|
var qti_custom_interaction_styles_default = [
|
|
327
353
|
boxSizing,
|
|
328
|
-
|
|
354
|
+
css6`
|
|
329
355
|
/* The box this element already had. See the note in qti-match-interaction.styles.ts. */
|
|
330
356
|
:host {
|
|
331
357
|
display: block;
|
|
@@ -335,10 +361,10 @@ var qti_custom_interaction_styles_default = [
|
|
|
335
361
|
|
|
336
362
|
// ../interactions/custom-interaction/dist/qti-custom-interaction.js
|
|
337
363
|
var __decorate5 = function(decorators, target, key, desc) {
|
|
338
|
-
var
|
|
339
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
340
|
-
else for (var
|
|
341
|
-
return
|
|
364
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
365
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
366
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
367
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
342
368
|
};
|
|
343
369
|
var registerCES = `
|
|
344
370
|
const postToParentWindows = (type, data) => {
|
|
@@ -559,18 +585,18 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
559
585
|
this.#resourceBaseUrl = indexResolved.baseUrl;
|
|
560
586
|
}
|
|
561
587
|
if (indexResolved.text) {
|
|
562
|
-
let
|
|
563
|
-
const alreadyModified =
|
|
588
|
+
let html11 = indexResolved.text;
|
|
589
|
+
const alreadyModified = html11.includes("postToParentWindows") || html11.includes("window.CES");
|
|
564
590
|
if (!alreadyModified) {
|
|
565
591
|
const cesScript = "<script>" + registerCES + "</script>";
|
|
566
|
-
const headIndex =
|
|
592
|
+
const headIndex = html11.indexOf("<head>");
|
|
567
593
|
if (headIndex !== -1) {
|
|
568
|
-
|
|
594
|
+
html11 = html11.slice(0, headIndex + 6) + cesScript + html11.slice(headIndex + 6);
|
|
569
595
|
} else {
|
|
570
|
-
|
|
596
|
+
html11 = cesScript + html11;
|
|
571
597
|
}
|
|
572
598
|
}
|
|
573
|
-
const blob = new Blob([
|
|
599
|
+
const blob = new Blob([html11], { type: "text/html" });
|
|
574
600
|
this.#contentBlobUrl = URL.createObjectURL(blob);
|
|
575
601
|
}
|
|
576
602
|
} else {
|
|
@@ -585,18 +611,18 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
585
611
|
this.#resourceBaseUrl = indexResolved.baseUrl;
|
|
586
612
|
}
|
|
587
613
|
if (indexResolved.text) {
|
|
588
|
-
let
|
|
589
|
-
const alreadyModified =
|
|
614
|
+
let html11 = indexResolved.text;
|
|
615
|
+
const alreadyModified = html11.includes("postToParentWindows") || html11.includes("window.CES");
|
|
590
616
|
if (!alreadyModified) {
|
|
591
617
|
const cesScript = "<script>" + registerCES + "</script>";
|
|
592
|
-
const headIndex =
|
|
618
|
+
const headIndex = html11.indexOf("<head>");
|
|
593
619
|
if (headIndex !== -1) {
|
|
594
|
-
|
|
620
|
+
html11 = html11.slice(0, headIndex + 6) + cesScript + html11.slice(headIndex + 6);
|
|
595
621
|
} else {
|
|
596
|
-
|
|
622
|
+
html11 = cesScript + html11;
|
|
597
623
|
}
|
|
598
624
|
}
|
|
599
|
-
const blob = new Blob([
|
|
625
|
+
const blob = new Blob([html11], { type: "text/html" });
|
|
600
626
|
this.#contentBlobUrl = URL.createObjectURL(blob);
|
|
601
627
|
}
|
|
602
628
|
}
|
|
@@ -604,18 +630,18 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
604
630
|
try {
|
|
605
631
|
const indexResponse = await fetch(indexUrl);
|
|
606
632
|
if (indexResponse.ok) {
|
|
607
|
-
let
|
|
608
|
-
const alreadyModified =
|
|
633
|
+
let html11 = await indexResponse.text();
|
|
634
|
+
const alreadyModified = html11.includes("postToParentWindows") || html11.includes("window.CES");
|
|
609
635
|
if (!alreadyModified) {
|
|
610
636
|
const cesScript = "<script>" + registerCES + "</script>";
|
|
611
|
-
const headIndex =
|
|
637
|
+
const headIndex = html11.indexOf("<head>");
|
|
612
638
|
if (headIndex !== -1) {
|
|
613
|
-
|
|
639
|
+
html11 = html11.slice(0, headIndex + 6) + cesScript + html11.slice(headIndex + 6);
|
|
614
640
|
} else {
|
|
615
|
-
|
|
641
|
+
html11 = cesScript + html11;
|
|
616
642
|
}
|
|
617
643
|
}
|
|
618
|
-
const blob = new Blob([
|
|
644
|
+
const blob = new Blob([html11], { type: "text/html" });
|
|
619
645
|
this.#contentBlobUrl = URL.createObjectURL(blob);
|
|
620
646
|
} else {
|
|
621
647
|
console.error(`Failed to fetch index.html: ${indexResponse.status}`);
|
|
@@ -769,7 +795,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
769
795
|
super.disconnectedCallback();
|
|
770
796
|
}
|
|
771
797
|
render() {
|
|
772
|
-
return
|
|
798
|
+
return html5`<iframe
|
|
773
799
|
width=${this.getAttribute("width")}
|
|
774
800
|
height=${this.getAttribute("height")}
|
|
775
801
|
frameborder="0"
|
|
@@ -777,7 +803,7 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
777
803
|
id="pciContainer"
|
|
778
804
|
>
|
|
779
805
|
</iframe>
|
|
780
|
-
${this._errorMessage &&
|
|
806
|
+
${this._errorMessage && html5`<div style="color:red">
|
|
781
807
|
<h1>Error</h1>
|
|
782
808
|
${this._errorMessage}
|
|
783
809
|
</div>`}`;
|
|
@@ -829,32 +855,36 @@ var QtiCustomInteraction = class extends Interaction {
|
|
|
829
855
|
}
|
|
830
856
|
};
|
|
831
857
|
__decorate5([
|
|
832
|
-
|
|
858
|
+
property5({ type: String, attribute: "data" })
|
|
833
859
|
], QtiCustomInteraction.prototype, "data", void 0);
|
|
834
860
|
__decorate5([
|
|
835
|
-
|
|
861
|
+
property5({ type: String, attribute: "data-base-item" })
|
|
836
862
|
], QtiCustomInteraction.prototype, "baseItemUrl", void 0);
|
|
837
863
|
__decorate5([
|
|
838
|
-
|
|
864
|
+
property5({ type: String, attribute: "data-base-ref" })
|
|
839
865
|
], QtiCustomInteraction.prototype, "baseRefUrl", void 0);
|
|
840
866
|
__decorate5([
|
|
841
|
-
|
|
867
|
+
property5({ type: String, attribute: "id" })
|
|
842
868
|
], QtiCustomInteraction.prototype, "id", void 0);
|
|
843
869
|
__decorate5([
|
|
844
|
-
|
|
870
|
+
state3()
|
|
845
871
|
], QtiCustomInteraction.prototype, "_errorMessage", void 0);
|
|
846
872
|
|
|
873
|
+
// ../interactions/end-attempt-interaction/dist/qti-end-attempt-interaction.js
|
|
874
|
+
import { html as html6, LitElement as LitElement6 } from "lit";
|
|
875
|
+
import { property as property6 } from "lit/decorators.js";
|
|
876
|
+
|
|
847
877
|
// ../interactions/end-attempt-interaction/dist/qti-end-attempt-interaction.styles.js
|
|
848
878
|
var qti_end_attempt_interaction_styles_default = [boxSizing];
|
|
849
879
|
|
|
850
880
|
// ../interactions/end-attempt-interaction/dist/qti-end-attempt-interaction.js
|
|
851
881
|
var __decorate6 = function(decorators, target, key, desc) {
|
|
852
|
-
var
|
|
853
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
854
|
-
else for (var
|
|
855
|
-
return
|
|
882
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
883
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
884
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
885
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
856
886
|
};
|
|
857
|
-
var QtiEndAttemptInteraction = class extends
|
|
887
|
+
var QtiEndAttemptInteraction = class extends LitElement6 {
|
|
858
888
|
constructor() {
|
|
859
889
|
super(...arguments);
|
|
860
890
|
this.disabled = false;
|
|
@@ -865,7 +895,7 @@ var QtiEndAttemptInteraction = class extends i2 {
|
|
|
865
895
|
this.styles = qti_end_attempt_interaction_styles_default;
|
|
866
896
|
}
|
|
867
897
|
render() {
|
|
868
|
-
return
|
|
898
|
+
return html6`<button ?disabled=${this.disabled} part="button" @click=${this.endAttempt}>${this.title}</button>`;
|
|
869
899
|
}
|
|
870
900
|
endAttempt(_) {
|
|
871
901
|
this.dispatchEvent(new CustomEvent("end-attempt", {
|
|
@@ -876,22 +906,26 @@ var QtiEndAttemptInteraction = class extends i2 {
|
|
|
876
906
|
}
|
|
877
907
|
};
|
|
878
908
|
__decorate6([
|
|
879
|
-
|
|
909
|
+
property6({ type: String, attribute: "response-identifier" })
|
|
880
910
|
], QtiEndAttemptInteraction.prototype, "responseIdentifier", void 0);
|
|
881
911
|
__decorate6([
|
|
882
|
-
|
|
912
|
+
property6({ reflect: true, type: Boolean })
|
|
883
913
|
], QtiEndAttemptInteraction.prototype, "disabled", void 0);
|
|
884
914
|
__decorate6([
|
|
885
|
-
|
|
915
|
+
property6({ type: String, attribute: "count-attempt" })
|
|
886
916
|
], QtiEndAttemptInteraction.prototype, "countAttempt", void 0);
|
|
887
917
|
__decorate6([
|
|
888
|
-
|
|
918
|
+
property6({ type: String })
|
|
889
919
|
], QtiEndAttemptInteraction.prototype, "title", void 0);
|
|
890
920
|
|
|
921
|
+
// ../interactions/media-interaction/dist/qti-media-interaction.js
|
|
922
|
+
import { html as html7 } from "lit";
|
|
923
|
+
|
|
891
924
|
// ../interactions/media-interaction/dist/qti-media-interaction.styles.js
|
|
925
|
+
import { css as css7 } from "lit";
|
|
892
926
|
var qti_media_interaction_styles_default = [
|
|
893
927
|
boxSizing,
|
|
894
|
-
|
|
928
|
+
css7`
|
|
895
929
|
/* The box this element already had. See the note in qti-match-interaction.styles.ts. */
|
|
896
930
|
:host {
|
|
897
931
|
display: block;
|
|
@@ -937,7 +971,7 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
937
971
|
};
|
|
938
972
|
}
|
|
939
973
|
render() {
|
|
940
|
-
return
|
|
974
|
+
return html7` <slot name="prompt"></slot>
|
|
941
975
|
<slot></slot>`;
|
|
942
976
|
}
|
|
943
977
|
constructor() {
|
|
@@ -955,10 +989,14 @@ var QtiMediaInteraction = class extends Interaction {
|
|
|
955
989
|
}
|
|
956
990
|
};
|
|
957
991
|
|
|
992
|
+
// ../interactions/position-object-interaction/dist/qti-position-object-interaction.js
|
|
993
|
+
import { LitElement as LitElement7, html as html8 } from "lit";
|
|
994
|
+
|
|
958
995
|
// ../interactions/position-object-interaction/dist/qti-position-object-interaction.styles.js
|
|
996
|
+
import { css as css8 } from "lit";
|
|
959
997
|
var qti_position_object_interaction_styles_default = [
|
|
960
998
|
boxSizing,
|
|
961
|
-
|
|
999
|
+
css8`
|
|
962
1000
|
:host {
|
|
963
1001
|
display: block;
|
|
964
1002
|
}
|
|
@@ -973,19 +1011,23 @@ var qti_position_object_interaction_styles_default = [
|
|
|
973
1011
|
];
|
|
974
1012
|
|
|
975
1013
|
// ../interactions/position-object-interaction/dist/qti-position-object-interaction.js
|
|
976
|
-
var QtiPositionObjectInteraction = class extends
|
|
1014
|
+
var QtiPositionObjectInteraction = class extends LitElement7 {
|
|
977
1015
|
static {
|
|
978
1016
|
this.styles = qti_position_object_interaction_styles_default;
|
|
979
1017
|
}
|
|
980
1018
|
render() {
|
|
981
|
-
return
|
|
1019
|
+
return html8`<slot></slot>`;
|
|
982
1020
|
}
|
|
983
1021
|
};
|
|
984
1022
|
|
|
1023
|
+
// ../interactions/position-object-interaction/dist/qti-position-object-stage.js
|
|
1024
|
+
import { LitElement as LitElement8, html as html9 } from "lit";
|
|
1025
|
+
|
|
985
1026
|
// ../interactions/position-object-interaction/dist/qti-position-object-stage.styles.js
|
|
1027
|
+
import { css as css9 } from "lit";
|
|
986
1028
|
var qti_position_object_stage_styles_default = [
|
|
987
1029
|
boxSizing,
|
|
988
|
-
|
|
1030
|
+
css9`
|
|
989
1031
|
:host {
|
|
990
1032
|
display: inline-block;
|
|
991
1033
|
position: relative;
|
|
@@ -994,12 +1036,12 @@ var qti_position_object_stage_styles_default = [
|
|
|
994
1036
|
];
|
|
995
1037
|
|
|
996
1038
|
// ../interactions/position-object-interaction/dist/qti-position-object-stage.js
|
|
997
|
-
var QtiPositionObjectStage = class extends
|
|
1039
|
+
var QtiPositionObjectStage = class extends LitElement8 {
|
|
998
1040
|
static {
|
|
999
1041
|
this.styles = qti_position_object_stage_styles_default;
|
|
1000
1042
|
}
|
|
1001
1043
|
render() {
|
|
1002
|
-
return
|
|
1044
|
+
return html9`<slot></slot>`;
|
|
1003
1045
|
}
|
|
1004
1046
|
constructor() {
|
|
1005
1047
|
super();
|
|
@@ -1038,10 +1080,14 @@ var QtiPositionObjectStage = class extends i2 {
|
|
|
1038
1080
|
}
|
|
1039
1081
|
};
|
|
1040
1082
|
|
|
1083
|
+
// ../interactions/upload-interaction/dist/qti-upload-interaction.js
|
|
1084
|
+
import { html as html10 } from "lit";
|
|
1085
|
+
|
|
1041
1086
|
// ../interactions/upload-interaction/dist/qti-upload-interaction.styles.js
|
|
1087
|
+
import { css as css10 } from "lit";
|
|
1042
1088
|
var qti_upload_interaction_styles_default = [
|
|
1043
1089
|
boxSizing,
|
|
1044
|
-
|
|
1090
|
+
css10`
|
|
1045
1091
|
:host {
|
|
1046
1092
|
display: block;
|
|
1047
1093
|
margin: 1em 0;
|
|
@@ -1087,7 +1133,7 @@ var QtiUploadInteraction = class extends Interaction {
|
|
|
1087
1133
|
};
|
|
1088
1134
|
}
|
|
1089
1135
|
render() {
|
|
1090
|
-
return
|
|
1136
|
+
return html10`
|
|
1091
1137
|
<div>
|
|
1092
1138
|
<slot name="prompt"></slot>
|
|
1093
1139
|
<input type="file" @change="${this.#onFileChange}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" />
|
|
@@ -1371,4 +1417,4 @@ export {
|
|
|
1371
1417
|
QtiUploadInteraction,
|
|
1372
1418
|
qtiInteractionElements
|
|
1373
1419
|
};
|
|
1374
|
-
//# sourceMappingURL=chunk-
|
|
1420
|
+
//# sourceMappingURL=chunk-IXPDMYKH.js.map
|