@pie-element/ebsr 14.2.1-next.2 → 14.2.2-next.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/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/browser/_Uint8Array-fRN8Lsus.js +193 -0
- package/dist/browser/_Uint8Array-fRN8Lsus.js.map +1 -0
- package/dist/browser/author/index.js +14046 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/browser-CdX8WGiZ.js +207 -0
- package/dist/browser/browser-CdX8WGiZ.js.map +1 -0
- package/dist/browser/cloneDeep-o_mWij0W.js +251 -0
- package/dist/browser/cloneDeep-o_mWij0W.js.map +1 -0
- package/dist/browser/controller/index.js +435 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/delivery/index.js +133 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-D9ARZhQk.js +1426 -0
- package/dist/browser/dist-D9ARZhQk.js.map +1 -0
- package/dist/browser/dist-DQkngCcw.js +36 -0
- package/dist/browser/dist-DQkngCcw.js.map +1 -0
- package/dist/browser/get-BfBCyZ1r.js +333 -0
- package/dist/browser/get-BfBCyZ1r.js.map +1 -0
- package/dist/browser/print/index.js +108 -0
- package/dist/browser/print/index.js.map +1 -0
- package/package.json +33 -7
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { t as e } from "../dist-D9ARZhQk.js";
|
|
2
|
+
import { f as t, h as n, i as r, p as i, s as a, t as o } from "../get-BfBCyZ1r.js";
|
|
3
|
+
import { _ as s, g as c, n as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "../_Uint8Array-fRN8Lsus.js";
|
|
4
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js
|
|
5
|
+
var _ = "__lodash_hash_undefined__";
|
|
6
|
+
function v(e) {
|
|
7
|
+
return this.__data__.set(e, _), this;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js
|
|
11
|
+
function y(e) {
|
|
12
|
+
return this.__data__.has(e);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js
|
|
16
|
+
function b(e) {
|
|
17
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
18
|
+
for (this.__data__ = new r(); ++t < n;) this.add(e[t]);
|
|
19
|
+
}
|
|
20
|
+
b.prototype.add = b.prototype.push = v, b.prototype.has = y;
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js
|
|
23
|
+
function x(e, t) {
|
|
24
|
+
for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
|
|
25
|
+
return !1;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js
|
|
29
|
+
function ee(e, t) {
|
|
30
|
+
return e.has(t);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js
|
|
34
|
+
var te = 1, S = 2;
|
|
35
|
+
function C(e, t, n, r, i, a) {
|
|
36
|
+
var o = n & te, s = e.length, c = t.length;
|
|
37
|
+
if (s != c && !(o && c > s)) return !1;
|
|
38
|
+
var l = a.get(e), u = a.get(t);
|
|
39
|
+
if (l && u) return l == t && u == e;
|
|
40
|
+
var d = -1, f = !0, p = n & S ? new b() : void 0;
|
|
41
|
+
for (a.set(e, t), a.set(t, e); ++d < s;) {
|
|
42
|
+
var m = e[d], h = t[d];
|
|
43
|
+
if (r) var g = o ? r(h, m, d, t, e, a) : r(m, h, d, e, t, a);
|
|
44
|
+
if (g !== void 0) {
|
|
45
|
+
if (g) continue;
|
|
46
|
+
f = !1;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
if (p) {
|
|
50
|
+
if (!x(t, function(e, t) {
|
|
51
|
+
if (!ee(p, t) && (m === e || i(m, e, n, r, a))) return p.push(t);
|
|
52
|
+
})) {
|
|
53
|
+
f = !1;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
} else if (!(m === h || i(m, h, n, r, a))) {
|
|
57
|
+
f = !1;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return a.delete(e), a.delete(t), f;
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js
|
|
65
|
+
function ne(e) {
|
|
66
|
+
var t = -1, n = Array(e.size);
|
|
67
|
+
return e.forEach(function(e, r) {
|
|
68
|
+
n[++t] = [r, e];
|
|
69
|
+
}), n;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js
|
|
73
|
+
function re(e) {
|
|
74
|
+
var t = -1, n = Array(e.size);
|
|
75
|
+
return e.forEach(function(e) {
|
|
76
|
+
n[++t] = e;
|
|
77
|
+
}), n;
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js
|
|
81
|
+
var ie = 1, ae = 2, oe = "[object Boolean]", se = "[object Date]", ce = "[object Error]", le = "[object Map]", w = "[object Number]", T = "[object RegExp]", ue = "[object Set]", de = "[object String]", fe = "[object Symbol]", pe = "[object ArrayBuffer]", me = "[object DataView]", E = n ? n.prototype : void 0, D = E ? E.valueOf : void 0;
|
|
82
|
+
function he(e, t, n, r, i, o, s) {
|
|
83
|
+
switch (n) {
|
|
84
|
+
case me:
|
|
85
|
+
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
|
|
86
|
+
e = e.buffer, t = t.buffer;
|
|
87
|
+
case pe: return !(e.byteLength != t.byteLength || !o(new p(e), new p(t)));
|
|
88
|
+
case oe:
|
|
89
|
+
case se:
|
|
90
|
+
case w: return a(+e, +t);
|
|
91
|
+
case ce: return e.name == t.name && e.message == t.message;
|
|
92
|
+
case T:
|
|
93
|
+
case de: return e == t + "";
|
|
94
|
+
case le: var c = ne;
|
|
95
|
+
case ue:
|
|
96
|
+
var l = r & ie;
|
|
97
|
+
if (c ||= re, e.size != t.size && !l) return !1;
|
|
98
|
+
var u = s.get(e);
|
|
99
|
+
if (u) return u == t;
|
|
100
|
+
r |= ae, s.set(e, t);
|
|
101
|
+
var d = C(c(e), c(t), r, i, o, s);
|
|
102
|
+
return s.delete(e), d;
|
|
103
|
+
case fe: if (D) return D.call(e) == D.call(t);
|
|
104
|
+
}
|
|
105
|
+
return !1;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js
|
|
109
|
+
var ge = 1, _e = Object.prototype.hasOwnProperty;
|
|
110
|
+
function ve(e, t, n, r, i, a) {
|
|
111
|
+
var o = n & ge, s = d(e), c = s.length;
|
|
112
|
+
if (c != d(t).length && !o) return !1;
|
|
113
|
+
for (var l = c; l--;) {
|
|
114
|
+
var u = s[l];
|
|
115
|
+
if (!(o ? u in t : _e.call(t, u))) return !1;
|
|
116
|
+
}
|
|
117
|
+
var f = a.get(e), p = a.get(t);
|
|
118
|
+
if (f && p) return f == t && p == e;
|
|
119
|
+
var m = !0;
|
|
120
|
+
a.set(e, t), a.set(t, e);
|
|
121
|
+
for (var h = o; ++l < c;) {
|
|
122
|
+
u = s[l];
|
|
123
|
+
var g = e[u], _ = t[u];
|
|
124
|
+
if (r) var v = o ? r(_, g, u, t, e, a) : r(g, _, u, e, t, a);
|
|
125
|
+
if (!(v === void 0 ? g === _ || i(g, _, n, r, a) : v)) {
|
|
126
|
+
m = !1;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
h ||= u == "constructor";
|
|
130
|
+
}
|
|
131
|
+
if (m && !h) {
|
|
132
|
+
var y = e.constructor, b = t.constructor;
|
|
133
|
+
y != b && "constructor" in e && "constructor" in t && !(typeof y == "function" && y instanceof y && typeof b == "function" && b instanceof b) && (m = !1);
|
|
134
|
+
}
|
|
135
|
+
return a.delete(e), a.delete(t), m;
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js
|
|
139
|
+
var ye = 1, O = "[object Arguments]", k = "[object Array]", A = "[object Object]", j = Object.prototype.hasOwnProperty;
|
|
140
|
+
function M(e, n, r, i, a, o) {
|
|
141
|
+
var s = t(e), d = t(n), p = s ? k : l(e), m = d ? k : l(n);
|
|
142
|
+
p = p == O ? A : p, m = m == O ? A : m;
|
|
143
|
+
var h = p == A, g = m == A, _ = p == m;
|
|
144
|
+
if (_ && c(e)) {
|
|
145
|
+
if (!c(n)) return !1;
|
|
146
|
+
s = !0, h = !1;
|
|
147
|
+
}
|
|
148
|
+
if (_ && !h) return o ||= new f(), s || u(e) ? C(e, n, r, i, a, o) : he(e, n, p, r, i, a, o);
|
|
149
|
+
if (!(r & ye)) {
|
|
150
|
+
var v = h && j.call(e, "__wrapped__"), y = g && j.call(n, "__wrapped__");
|
|
151
|
+
if (v || y) {
|
|
152
|
+
var b = v ? e.value() : e, x = y ? n.value() : n;
|
|
153
|
+
return o ||= new f(), a(b, x, r, i, o);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return _ ? (o ||= new f(), ve(e, n, r, i, a, o)) : !1;
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js
|
|
160
|
+
function N(e, t, n, r, a) {
|
|
161
|
+
return e === t ? !0 : e == null || t == null || !i(e) && !i(t) ? e !== e && t !== t : M(e, t, n, r, N, a);
|
|
162
|
+
}
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js
|
|
165
|
+
var P = "[object Map]", be = "[object Set]", xe = Object.prototype.hasOwnProperty;
|
|
166
|
+
function F(e) {
|
|
167
|
+
if (e == null) return !0;
|
|
168
|
+
if (g(e) && (t(e) || typeof e == "string" || typeof e.splice == "function" || c(e) || u(e) || s(e))) return !e.length;
|
|
169
|
+
var n = l(e);
|
|
170
|
+
if (n == P || n == be) return !e.size;
|
|
171
|
+
if (h(e)) return !m(e).length;
|
|
172
|
+
for (var r in e) if (xe.call(e, r)) return !1;
|
|
173
|
+
return !0;
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js
|
|
177
|
+
function Se(e, t) {
|
|
178
|
+
return N(e, t);
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/controller/defaults.ts
|
|
182
|
+
var I = (e) => ({
|
|
183
|
+
choiceMode: "radio",
|
|
184
|
+
choicePrefix: "letters",
|
|
185
|
+
choices: [],
|
|
186
|
+
choicesLayout: "vertical",
|
|
187
|
+
feedbackEnabled: !1,
|
|
188
|
+
gridColumns: 2,
|
|
189
|
+
prompt: "",
|
|
190
|
+
promptEnabled: !0,
|
|
191
|
+
rationale: "",
|
|
192
|
+
rationaleEnabled: !0,
|
|
193
|
+
spellCheckEnabled: !0,
|
|
194
|
+
studentInstructionsEnabled: !0,
|
|
195
|
+
teacherInstructions: "",
|
|
196
|
+
teacherInstructionsEnabled: !0,
|
|
197
|
+
toolbarEditorPosition: "bottom",
|
|
198
|
+
...e
|
|
199
|
+
}), L = {
|
|
200
|
+
partLabels: !0,
|
|
201
|
+
partLabelType: "Letters",
|
|
202
|
+
partA: I(),
|
|
203
|
+
partB: I()
|
|
204
|
+
}, R = Object.defineProperty, Ce = (e, t) => {
|
|
205
|
+
let n = {};
|
|
206
|
+
for (var r in e) R(n, r, {
|
|
207
|
+
get: e[r],
|
|
208
|
+
enumerable: !0
|
|
209
|
+
});
|
|
210
|
+
return t || R(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
211
|
+
};
|
|
212
|
+
function z(e) {
|
|
213
|
+
return Array.isArray(e) ? e.filter((e) => e != null) : [];
|
|
214
|
+
}
|
|
215
|
+
function we(e) {
|
|
216
|
+
let t = [...e];
|
|
217
|
+
for (let e = t.length - 1; e > 0; e--) {
|
|
218
|
+
let n = Math.floor(Math.random() * (e + 1));
|
|
219
|
+
[t[e], t[n]] = [t[n], t[e]];
|
|
220
|
+
}
|
|
221
|
+
return t;
|
|
222
|
+
}
|
|
223
|
+
function B(e) {
|
|
224
|
+
return e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1;
|
|
225
|
+
}
|
|
226
|
+
async function V(e, t, n, r = "value") {
|
|
227
|
+
let i = z(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);
|
|
228
|
+
if (!t) {
|
|
229
|
+
console.warn("Unable to save shuffled choices because there's no session.");
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (!B(i)) return z(i.map((t) => e.find((e) => e[r] === t)));
|
|
233
|
+
let a = we(e);
|
|
234
|
+
if (n && typeof n == "function") try {
|
|
235
|
+
let e = z(a.map((e) => e[r]));
|
|
236
|
+
B(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(a)}, key: ${r}`) : t.id && t.element && await n(t.id, t.element, { shuffledValues: e });
|
|
237
|
+
} catch (e) {
|
|
238
|
+
console.warn("Unable to save shuffled order for choices"), console.error(e);
|
|
239
|
+
}
|
|
240
|
+
else console.warn("Unable to save shuffled choices, shuffle will happen every time.");
|
|
241
|
+
return a;
|
|
242
|
+
}
|
|
243
|
+
function H(e, t, n) {
|
|
244
|
+
return !!(e.lockChoiceOrder || n["@pie-element"]?.lockChoiceOrder || (n.role ?? "student") === "instructor");
|
|
245
|
+
}
|
|
246
|
+
var U = /* @__PURE__ */ Ce({ enabled: () => Te });
|
|
247
|
+
function Te(e, t, n) {
|
|
248
|
+
return e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == "boolean" ? n : !0;
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/controller/utils.ts
|
|
252
|
+
var Ee = (e) => e && e.filter((e) => e.correct).map((e) => e.value).sort(), De = (e, t, n) => {
|
|
253
|
+
let r = Ee(e.choices);
|
|
254
|
+
return n && n.value ? Se((n.value[t].value || []).sort(), r) : !1;
|
|
255
|
+
}, { translator: W } = e, Oe = (e, t, n) => (r) => {
|
|
256
|
+
let i = {
|
|
257
|
+
label: r.label,
|
|
258
|
+
value: r.value
|
|
259
|
+
};
|
|
260
|
+
if (t.role === "instructor" && (t.mode === "view" || t.mode === "evaluate") ? i.rationale = e.rationaleEnabled ? r.rationale : null : i.rationale = null, t.mode === "evaluate" && (i.correct = !!r.correct, e.feedbackEnabled)) {
|
|
261
|
+
let e = r.feedback && r.feedback.type || "none";
|
|
262
|
+
e === "default" ? i.feedback = n[r.correct ? "correct" : "incorrect"] : e === "custom" && (i.feedback = r.feedback.value);
|
|
263
|
+
}
|
|
264
|
+
return i;
|
|
265
|
+
}, G = (e, t, n, r) => {
|
|
266
|
+
let i = Object.assign({
|
|
267
|
+
correct: "Correct",
|
|
268
|
+
incorrect: "Incorrect"
|
|
269
|
+
}, e.defaultFeedback), a = e.choices ? e.choices.map(Oe(e, r, i)) : [];
|
|
270
|
+
return {
|
|
271
|
+
...e,
|
|
272
|
+
choices: a,
|
|
273
|
+
disabled: r.mode !== "gather",
|
|
274
|
+
complete: { min: e.choices.filter((e) => e.correct).length },
|
|
275
|
+
responseCorrect: r.mode === "evaluate" ? De(e, t, n) : void 0
|
|
276
|
+
};
|
|
277
|
+
}, K = (e, t) => ({
|
|
278
|
+
...t,
|
|
279
|
+
...e,
|
|
280
|
+
choicesLayout: e.choicesLayout || e.verticalMode === !1 && "horizontal" || "vertical"
|
|
281
|
+
}), q = ({ partA: e = {}, partB: t = {}, language: n, ...r }) => ({
|
|
282
|
+
...L,
|
|
283
|
+
...r,
|
|
284
|
+
partA: K(e, {
|
|
285
|
+
...L.partA,
|
|
286
|
+
language: n
|
|
287
|
+
}),
|
|
288
|
+
partB: K(t, {
|
|
289
|
+
...L.partB,
|
|
290
|
+
language: n
|
|
291
|
+
})
|
|
292
|
+
});
|
|
293
|
+
async function ke(e, t, n, r) {
|
|
294
|
+
let i = q(e), a = G(i.partA, "partA", t, n), s = G(i.partB, "partB", t, n), c = {}, l = (e) => (t, n, r) => new Promise((t) => {
|
|
295
|
+
c[e] = r.shuffledValues, t();
|
|
296
|
+
}), u = o(t, "value.partA"), d = H(i.partA, u, n), { choices: f } = a || {}, { choices: p } = s || {};
|
|
297
|
+
!d && f && f.length && (a.choices = await V(f, { shuffledValues: (t.shuffledValues || {}).partA }, l("partA"), "value"));
|
|
298
|
+
let m = o(t, "value.partB");
|
|
299
|
+
if (!H(i.partB, m, n) && p && p.length && (s.choices = await V(p, { shuffledValues: (t.shuffledValues || {}).partB }, l("partB"), "value")), F(c) || r && typeof r == "function" && r(t.id, t.element, { shuffledValues: c }).catch((e) => {
|
|
300
|
+
console.error("update session failed", e);
|
|
301
|
+
}), i.partLabels) {
|
|
302
|
+
let e = i.language;
|
|
303
|
+
a.partLabel = W.t("ebsr.part", {
|
|
304
|
+
lng: e,
|
|
305
|
+
index: i.partLabelType === "Letters" ? "A" : "1"
|
|
306
|
+
}), s.partLabel = W.t("ebsr.part", {
|
|
307
|
+
lng: e,
|
|
308
|
+
index: i.partLabelType === "Letters" ? "B" : "2"
|
|
309
|
+
});
|
|
310
|
+
} else a.partLabel = void 0, s.partLabel = void 0;
|
|
311
|
+
return n.role === "instructor" && (n.mode === "view" || n.mode === "evaluate") ? (a.teacherInstructions = i.partA.teacherInstructionsEnabled ? i.partA.teacherInstructions : null, s.teacherInstructions = i.partB.teacherInstructionsEnabled ? i.partB.teacherInstructions : null) : (a.teacherInstructions = null, s.teacherInstructions = null), a.prompt = i.partA.promptEnabled ? i.partA.prompt : null, s.prompt = i.partB.promptEnabled ? i.partB.prompt : null, new Promise((e) => {
|
|
312
|
+
e({
|
|
313
|
+
disabled: n.mode !== "gather",
|
|
314
|
+
mode: n.mode,
|
|
315
|
+
extraCSSRules: i.extraCSSRules,
|
|
316
|
+
partA: a,
|
|
317
|
+
partB: s
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
var Ae = (e = {}) => new Promise((t) => {
|
|
322
|
+
t({
|
|
323
|
+
...L,
|
|
324
|
+
...e
|
|
325
|
+
});
|
|
326
|
+
}), J = (e) => e.correct === !0, Y = (e, t, n, r) => {
|
|
327
|
+
let { choices: i = [] } = e && e[n] || {}, a = i.length, { value: o } = t || {}, s = (e) => !!(o || []).find((t) => t === e.value), c = (e) => J(e) && !s(e), l = (e) => !J(e) && s(e), u = i.reduce((e, t) => c(t) || l(t) ? e - 1 : e, i.length);
|
|
328
|
+
return !r && u < a ? 0 : parseFloat(a ? (u / a).toFixed(2) : 0);
|
|
329
|
+
}, X = (e, t, n) => {
|
|
330
|
+
let r = [];
|
|
331
|
+
if (!t || !t.value) return r.push("Student did not answer the question."), r;
|
|
332
|
+
let { value: i } = t, { partA: a, partB: o } = i, s = U.enabled(e, n);
|
|
333
|
+
r.push(`Scoring method: ${s ? "partial scoring" : "all-or-nothing scoring"}.`);
|
|
334
|
+
let c = e.partA.choiceMode === "radio" ? "multiple-choice (radio)" : "multiple-select (checkbox)";
|
|
335
|
+
r.push(`Part A question type: ${c}.`);
|
|
336
|
+
let l = a?.value || [], u = (e.partA.choices || []).filter((e) => e.correct).map((e) => e.value), d = l.filter((e) => u.includes(e)), f = l.filter((e) => !u.includes(e));
|
|
337
|
+
l.length && r.push(`Part A: student selected ${l.length} choice(s) (${d.length} correct, ${f.length} incorrect).`);
|
|
338
|
+
let p = Y(e, a, "partA", s);
|
|
339
|
+
r.push(`Part A score: ${p}.`);
|
|
340
|
+
let m = e.partB.choiceMode === "radio" ? "multiple-choice (radio)" : "multiple-select (checkbox)";
|
|
341
|
+
r.push(`Part B question type: ${m}.`);
|
|
342
|
+
let h = o?.value || [], g = (e.partB.choices || []).filter((e) => e.correct).map((e) => e.value), _ = h.filter((e) => g.includes(e)), v = h.filter((e) => !g.includes(e));
|
|
343
|
+
h.length && r.push(`Part B: student selected ${h.length} choice(s) (${_.length} correct, ${v.length} incorrect).`);
|
|
344
|
+
let y = Y(e, o, "partB", s);
|
|
345
|
+
if (r.push(`Part B score: ${y}.`), !s) r.push("Final score is awarded only if both Part A and Part B are completely correct."), r.push(`Final score: ${+(p === 1 && y === 1)}.`);
|
|
346
|
+
else {
|
|
347
|
+
r.push("With partial scoring enabled, Part A must be correct to earn any credit.");
|
|
348
|
+
let e = 0;
|
|
349
|
+
p === 1 && y === 1 ? e = 2 : p === 1 && y < 1 && (e = 1), r.push(`Final score: ${e}.`);
|
|
350
|
+
}
|
|
351
|
+
return r;
|
|
352
|
+
};
|
|
353
|
+
function je(e, t, n) {
|
|
354
|
+
return new Promise((r) => {
|
|
355
|
+
let { value: i } = t || {};
|
|
356
|
+
if ((!t || !i) && r({
|
|
357
|
+
score: 0,
|
|
358
|
+
scoreA: 0,
|
|
359
|
+
scoreB: 0,
|
|
360
|
+
empty: !0,
|
|
361
|
+
logTrace: ["Student did not answer the question."]
|
|
362
|
+
}), i) {
|
|
363
|
+
let { partA: a, partB: o } = i || {}, s = U.enabled(e, n), c = Y(e, a, "partA", s), l = Y(e, o, "partB", s), u = X(e, t, n);
|
|
364
|
+
r(s ? c === 1 ? l === 1 ? {
|
|
365
|
+
score: 2,
|
|
366
|
+
scoreA: c,
|
|
367
|
+
scoreB: l,
|
|
368
|
+
max: 2,
|
|
369
|
+
logTrace: u
|
|
370
|
+
} : {
|
|
371
|
+
score: 1,
|
|
372
|
+
scoreA: c,
|
|
373
|
+
scoreB: l,
|
|
374
|
+
max: 2,
|
|
375
|
+
logTrace: u
|
|
376
|
+
} : {
|
|
377
|
+
score: 0,
|
|
378
|
+
scoreA: c,
|
|
379
|
+
scoreB: l,
|
|
380
|
+
max: 2,
|
|
381
|
+
logTrace: u
|
|
382
|
+
} : {
|
|
383
|
+
score: +(c === 1 && l === 1),
|
|
384
|
+
scoreA: c,
|
|
385
|
+
scoreB: l,
|
|
386
|
+
max: 1,
|
|
387
|
+
logTrace: u
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
var Z = (e) => {
|
|
393
|
+
let t = [];
|
|
394
|
+
return e.forEach((e) => {
|
|
395
|
+
let { correct: n, value: r } = e;
|
|
396
|
+
n && t.push(r);
|
|
397
|
+
}), t;
|
|
398
|
+
}, Me = (e, t) => new Promise((n) => {
|
|
399
|
+
if (t.mode !== "evaluate" && t.role === "instructor") {
|
|
400
|
+
let { partA: t, partB: r } = e, i = Z(t.choices), a = Z(r.choices);
|
|
401
|
+
n({
|
|
402
|
+
value: {
|
|
403
|
+
partA: {
|
|
404
|
+
id: "partA",
|
|
405
|
+
value: i
|
|
406
|
+
},
|
|
407
|
+
partB: {
|
|
408
|
+
id: "partB",
|
|
409
|
+
value: a
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
id: "1"
|
|
413
|
+
});
|
|
414
|
+
} else n(null);
|
|
415
|
+
}), Q = (e) => (e || "").replace(/(<(?!img|iframe|source)([^>]+)>)/gi, ""), $ = (e = {}, t = {}) => {
|
|
416
|
+
let { choices: n } = e, { minAnswerChoices: r = 2, maxAnswerChoices: i } = t, a = [...n || []].reverse(), o = {}, s = {}, c = {}, l = !1;
|
|
417
|
+
["teacherInstructions", "prompt"].forEach((n) => {
|
|
418
|
+
t[n]?.required && !Q(e[n]) && (o[n] = "This field is required.");
|
|
419
|
+
}), a.forEach((e, n) => {
|
|
420
|
+
let { correct: r, value: i, label: o, rationale: u } = e;
|
|
421
|
+
r && (l = !0), Q(o) ? a.slice(n + 1).some((e) => e.label === o) && (s[i] = "Content should be unique.") : s[i] = "Content should not be empty.", t.rationale?.required && !Q(u) && (c[i] = "This field is required.");
|
|
422
|
+
});
|
|
423
|
+
let u = (n || []).length;
|
|
424
|
+
return u < r ? o.answerChoices = `There should be at least ${r} choices defined.` : u > i && (o.answerChoices = `No more than ${i} choices should be defined.`), l || (o.correctResponse = "No correct response defined."), F(s) || (o.choices = s), F(c) || (o.rationale = c), o;
|
|
425
|
+
}, Ne = (e = {}, t = {}) => {
|
|
426
|
+
let { partA: n, partB: r } = e || {}, { partA: i, partB: a } = t || {};
|
|
427
|
+
return {
|
|
428
|
+
partA: $(n, i),
|
|
429
|
+
partB: $(r, a)
|
|
430
|
+
};
|
|
431
|
+
};
|
|
432
|
+
//#endregion
|
|
433
|
+
export { Me as createCorrectResponseSession, Ae as createDefaultModel, X as getLogTrace, ke as model, q as normalize, je as outcome, Ne as validate };
|
|
434
|
+
|
|
435
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","COMPARE_PARTIAL_FLAG","mapTag","setTag","Symbol","COMPARE_PARTIAL_FLAG","hasOwnProperty","hasOwnProperty","getTag","getTag"],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js","../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js","../../../src/controller/defaults.ts","../../../../../shared/controller-utils/dist/index.js","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import baseKeys from './_baseKeys.js';\nimport getTag from './_getTag.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLike from './isArrayLike.js';\nimport isBuffer from './isBuffer.js';\nimport isPrototype from './_isPrototype.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nexport default isEmpty;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/ebsr/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nconst partModel = (base) => ({\n choiceMode: 'radio',\n choicePrefix: 'letters',\n choices: [],\n choicesLayout: 'vertical',\n feedbackEnabled: false,\n gridColumns: 2,\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n spellCheckEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n ...base,\n});\n\nexport default {\n partLabels: true,\n partLabelType: 'Letters',\n partA: partModel(),\n partB: partModel(),\n};\n","//#region \\0rolldown/runtime.js\nvar e = Object.defineProperty, t = (t, n) => {\n\tlet r = {};\n\tfor (var i in t) e(r, i, {\n\t\tget: t[i],\n\t\tenumerable: !0\n\t});\n\treturn n || e(r, Symbol.toStringTag, { value: \"Module\" }), r;\n};\n//#endregion\n//#region src/persistence.ts\nfunction n(e) {\n\treturn Array.isArray(e) ? e.filter((e) => e != null) : [];\n}\nfunction r(e) {\n\tlet t = [...e];\n\tfor (let e = t.length - 1; e > 0; e--) {\n\t\tlet n = Math.floor(Math.random() * (e + 1));\n\t\t[t[e], t[n]] = [t[n], t[e]];\n\t}\n\treturn t;\n}\nfunction i(e) {\n\treturn e == null ? !0 : Array.isArray(e) ? e.length === 0 : typeof e == \"object\" ? Object.keys(e).length === 0 : !1;\n}\nasync function a(e, t, a, o = \"value\") {\n\tlet s = n(t?.data?.shuffledValues ?? t?.shuffledValues ?? []);\n\tif (!t) {\n\t\tconsole.warn(\"Unable to save shuffled choices because there's no session.\");\n\t\treturn;\n\t}\n\tif (!i(s)) return n(s.map((t) => e.find((e) => e[o] === t)));\n\tlet c = r(e);\n\tif (a && typeof a == \"function\") try {\n\t\tlet e = n(c.map((e) => e[o]));\n\t\ti(e) ? console.error(`shuffledValues is an empty array - refusing to call updateSession. shuffledChoices: ${JSON.stringify(c)}, key: ${o}`) : t.id && t.element && await a(t.id, t.element, { shuffledValues: e });\n\t} catch (e) {\n\t\tconsole.warn(\"Unable to save shuffled order for choices\"), console.error(e);\n\t}\n\telse console.warn(\"Unable to save shuffled choices, shuffle will happen every time.\");\n\treturn c;\n}\nfunction o(e, t, n) {\n\treturn !!(e.lockChoiceOrder || n[\"@pie-element\"]?.lockChoiceOrder || (n.role ?? \"student\") === \"instructor\");\n}\n//#endregion\n//#region src/partial-scoring.ts\nvar s = /* @__PURE__ */ t({ enabled: () => c });\nfunction c(e, t, n) {\n\treturn e?.partialScoring === !1 || t?.partialScoring === !1 ? !1 : typeof n == \"boolean\" ? n : !0;\n}\n//#endregion\nexport { a as getShuffledChoices, o as lockChoices, s as partialScoring };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/ebsr/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport { isEqual } from 'lodash-es';\n\nexport const getCorrectResponse = (choices) =>\n choices &&\n choices\n .filter((c) => c.correct)\n .map((c) => c.value)\n .sort();\n\nexport const isResponseCorrect = (question, key, session) => {\n let correctResponse = getCorrectResponse(question.choices);\n\n if (session && session.value) {\n return isEqual((session.value[key].value || []).sort(), correctResponse);\n }\n\n return false;\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/ebsr/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport defaults from './defaults.js';\nimport { lockChoices, getShuffledChoices, partialScoring } from '@pie-element/shared-controller-utils';\nimport { isResponseCorrect } from './utils.js';\nimport { get, isEmpty } from 'lodash-es';\nimport Translator from '@pie-lib/translator';\n\nconst { translator } = Translator;\n\nconst prepareChoice = (model, env, defaultFeedback) => (choice) => {\n const out = {\n label: choice.label,\n value: choice.value,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.rationale = model.rationaleEnabled ? choice.rationale : null;\n } else {\n out.rationale = null;\n }\n\n if (env.mode === 'evaluate') {\n out.correct = !!choice.correct;\n\n if (model.feedbackEnabled) {\n const feedbackType = (choice.feedback && choice.feedback.type) || 'none';\n\n if (feedbackType === 'default') {\n out.feedback = defaultFeedback[choice.correct ? 'correct' : 'incorrect'];\n } else if (feedbackType === 'custom') {\n out.feedback = choice.feedback.value;\n }\n }\n }\n\n return out;\n};\n\nconst parsePart = (part, key, session, env) => {\n const defaultFeedback = Object.assign({ correct: 'Correct', incorrect: 'Incorrect' }, part.defaultFeedback);\n\n let choices = part.choices ? part.choices.map(prepareChoice(part, env, defaultFeedback)) : [];\n\n return {\n ...part,\n choices,\n disabled: env.mode !== 'gather',\n complete: {\n min: part.choices.filter((c) => c.correct).length,\n },\n responseCorrect: env.mode === 'evaluate' ? isResponseCorrect(part, key, session) : undefined,\n };\n};\n\nconst normalizePart = (model, base) => ({\n ...base,\n ...model,\n choicesLayout: model.choicesLayout || (model.verticalMode === false && 'horizontal') || 'vertical',\n});\n\nexport const normalize = ({ partA = {}, partB = {}, language, ...question }) => ({\n ...defaults,\n ...question,\n partA: normalizePart(partA, { ...defaults.partA, language }),\n partB: normalizePart(partB, { ...defaults.partB, language }),\n});\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n * @param {*} updateSession - optional - a function that will set the properties passed into it on the session.\n */\nexport async function model(question, session, env, updateSession) {\n const normalizedQuestion = normalize(question);\n const partA = parsePart(normalizedQuestion.partA, 'partA', session, env);\n const partB = parsePart(normalizedQuestion.partB, 'partB', session, env);\n\n const shuffledValues = {};\n\n const us = (part) => (id, element, update) =>\n new Promise((resolve) => {\n shuffledValues[part] = update.shuffledValues;\n resolve();\n });\n\n const partASession = get(session, 'value.partA');\n const partALockChoiceOrder = lockChoices(normalizedQuestion.partA, partASession, env);\n\n const { choices: partAChoices } = partA || {};\n const { choices: partBChoices } = partB || {};\n\n if (!partALockChoiceOrder && partAChoices && partAChoices.length) {\n partA.choices = await getShuffledChoices(\n partAChoices,\n { shuffledValues: (session.shuffledValues || {}).partA },\n us('partA'),\n 'value',\n );\n }\n\n const partBSession = get(session, 'value.partB');\n const partBLockChoiceOrder = lockChoices(normalizedQuestion.partB, partBSession, env);\n\n if (!partBLockChoiceOrder && partBChoices && partBChoices.length) {\n partB.choices = await getShuffledChoices(\n partBChoices,\n { shuffledValues: (session.shuffledValues || {}).partB },\n us('partB'),\n 'value',\n );\n }\n\n if (!isEmpty(shuffledValues)) {\n if (updateSession && typeof updateSession === 'function') {\n updateSession(session.id, session.element, {\n shuffledValues,\n }).catch((e) => {\n // eslint-disable-next-line no-console\n console.error('update session failed', e);\n });\n }\n }\n\n if (normalizedQuestion.partLabels) {\n const language = normalizedQuestion.language;\n partA.partLabel = translator.t('ebsr.part', {\n lng: language,\n index: normalizedQuestion.partLabelType === 'Letters' ? 'A' : '1',\n });\n partB.partLabel = translator.t('ebsr.part', {\n lng: language,\n index: normalizedQuestion.partLabelType === 'Letters' ? 'B' : '2',\n });\n } else {\n partA.partLabel = undefined;\n partB.partLabel = undefined;\n }\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n partA.teacherInstructions = normalizedQuestion.partA.teacherInstructionsEnabled\n ? normalizedQuestion.partA.teacherInstructions\n : null;\n partB.teacherInstructions = normalizedQuestion.partB.teacherInstructionsEnabled\n ? normalizedQuestion.partB.teacherInstructions\n : null;\n } else {\n partA.teacherInstructions = null;\n partB.teacherInstructions = null;\n }\n\n partA.prompt = normalizedQuestion.partA.promptEnabled ? normalizedQuestion.partA.prompt : null;\n partB.prompt = normalizedQuestion.partB.promptEnabled ? normalizedQuestion.partB.prompt : null;\n\n return new Promise((resolve) => {\n resolve({\n disabled: env.mode !== 'gather',\n mode: env.mode,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n partA,\n partB,\n });\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nconst isCorrect = (c) => c.correct === true;\n\nconst getScore = (config, sessionPart, key, partialScoringEnabled) => {\n const { choices = [] } = (config && config[key]) || {};\n const maxScore = choices.length;\n const { value: sessionPartValue } = sessionPart || {};\n\n const chosen = (c) => !!(sessionPartValue || []).find((v) => v === c.value);\n const correctAndNotChosen = (c) => isCorrect(c) && !chosen(c);\n const incorrectAndChosen = (c) => !isCorrect(c) && chosen(c);\n const correctChoices = choices.reduce((total, choice) => {\n if (correctAndNotChosen(choice) || incorrectAndChosen(choice)) {\n return total - 1;\n } else {\n return total;\n }\n }, choices.length);\n\n // determine score for a part\n if (!partialScoringEnabled && correctChoices < maxScore) {\n return 0;\n }\n\n return parseFloat(maxScore ? (correctChoices / maxScore).toFixed(2) : 0);\n};\n\n/**\n * Generates detailed trace log for math-templated scoring evaluation\n * @param {Object} question\n * @param {Object} session\n * @param {Object} env\n * @returns {Array<string>} traceLog\n */\nexport const getLogTrace = (question, session, env) => {\n const traceLog = [];\n\n if (!session || !session.value) {\n traceLog.push('Student did not answer the question.');\n return traceLog;\n }\n\n const { value } = session;\n const { partA, partB } = value;\n\n const partialScoringEnabled = partialScoring.enabled(question, env);\n\n traceLog.push(\n `Scoring method: ${partialScoringEnabled ? 'partial scoring' : 'all-or-nothing scoring'}.`\n );\n\n const partAquestionType =\n question.partA.choiceMode === 'radio'\n ? 'multiple-choice (radio)'\n : 'multiple-select (checkbox)';\n traceLog.push(`Part A question type: ${partAquestionType}.`);\n\n const partASelections = partA?.value || [];\n const partACorrectChoices = (question.partA.choices || []).filter((c) => c.correct);\n const partACorrectValues = partACorrectChoices.map((c) => c.value);\n const partACorrectSelected = partASelections.filter((v) => partACorrectValues.includes(v));\n const partAIncorrectSelected = partASelections.filter((v) => !partACorrectValues.includes(v));\n\n if (partASelections.length) {\n traceLog.push(\n `Part A: student selected ${partASelections.length} choice(s) (${partACorrectSelected.length} correct, ${partAIncorrectSelected.length} incorrect).`\n );\n }\n \n const scoreA = getScore(question, partA, 'partA', partialScoringEnabled);\n traceLog.push(`Part A score: ${scoreA}.`);\n\n const partBquestionType =\n question.partB.choiceMode === 'radio'\n ? 'multiple-choice (radio)'\n : 'multiple-select (checkbox)';\n traceLog.push(`Part B question type: ${partBquestionType}.`);\n\n const partBSelections = partB?.value || [];\n const partBCorrectChoices = (question.partB.choices || []).filter((c) => c.correct);\n const partBCorrectValues = partBCorrectChoices.map((c) => c.value);\n const correctSelected = partBSelections.filter((v) => partBCorrectValues.includes(v));\n const incorrectSelected = partBSelections.filter((v) => !partBCorrectValues.includes(v));\n\n if (partBSelections.length) {\n traceLog.push(\n `Part B: student selected ${partBSelections.length} choice(s) (${correctSelected.length} correct, ${incorrectSelected.length} incorrect).`\n );\n }\n\n const scoreB = getScore(question, partB, 'partB', partialScoringEnabled);\n traceLog.push(`Part B score: ${scoreB}.`);\n\n if (!partialScoringEnabled) {\n traceLog.push(\n 'Final score is awarded only if both Part A and Part B are completely correct.'\n );\n traceLog.push(`Final score: ${scoreA === 1 && scoreB === 1 ? 1 : 0}.`);\n } else {\n traceLog.push(\n 'With partial scoring enabled, Part A must be correct to earn any credit.'\n );\n\n let finalScore = 0;\n if (scoreA === 1 && scoreB === 1) {\n finalScore = 2;\n } else if (scoreA === 1 && scoreB < 1) {\n finalScore = 1;\n }\n\n traceLog.push(`Final score: ${finalScore}.`);\n }\n\n return traceLog;\n};\n\nexport function outcome(config, session, env) {\n return new Promise((resolve) => {\n const { value } = session || {};\n\n if (!session || !value) {\n resolve({ score: 0, scoreA: 0, scoreB: 0, empty: true, logTrace: ['Student did not answer the question.'] });\n }\n\n if (value) {\n const { partA, partB } = value || {};\n\n const partialScoringEnabled = partialScoring.enabled(config, env);\n\n const scoreA = getScore(config, partA, 'partA', partialScoringEnabled);\n const scoreB = getScore(config, partB, 'partB', partialScoringEnabled);\n const logTrace = getLogTrace(config, session, env);\n\n if (!partialScoringEnabled) {\n // The EBSR item is worth 1 point\n // That point is awarded if and only if both parts are fully correct, otherwise no points are awarded\n resolve({ score: scoreA === 1 && scoreB === 1 ? 1 : 0, scoreA, scoreB, max: 1, logTrace });\n } else {\n // The EBSR item is worth 2 points\n if (scoreA === 1) {\n if (scoreB === 1) {\n // If Part A and Part B are both correct, 2 points are awarded\n resolve({ score: 2, scoreA, scoreB, max: 2, logTrace });\n } else {\n // If Part A is correct and part B is incorrect, 1 point is awarded\n resolve({ score: 1, scoreA, scoreB, max: 2, logTrace });\n }\n } else {\n // For all other combinations, no points are awarded\n resolve({ score: 0, scoreA, scoreB, max: 2, logTrace });\n }\n }\n }\n });\n}\n\nconst returnPartCorrect = (choices) => {\n let answers = [];\n\n choices.forEach((i) => {\n const { correct, value } = i;\n if (correct) {\n answers.push(value);\n }\n });\n return answers;\n};\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n const { partA, partB } = question;\n\n const partACorrect = returnPartCorrect(partA.choices);\n const partBCorrect = returnPartCorrect(partB.choices);\n\n resolve({\n value: {\n partA: {\n id: 'partA',\n value: partACorrect,\n },\n partB: {\n id: 'partB',\n value: partBCorrect,\n },\n },\n id: '1',\n });\n } else {\n resolve(null);\n }\n });\n};\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nconst validatePart = (model = {}, config = {}) => {\n const { choices } = model;\n const { minAnswerChoices = 2, maxAnswerChoices } = config;\n const reversedChoices = [...(choices || [])].reverse();\n const errors = {};\n const choicesErrors = {};\n const rationaleErrors = {};\n let hasCorrectResponse = false;\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n reversedChoices.forEach((choice, index) => {\n const { correct, value, label, rationale } = choice;\n\n if (correct) {\n hasCorrectResponse = true;\n }\n\n if (!getContent(label)) {\n choicesErrors[value] = 'Content should not be empty.';\n } else {\n const identicalAnswer = reversedChoices.slice(index + 1).some((c) => c.label === label);\n\n if (identicalAnswer) {\n choicesErrors[value] = 'Content should be unique.';\n }\n }\n\n if (config.rationale?.required && !getContent(rationale)) {\n rationaleErrors[value] = 'This field is required.';\n }\n });\n\n const nbOfChoices = (choices || []).length;\n\n if (nbOfChoices < minAnswerChoices) {\n errors.answerChoices = `There should be at least ${minAnswerChoices} choices defined.`;\n } else if (nbOfChoices > maxAnswerChoices) {\n errors.answerChoices = `No more than ${maxAnswerChoices} choices should be defined.`;\n }\n\n if (!hasCorrectResponse) {\n errors.correctResponse = 'No correct response defined.';\n }\n\n if (!isEmpty(choicesErrors)) {\n errors.choices = choicesErrors;\n }\n\n if (!isEmpty(rationaleErrors)) {\n errors.rationale = rationaleErrors;\n }\n\n return errors;\n};\n\nexport const validate = (model = {}, config = {}) => {\n const { partA, partB } = model || {};\n const { partA: partAConfig, partB: partBConfig } = config || {};\n\n const partAErrors = validatePart(partA, partAConfig);\n const partBErrors = validatePart(partB, partBConfig);\n\n return { partA: partAErrors, partB: partBErrors };\n};\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13],"mappings":";;;;AACA,IAAI,IAAiB;AAYrB,SAAS,EAAY,GAAO;CAE1B,OADA,KAAK,SAAS,IAAI,GAAO,CAAc,GAChC;AACT;;;ACPA,SAAS,EAAY,GAAO;CAC1B,OAAO,KAAK,SAAS,IAAI,CAAK;AAChC;;;ACCA,SAAS,EAAS,GAAQ;CACxB,IAAI,IAAQ,IACR,IAAS,KAAU,OAAO,IAAI,EAAO;CAGzC,KADA,KAAK,WAAW,IAAI,EAAO,GACpB,EAAE,IAAQ,IACf,KAAK,IAAI,EAAO,EAAM;AAE1B;AAGA,EAAS,UAAU,MAAM,EAAS,UAAU,OAAO,GACnD,EAAS,UAAU,MAAM;;;ACdzB,SAAS,EAAU,GAAO,GAAW;CAInC,KAHA,IAAI,IAAQ,IACR,IAAS,KAAS,OAAO,IAAI,EAAM,QAEhC,EAAE,IAAQ,IACf,IAAI,EAAU,EAAM,IAAQ,GAAO,CAAK,GACtC,OAAO;CAGX,OAAO;AACT;;;ACZA,SAAS,GAAS,GAAO,GAAK;CAC5B,OAAO,EAAM,IAAI,CAAG;AACtB;;;ACLA,IAAIA,KAAuB,GACvBC,IAAyB;AAe7B,SAAS,EAAY,GAAO,GAAO,GAAS,GAAY,GAAW,GAAO;CACxE,IAAI,IAAY,IAAUD,IACtB,IAAY,EAAM,QAClB,IAAY,EAAM;CAEtB,IAAI,KAAa,KAAa,EAAE,KAAa,IAAY,IACvD,OAAO;CAGT,IAAI,IAAa,EAAM,IAAI,CAAK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