hyperbook 0.113.1 → 0.113.3
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/asset-manifest.json +9 -9
- package/dist/assets/directive-bitflow/{EditorElement-zyz99U6n.js → EditorElement-BNwEKIvk.js} +258 -258
- package/dist/assets/directive-bitflow/{ReportElements-BnX14NtV.js → ReportElements-CAvHx5xm.js} +2 -2
- package/dist/assets/directive-bitflow/{bitLoaders-DIGwTcpd.js → bitLoaders-7qanePQL.js} +1138 -1073
- package/dist/assets/directive-bitflow/{dom-uYx_3K1r.js → dom-B6NPWBb1.js} +1558 -1551
- package/dist/assets/directive-bitflow/editor.js +3 -3
- package/dist/assets/directive-bitflow/flow.js +4 -4
- package/dist/assets/directive-bitflow/{index-BseSaQlX.js → index-4JaKZ7WT.js} +2 -2
- package/dist/assets/directive-bitflow/{index-e_8twLaN.js → index-6CQr_atd.js} +120 -120
- package/dist/assets/directive-bitflow/{index-COndsSPW.js → index-B9iG-a48.js} +9 -9
- package/dist/assets/directive-bitflow/{index-C5czXkRd.js → index-BFYoOtcY.js} +36 -36
- package/dist/assets/directive-bitflow/{index-YPMWh-1B.js → index-BI6aFdIS.js} +21 -21
- package/dist/assets/directive-bitflow/{index-D7m-hJZ9.js → index-Bf078mfo.js} +69 -69
- package/dist/assets/directive-bitflow/{index-Bf_FQRbK.js → index-BinE5Wvd.js} +19 -19
- package/dist/assets/directive-bitflow/{index-CFcRAa3F.js → index-BoX5-jkC.js} +31 -31
- package/dist/assets/directive-bitflow/{index-NyNuXp4C.js → index-BqRsXShM.js} +34 -34
- package/dist/assets/directive-bitflow/{index-Fr7yl4Vn.js → index-BxihQ8Oo.js} +21 -21
- package/dist/assets/directive-bitflow/{index-B3jMTk1o.js → index-C5YguHZU.js} +101 -101
- package/dist/assets/directive-bitflow/{index-XxGfBwJe.js → index-C8zwSmE6.js} +27 -27
- package/dist/assets/directive-bitflow/{index-BLcJNyog.js → index-C9JSBTNc.js} +91 -91
- package/dist/assets/directive-bitflow/{index-CjscG0z6.js → index-CCMI6UK4.js} +75 -75
- package/dist/assets/directive-bitflow/{index-CK1UMcfT.js → index-CGDt8H6s.js} +24 -24
- package/dist/assets/directive-bitflow/{index-xapm2BQE.js → index-Ca1v0pjV.js} +102 -92
- package/dist/assets/directive-bitflow/{index-IQHOi2fr.js → index-CaYn3Gmh.js} +31 -31
- package/dist/assets/directive-bitflow/{index-BpG316Ls.js → index-CbQue0If.js} +67 -67
- package/dist/assets/directive-bitflow/{index-CzdZQibq.js → index-CjH3h0OO.js} +79 -79
- package/dist/assets/directive-bitflow/{index-B7Z6Q-PQ.js → index-CkO3QfOS.js} +8 -8
- package/dist/assets/directive-bitflow/{index-BIJ7VfD2.js → index-Cz4i5rfe.js} +39 -39
- package/dist/assets/directive-bitflow/{index-8jTO-NJA.js → index-D0NtgeiX.js} +85 -85
- package/dist/assets/directive-bitflow/{index-DtsDy2By.js → index-D1C_1SPY.js} +14 -14
- package/dist/assets/directive-bitflow/{index-BdBBCZSy.js → index-D45u7EVR.js} +227 -194
- package/dist/assets/directive-bitflow/{index-cnRM_JDB.js → index-D9Ox4YpM.js} +33 -33
- package/dist/assets/directive-bitflow/{index-Bqf-kixT.js → index-DJ1w2Xcm.js} +46 -46
- package/dist/assets/directive-bitflow/{index-BQ5h4nDN.js → index-DUqW2fmV.js} +94 -94
- package/dist/assets/directive-bitflow/{index-ChgzyMHe.js → index-Deedj9EF.js} +25 -25
- package/dist/assets/directive-bitflow/{index-CZyaFdD2.js → index-Dg6nnY_v.js} +68 -68
- package/dist/assets/directive-bitflow/{index-kRpwcprB.js → index-DgxEzomz.js} +2 -2
- package/dist/assets/directive-bitflow/{index-D5yZNeIg.js → index-Dl0-ZAT5.js} +52 -52
- package/dist/assets/directive-bitflow/{index-DnVYIuen.js → index-Do6dmZyj.js} +42 -42
- package/dist/assets/directive-bitflow/{index-DjWNEPDL.js → index-DqnGC-DU.js} +31 -31
- package/dist/assets/directive-bitflow/{index-ivI25bnR.js → index-DwXXeSwk.js} +73 -73
- package/dist/assets/directive-bitflow/{index-Bf_NXJjq.js → index-b6qwcTj9.js} +15 -15
- package/dist/assets/directive-bitflow/{index-Fq7njn6_.js → index-d105UFQI.js} +58 -58
- package/dist/assets/directive-bitflow/{index-CW9iev-_.js → index-jijMWQB6.js} +8 -8
- package/dist/assets/directive-bitflow/{index-C_ZTSeqv.js → index-kxO5_U9Y.js} +24 -24
- package/dist/assets/directive-bitflow/{index-DoKlIgCD.js → index-p5AOgOal.js} +35 -35
- package/dist/assets/directive-bitflow/{index-CvCZVgKv.js → index-q2APknM6.js} +46 -46
- package/dist/assets/directive-bitflow/{index-eN2S_MLj.js → index-zVkWgm5I.js} +70 -70
- package/dist/assets/directive-bitflow/index.js +6 -6
- package/dist/assets/directive-bitflow/katex-DSLAjWZH-CHGN3Pr6.js +11314 -0
- package/dist/assets/directive-bitflow/katex-Dv-tcU2S-Dv-tcU2S.js +4 -0
- package/dist/assets/directive-bitflow/report.js +1 -1
- package/dist/assets/directive-bitflow/{shareableReport-ArQU1XjG.js → shareableReport-mdyEMdsJ.js} +6 -6
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const we = ["rearrange", "write"], fe = ne(we), me =
|
|
1
|
+
import { P as F, a4 as H, ac as se, ad as J, Y as re, a9 as P, a2 as N, j as s, b as I, a5 as ne, a as C, aa as ie, s as le } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { $ as oe, e as de, M as ce, g as z, i as U, P as $, C as Q, F as T, r as pe, B as he, U as ue, H as be } from "./bitLoaders-7qanePQL.js";
|
|
3
|
+
const we = ["rearrange", "write"], fe = ne(we), me = F({
|
|
4
4
|
/** Stable across edits, so an answer keeps pointing at the same step. */
|
|
5
5
|
id: N().min(1),
|
|
6
6
|
/** "After pass 1", "push(4)" — short, and plain text: it also has to work
|
|
@@ -12,7 +12,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
12
12
|
if (e.length !== t.length) return !1;
|
|
13
13
|
const r = [...e].sort(), l = [...t].sort();
|
|
14
14
|
return r.every((a, i) => a === l[i]);
|
|
15
|
-
}, ve =
|
|
15
|
+
}, ve = F({
|
|
16
16
|
instruction: N().default(""),
|
|
17
17
|
/** The starting array, shown read-only above the steps. */
|
|
18
18
|
initial: H(N()).default([]),
|
|
@@ -20,19 +20,19 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
20
20
|
mode: fe.default("rearrange"),
|
|
21
21
|
/** Index numbers above the cells. Off only for an array where position is
|
|
22
22
|
* not part of the question. */
|
|
23
|
-
showIndices:
|
|
24
|
-
caseSensitive:
|
|
23
|
+
showIndices: P().default(!0),
|
|
24
|
+
caseSensitive: P().default(!1),
|
|
25
25
|
/** A point per correct step rather than one for the whole task. On by
|
|
26
26
|
* default: a sort that goes wrong on the last pass still had every
|
|
27
27
|
* earlier one right. */
|
|
28
|
-
partialCredit:
|
|
28
|
+
partialCredit: P().default(!0),
|
|
29
29
|
/**
|
|
30
30
|
* `write` mode only: how many boxes a row has. Omitted means the widest
|
|
31
31
|
* row already authored — `initial` or any step's `expected` — so a row
|
|
32
32
|
* that only ever shrinks needs nothing set here at all.
|
|
33
33
|
*/
|
|
34
34
|
slots: re().int().positive().optional(),
|
|
35
|
-
evaluation: se.default(
|
|
35
|
+
evaluation: se.default(J)
|
|
36
36
|
}).check((e) => {
|
|
37
37
|
const { initial: t, steps: r, mode: l, evaluation: a } = e.value, i = r.map((d) => d.id);
|
|
38
38
|
new Set(i).size !== i.length && e.issues.push({
|
|
@@ -58,32 +58,32 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
58
58
|
path: ["steps"],
|
|
59
59
|
message: "Add at least one step."
|
|
60
60
|
}));
|
|
61
|
-
}),
|
|
61
|
+
}), De = F({
|
|
62
62
|
/** One row per step, in order. A step the learner has not touched yet has
|
|
63
63
|
* no entry here at all — see `carryForward`. */
|
|
64
64
|
rows: H(H(N())).default([])
|
|
65
|
-
}),
|
|
66
|
-
const l =
|
|
65
|
+
}), X = (e, t) => e?.rows?.[t], k = (e, t, r) => X(t, r) || (r <= 0 ? [...e.initial] : k(e, t, r - 1)), _ = (e) => e.slots && e.slots > 0 ? e.slots : Math.max(0, e.initial.length, ...e.steps.map((t) => t.expected.length)), O = (e, t, r) => {
|
|
66
|
+
const l = k(e, t, r);
|
|
67
67
|
if (e.mode !== "write") return l;
|
|
68
|
-
const a =
|
|
68
|
+
const a = _(e);
|
|
69
69
|
return Array.from({ length: a }, (i, d) => l[d] ?? "");
|
|
70
70
|
}, q = (e, t, r, l) => {
|
|
71
71
|
const a = [];
|
|
72
72
|
for (let i = 0; i < r; i++)
|
|
73
|
-
a[i] =
|
|
73
|
+
a[i] = X(t, i) ?? k(e, t, i);
|
|
74
74
|
return a[r] = l, { rows: a };
|
|
75
75
|
}, R = (e, t) => {
|
|
76
76
|
const r = e.trim();
|
|
77
77
|
return t ? r : r.toLowerCase();
|
|
78
|
-
},
|
|
78
|
+
}, B = (e) => {
|
|
79
79
|
const t = [...e];
|
|
80
80
|
for (; t.length > 0 && t[t.length - 1].trim() === ""; )
|
|
81
81
|
t.pop();
|
|
82
82
|
return t;
|
|
83
83
|
}, xe = (e, t, r) => {
|
|
84
|
-
const l =
|
|
84
|
+
const l = B(e).map(
|
|
85
85
|
(i) => R(i, r)
|
|
86
|
-
), a =
|
|
86
|
+
), a = B(t).map((i) => R(i, r));
|
|
87
87
|
return l.length === a.length && l.every((i, d) => i === a[d]);
|
|
88
88
|
}, ye = (e, t, r) => {
|
|
89
89
|
const l = Math.max(e.length, t.length);
|
|
@@ -91,19 +91,19 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
91
91
|
{ length: l },
|
|
92
92
|
(a, i) => R(e[i] ?? "", r) !== R(t[i] ?? "", r)
|
|
93
93
|
);
|
|
94
|
-
},
|
|
95
|
-
const a =
|
|
94
|
+
}, je = (e, t) => e.steps.map((r, l) => {
|
|
95
|
+
const a = k(e, t, l);
|
|
96
96
|
return {
|
|
97
97
|
state: xe(r.expected, a, e.caseSensitive) ? "correct" : "wrong",
|
|
98
98
|
diffs: ye(r.expected, a, e.caseSensitive)
|
|
99
99
|
};
|
|
100
|
-
}),
|
|
100
|
+
}), Se = ({
|
|
101
101
|
data: e,
|
|
102
102
|
answer: t
|
|
103
103
|
}) => {
|
|
104
104
|
if (e.evaluation.mode === "skip")
|
|
105
105
|
return { state: "unknown", allowRetry: !1 };
|
|
106
|
-
const r =
|
|
106
|
+
const r = je(e, t), l = r.length, a = r.filter((h) => h.state === "correct").length, i = l > 0 && a === l, d = e.partialCredit && l > 0 ? { earned: a, possible: l } : { earned: i ? 1 : 0, possible: 1 };
|
|
107
107
|
return {
|
|
108
108
|
state: i ? "correct" : "wrong",
|
|
109
109
|
score: d,
|
|
@@ -113,7 +113,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
113
113
|
diffs: r.map((h) => h.diffs)
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
},
|
|
116
|
+
}, D = {
|
|
117
117
|
en: {
|
|
118
118
|
name: "Algorithm steps",
|
|
119
119
|
description: "An array and the steps of an algorithm over it. The learner writes down or rearranges the array as it stands after each step.",
|
|
@@ -148,7 +148,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
148
148
|
correct: "richtig",
|
|
149
149
|
wrong: "falsch"
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, ke = ".bitflow-array-steps{display:flex;flex-direction:column;gap:var(--bitflow-space-small)}.bitflow-array-block{display:flex;flex-direction:column;gap:var(--bitflow-space-xxsmall)}.bitflow-array-step-header{display:flex;align-items:center;gap:var(--bitflow-space-xsmall)}.bitflow-array-cells{display:flex;flex-wrap:wrap;gap:var(--bitflow-space-xsmall);padding:0;margin:0;list-style:none}.bitflow-array-slot{display:flex;flex-direction:column;align-items:center;gap:var(--bitflow-space-xxsmall)}.bitflow-array-index{font-size:var(--bitflow-font-size-small);font-variant-numeric:tabular-nums;color:var(--bitflow-color-text-muted)}.bitflow-array-cell{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:var(--bitflow-space-xxsmall) var(--bitflow-space-xsmall);font:inherit;font-variant-numeric:tabular-nums;color:var(--bitflow-color-text);text-align:center;background:var(--bitflow-color-surface);border:var(--bitflow-border-width) solid var(--bitflow-color-border);border-radius:var(--bitflow-radius-standard)}.bitflow-array-cell-fixed{background:var(--bitflow-color-neutral-100)}.bitflow-array-cell-button{cursor:pointer}.bitflow-array-cell-button:disabled{cursor:default}.bitflow-array-cell-input{width:3.5rem}.bitflow-array-cell.bitflow-array-cell-held{background:var(--bitflow-color-neutral-100);border-color:var(--bitflow-color-primary);box-shadow:0 0 0 2px var(--bitflow-color-primary)}.bitflow-array-cell.bitflow-array-cell-correct{background:color-mix(in srgb,var(--bitflow-color-correct) 12%,var(--bitflow-color-surface));border-color:var(--bitflow-color-correct)}.bitflow-array-cell.bitflow-array-cell-wrong{background:color-mix(in srgb,var(--bitflow-color-wrong) 12%,var(--bitflow-color-surface));border-color:var(--bitflow-color-wrong)}", Le = {
|
|
152
152
|
en: {
|
|
153
153
|
instructionLabel: "Instruction",
|
|
154
154
|
instructionHint: "Shown above the array. Markdown is allowed.",
|
|
@@ -230,7 +230,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
230
230
|
data: e,
|
|
231
231
|
locale: t
|
|
232
232
|
}) => /* @__PURE__ */ s.jsxs("div", { className: "bitflow-array-block", children: [
|
|
233
|
-
/* @__PURE__ */ s.jsx("span", { className: "bitflow-label", children: ((r) => I(
|
|
233
|
+
/* @__PURE__ */ s.jsx("span", { className: "bitflow-label", children: ((r) => I(D, r, t))("initialLabel") }),
|
|
234
234
|
/* @__PURE__ */ s.jsx(
|
|
235
235
|
M,
|
|
236
236
|
{
|
|
@@ -247,7 +247,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
247
247
|
locale: a,
|
|
248
248
|
onChange: i
|
|
249
249
|
}) => {
|
|
250
|
-
const d = (o, p) => I(
|
|
250
|
+
const d = (o, p) => I(D, o, a, p), [h, y] = C.useState(null), [A, n] = C.useState(""), u = C.useRef(/* @__PURE__ */ new Map()), c = r !== void 0, f = (o, p) => o.label || d("unnamedStep", { number: p + 1 }), E = (o) => o.trim() === "" ? d("emptyCell") : o;
|
|
251
251
|
C.useEffect(() => {
|
|
252
252
|
if (!h) return;
|
|
253
253
|
const o = (p) => {
|
|
@@ -255,11 +255,11 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
255
255
|
};
|
|
256
256
|
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
257
257
|
}, [h, a]);
|
|
258
|
-
const
|
|
258
|
+
const W = (o, p) => {
|
|
259
259
|
u.current.get(`${o}:${p}`)?.focus();
|
|
260
260
|
}, ee = (o, p, m, w) => {
|
|
261
261
|
if (l) return;
|
|
262
|
-
const v =
|
|
262
|
+
const v = k(e, t, w);
|
|
263
263
|
if (!h) {
|
|
264
264
|
y({ stepId: o, index: p }), n(
|
|
265
265
|
d("holding", { value: E(v[p]), step: f(m, w) })
|
|
@@ -276,23 +276,23 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
276
276
|
);
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
|
-
const b = [...v], x = h.index, g = p,
|
|
279
|
+
const b = [...v], x = h.index, g = p, j = b[x], S = b[g];
|
|
280
280
|
[b[x], b[g]] = [b[g], b[x]], i(q(e, t, w, b)), y(null), n(
|
|
281
|
-
d("swapped", { a: E(
|
|
281
|
+
d("swapped", { a: E(j), b: E(S), step: f(m, w) })
|
|
282
282
|
);
|
|
283
283
|
}, te = (o, p, m, w) => {
|
|
284
284
|
const v = o.key === "ArrowLeft" || o.key === "ArrowRight", b = o.key === "ArrowUp" || o.key === "ArrowDown";
|
|
285
285
|
if (!v && !b) return;
|
|
286
286
|
if (o.preventDefault(), v) {
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
|
|
287
|
+
const S = k(e, t, w), L = m + (o.key === "ArrowLeft" ? -1 : 1);
|
|
288
|
+
if (L < 0 || L >= S.length) return;
|
|
289
|
+
W(p, L);
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
292
|
const x = w + (o.key === "ArrowUp" ? -1 : 1), g = e.steps[x];
|
|
293
293
|
if (!g) return;
|
|
294
|
-
const
|
|
295
|
-
|
|
294
|
+
const j = k(e, t, x);
|
|
295
|
+
W(g.id, Math.min(m, Math.max(j.length - 1, 0)));
|
|
296
296
|
}, ae = (o, p, m) => {
|
|
297
297
|
if (l) return;
|
|
298
298
|
const w = [...O(e, t, o)];
|
|
@@ -317,21 +317,21 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
317
317
|
e.mode === "rearrange" ? /* @__PURE__ */ s.jsx(
|
|
318
318
|
M,
|
|
319
319
|
{
|
|
320
|
-
values:
|
|
320
|
+
values: k(e, t, p),
|
|
321
321
|
showIndices: e.showIndices,
|
|
322
322
|
render: (v, b) => {
|
|
323
|
-
const x = h?.stepId === o.id && h.index === b, g = c && m.diffs[b],
|
|
324
|
-
return x &&
|
|
323
|
+
const x = h?.stepId === o.id && h.index === b, g = c && m.diffs[b], j = ["bitflow-array-cell", "bitflow-array-cell-button"];
|
|
324
|
+
return x && j.push("bitflow-array-cell-held"), c && j.push(
|
|
325
325
|
g ? "bitflow-array-cell-wrong" : "bitflow-array-cell-correct"
|
|
326
326
|
), /* @__PURE__ */ s.jsxs(
|
|
327
327
|
"button",
|
|
328
328
|
{
|
|
329
329
|
type: "button",
|
|
330
|
-
ref: (
|
|
331
|
-
const
|
|
332
|
-
|
|
330
|
+
ref: (S) => {
|
|
331
|
+
const L = `${o.id}:${b}`;
|
|
332
|
+
S ? u.current.set(L, S) : u.current.delete(L);
|
|
333
333
|
},
|
|
334
|
-
className:
|
|
334
|
+
className: j.join(" "),
|
|
335
335
|
disabled: l,
|
|
336
336
|
"aria-pressed": x,
|
|
337
337
|
"aria-label": d("cellLabel", {
|
|
@@ -341,7 +341,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
341
341
|
step: w
|
|
342
342
|
}),
|
|
343
343
|
onClick: () => ee(o.id, b, o, p),
|
|
344
|
-
onKeyDown: (
|
|
344
|
+
onKeyDown: (S) => te(S, o.id, b, p),
|
|
345
345
|
children: [
|
|
346
346
|
v,
|
|
347
347
|
c && /* @__PURE__ */ s.jsxs("span", { className: "bitflow-visually-hidden", children: [
|
|
@@ -371,13 +371,13 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
371
371
|
disabled: l,
|
|
372
372
|
"aria-label": d("cellInputLabel", {
|
|
373
373
|
position: b + 1,
|
|
374
|
-
total:
|
|
374
|
+
total: _(e),
|
|
375
375
|
step: w
|
|
376
376
|
}),
|
|
377
377
|
autoCapitalize: "off",
|
|
378
378
|
autoCorrect: "off",
|
|
379
379
|
spellCheck: !1,
|
|
380
|
-
onChange: (
|
|
380
|
+
onChange: (j) => ae(p, b, j.target.value)
|
|
381
381
|
}
|
|
382
382
|
);
|
|
383
383
|
}
|
|
@@ -413,21 +413,21 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
413
413
|
}
|
|
414
414
|
)
|
|
415
415
|
] });
|
|
416
|
-
},
|
|
416
|
+
}, G = (e) => e.join(", "), K = (e) => e.split(",").map((t) => t.trim()).filter((t) => t.length > 0), Y = ({
|
|
417
417
|
values: e,
|
|
418
418
|
onChange: t,
|
|
419
419
|
...r
|
|
420
420
|
}) => {
|
|
421
|
-
const [l, a] = C.useState(() =>
|
|
421
|
+
const [l, a] = C.useState(() => G(e));
|
|
422
422
|
return C.useEffect(() => {
|
|
423
|
-
|
|
423
|
+
K(l).join("\0") !== e.join("\0") && a(G(e));
|
|
424
424
|
}, [e]), /* @__PURE__ */ s.jsx(
|
|
425
|
-
|
|
425
|
+
Q,
|
|
426
426
|
{
|
|
427
427
|
...r,
|
|
428
428
|
value: l,
|
|
429
429
|
onChange: (i) => {
|
|
430
|
-
a(i), t(
|
|
430
|
+
a(i), t(K(i));
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
);
|
|
@@ -436,7 +436,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
436
436
|
const r = `step-${t}`;
|
|
437
437
|
if (!e.includes(r)) return r;
|
|
438
438
|
}
|
|
439
|
-
},
|
|
439
|
+
}, Z = ({
|
|
440
440
|
values: e,
|
|
441
441
|
t
|
|
442
442
|
}) => /* @__PURE__ */ s.jsx("p", { className: "bitflow-text-muted", children: e.length > 0 ? t("parsedAs", { list: e.join(" · "), count: e.length }) : t("parsedEmpty") }), He = ({
|
|
@@ -445,7 +445,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
445
445
|
onChange: r,
|
|
446
446
|
errors: l
|
|
447
447
|
}) => {
|
|
448
|
-
const a = (n, u) => I(
|
|
448
|
+
const a = (n, u) => I(Le, n, t, u), i = (n) => r({ ...e, ...n }), d = oe(e.steps.map((n) => n.id)), h = (n, u) => i({
|
|
449
449
|
steps: e.steps.map(
|
|
450
450
|
(c) => c.id === n ? { ...c, ...u } : c
|
|
451
451
|
)
|
|
@@ -484,7 +484,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
484
484
|
),
|
|
485
485
|
/* @__PURE__ */ s.jsxs("div", { className: "bitflow-field", children: [
|
|
486
486
|
/* @__PURE__ */ s.jsx(
|
|
487
|
-
|
|
487
|
+
Y,
|
|
488
488
|
{
|
|
489
489
|
label: a("initialLabel"),
|
|
490
490
|
hint: a("initialHint"),
|
|
@@ -494,22 +494,22 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
494
494
|
onChange: (n) => i({ initial: n })
|
|
495
495
|
}
|
|
496
496
|
),
|
|
497
|
-
/* @__PURE__ */ s.jsx(
|
|
497
|
+
/* @__PURE__ */ s.jsx(Z, { values: e.initial, t: a })
|
|
498
498
|
] }),
|
|
499
499
|
/* @__PURE__ */ s.jsxs("fieldset", { className: "bitflow-field", children: [
|
|
500
500
|
/* @__PURE__ */ s.jsx("legend", { className: "bitflow-label", children: a("stepsLabel") }),
|
|
501
501
|
/* @__PURE__ */ s.jsx("span", { className: "bitflow-hint", children: a("stepsHint") }),
|
|
502
|
-
|
|
502
|
+
U(l, "steps") && /* @__PURE__ */ s.jsx("span", { className: "bitflow-field-error", role: "alert", children: U(l, "steps") }),
|
|
503
503
|
e.steps.length === 0 && /* @__PURE__ */ s.jsx("p", { className: "bitflow-text-muted", children: a("noSteps") }),
|
|
504
504
|
e.steps.map((n, u) => /* @__PURE__ */ s.jsx("div", { className: "bitflow-rule", children: /* @__PURE__ */ s.jsxs(
|
|
505
|
-
|
|
505
|
+
$,
|
|
506
506
|
{
|
|
507
507
|
...d.props(n.id),
|
|
508
508
|
summary: n.label || a("unnamedStep", { number: u + 1 }),
|
|
509
509
|
aside: a("position", { position: u + 1 }),
|
|
510
510
|
children: [
|
|
511
511
|
/* @__PURE__ */ s.jsx(
|
|
512
|
-
|
|
512
|
+
Q,
|
|
513
513
|
{
|
|
514
514
|
label: a("stepLabelLabel"),
|
|
515
515
|
placeholder: a("stepLabelPlaceholder"),
|
|
@@ -519,7 +519,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
519
519
|
),
|
|
520
520
|
/* @__PURE__ */ s.jsxs("div", { className: "bitflow-field", children: [
|
|
521
521
|
/* @__PURE__ */ s.jsx(
|
|
522
|
-
|
|
522
|
+
Y,
|
|
523
523
|
{
|
|
524
524
|
label: a("stepExpectedLabel"),
|
|
525
525
|
hint: a("stepExpectedHint"),
|
|
@@ -528,7 +528,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
528
528
|
onChange: (c) => h(n.id, { expected: c })
|
|
529
529
|
}
|
|
530
530
|
),
|
|
531
|
-
/* @__PURE__ */ s.jsx(
|
|
531
|
+
/* @__PURE__ */ s.jsx(Z, { values: n.expected, t: a })
|
|
532
532
|
] }),
|
|
533
533
|
/* @__PURE__ */ s.jsxs("div", { className: "bitflow-row", children: [
|
|
534
534
|
/* @__PURE__ */ s.jsx(
|
|
@@ -574,9 +574,9 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
574
574
|
}
|
|
575
575
|
) })
|
|
576
576
|
] }),
|
|
577
|
-
/* @__PURE__ */ s.jsxs(
|
|
577
|
+
/* @__PURE__ */ s.jsxs($, { summary: a("advanced"), children: [
|
|
578
578
|
/* @__PURE__ */ s.jsx(
|
|
579
|
-
|
|
579
|
+
T,
|
|
580
580
|
{
|
|
581
581
|
label: a("showIndicesLabel"),
|
|
582
582
|
hint: a("showIndicesHint"),
|
|
@@ -585,7 +585,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
585
585
|
}
|
|
586
586
|
),
|
|
587
587
|
/* @__PURE__ */ s.jsx(
|
|
588
|
-
|
|
588
|
+
T,
|
|
589
589
|
{
|
|
590
590
|
label: a("caseSensitiveLabel"),
|
|
591
591
|
hint: a("caseSensitiveHint"),
|
|
@@ -594,7 +594,7 @@ const we = ["rearrange", "write"], fe = ne(we), me = W({
|
|
|
594
594
|
}
|
|
595
595
|
),
|
|
596
596
|
/* @__PURE__ */ s.jsx(
|
|
597
|
-
|
|
597
|
+
T,
|
|
598
598
|
{
|
|
599
599
|
label: a("partialCreditLabel"),
|
|
600
600
|
hint: a("partialCreditHint"),
|
|
@@ -634,12 +634,12 @@ ie({
|
|
|
634
634
|
type: V,
|
|
635
635
|
kind: "task",
|
|
636
636
|
schema: ve,
|
|
637
|
-
evaluate:
|
|
637
|
+
evaluate: Se,
|
|
638
638
|
Task: Ae,
|
|
639
639
|
Form: He,
|
|
640
640
|
info: (e) => ({
|
|
641
|
-
name: I(
|
|
642
|
-
description: I(
|
|
641
|
+
name: I(D, "name", e),
|
|
642
|
+
description: I(D, "description", e)
|
|
643
643
|
}),
|
|
644
644
|
defaultData: () => ({
|
|
645
645
|
instruction: "",
|
|
@@ -649,13 +649,13 @@ ie({
|
|
|
649
649
|
showIndices: !0,
|
|
650
650
|
caseSensitive: !1,
|
|
651
651
|
partialCredit: !0,
|
|
652
|
-
evaluation:
|
|
652
|
+
evaluation: J()
|
|
653
653
|
})
|
|
654
654
|
});
|
|
655
655
|
be(V);
|
|
656
|
-
le("bitflow-styles-task-array-steps",
|
|
656
|
+
le("bitflow-styles-task-array-steps", ke);
|
|
657
657
|
export {
|
|
658
|
-
|
|
658
|
+
De as AnswerSchema,
|
|
659
659
|
ve as DataSchema,
|
|
660
660
|
He as Form,
|
|
661
661
|
Ce as InitialRow,
|
|
@@ -665,18 +665,18 @@ export {
|
|
|
665
665
|
Ne as StepsGrid,
|
|
666
666
|
V as TYPE,
|
|
667
667
|
Ae as Task,
|
|
668
|
-
|
|
668
|
+
k as carryForward,
|
|
669
669
|
ye as cellDiffs,
|
|
670
670
|
O as displayRow,
|
|
671
|
-
|
|
672
|
-
|
|
671
|
+
Se as evaluate,
|
|
672
|
+
Le as formMessages,
|
|
673
673
|
ge as isPermutationOf,
|
|
674
|
-
|
|
674
|
+
D as messages,
|
|
675
675
|
R as normaliseCell,
|
|
676
|
-
|
|
676
|
+
X as rowAt,
|
|
677
677
|
xe as rowCorrect,
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
678
|
+
_ as slotCountOf,
|
|
679
|
+
je as stepStates,
|
|
680
|
+
B as trimTrailingBlanks,
|
|
681
681
|
q as withRow
|
|
682
682
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import { P as j, ak as C, a2 as u, ac as T, ad as A, a9 as h, a4 as S, j as r, a as x, b as k, aa as B, s as E } from "./dom-B6NPWBb1.js";
|
|
2
|
+
import { e as m, g, P, F as w, B as z, U as I, H as R } from "./bitLoaders-7qanePQL.js";
|
|
3
|
+
const F = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bitflow-blank-wrapper{display:inline}.bitflow-blank{display:inline-block;width:auto;max-width:100%;min-height:0;padding:2px var(--bitflow-space-xxsmall);vertical-align:baseline}.bitflow-input.bitflow-blank-correct{border-color:var(--bitflow-color-correct);background:var(--bitflow-color-correct-surface)}.bitflow-input.bitflow-blank-wrong{border-color:var(--bitflow-color-wrong);background:var(--bitflow-color-wrong-surface)}", y = /\[\[(\w+)\]\]/g, f = (e) => {
|
|
4
4
|
const t = [];
|
|
5
5
|
for (const n of e.matchAll(y))
|
|
6
6
|
t.includes(n[1]) || t.push(n[1]);
|
|
7
7
|
return t;
|
|
8
|
-
},
|
|
8
|
+
}, U = j({
|
|
9
9
|
instruction: u().default(""),
|
|
10
10
|
/** Plain text with `[[n]]` markers where the gaps go. */
|
|
11
11
|
text: u().default(""),
|
|
@@ -14,7 +14,7 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
14
14
|
caseSensitive: h().default(!1),
|
|
15
15
|
trim: h().default(!0),
|
|
16
16
|
partialCredit: h().default(!0),
|
|
17
|
-
evaluation:
|
|
17
|
+
evaluation: T.default(A)
|
|
18
18
|
}).check((e) => {
|
|
19
19
|
if (e.value.evaluation.mode !== "auto") return;
|
|
20
20
|
const t = f(e.value.text);
|
|
@@ -37,7 +37,7 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
37
37
|
}), O = j({
|
|
38
38
|
/** Blank id → what the learner typed. */
|
|
39
39
|
blanks: C(u(), u()).default({})
|
|
40
|
-
}),
|
|
40
|
+
}), M = ({
|
|
41
41
|
data: e,
|
|
42
42
|
answer: t
|
|
43
43
|
}) => {
|
|
@@ -103,13 +103,13 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
103
103
|
it: { name: "Testo bucato", description: "Un testo con spazi da completare.", correct: "corretto", wrong: "non corretto" },
|
|
104
104
|
pt: { name: "Preencher espaços", description: "Um texto com espaços para completar.", correct: "correto", wrong: "incorreto" },
|
|
105
105
|
tr: { name: "Boşluk doldurma", description: "Doldurulacak boşluklar içeren bir metin.", correct: "doğru", wrong: "yanlış" }
|
|
106
|
-
},
|
|
106
|
+
}, $ = (e) => {
|
|
107
107
|
const t = [];
|
|
108
108
|
let n = 0;
|
|
109
109
|
for (const s of e.matchAll(y))
|
|
110
110
|
s.index > n && t.push({ text: e.slice(n, s.index) }), t.push({ blank: s[1] }), n = s.index + s[0].length;
|
|
111
111
|
return n < e.length && t.push({ text: e.slice(n) }), t;
|
|
112
|
-
},
|
|
112
|
+
}, D = ({
|
|
113
113
|
data: e,
|
|
114
114
|
answer: t,
|
|
115
115
|
result: n,
|
|
@@ -120,7 +120,7 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
120
120
|
const d = x.useId(), a = n?.detail?.blanks ?? {}, b = (i, c) => o({ blanks: { ...t?.blanks, [i]: c } });
|
|
121
121
|
return /* @__PURE__ */ r.jsxs("div", { className: "bitflow-stack", children: [
|
|
122
122
|
/* @__PURE__ */ r.jsx(I, { markdown: e.instruction }),
|
|
123
|
-
/* @__PURE__ */ r.jsx("p", { className: "bitflow-blank-text", children:
|
|
123
|
+
/* @__PURE__ */ r.jsx("p", { className: "bitflow-blank-text", children: $(e.text).map(
|
|
124
124
|
(i, c) => "text" in i ? /* @__PURE__ */ r.jsx(x.Fragment, { children: i.text }, c) : /* @__PURE__ */ r.jsxs("span", { className: "bitflow-blank-wrapper", children: [
|
|
125
125
|
/* @__PURE__ */ r.jsx(
|
|
126
126
|
"input",
|
|
@@ -137,7 +137,7 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
137
137
|
autoCapitalize: "off",
|
|
138
138
|
autoCorrect: "off",
|
|
139
139
|
spellCheck: !1,
|
|
140
|
-
onChange: (
|
|
140
|
+
onChange: (N) => b(i.blank, N.target.value)
|
|
141
141
|
}
|
|
142
142
|
),
|
|
143
143
|
a[i.blank] && a[i.blank] !== "neutral" && /* @__PURE__ */ r.jsx("span", { className: "bitflow-visually-hidden", children: k(p, a[i.blank], l) })
|
|
@@ -192,7 +192,7 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
192
192
|
a
|
|
193
193
|
))
|
|
194
194
|
] }),
|
|
195
|
-
/* @__PURE__ */ r.jsxs(
|
|
195
|
+
/* @__PURE__ */ r.jsxs(P, { summary: l("advanced"), children: [
|
|
196
196
|
/* @__PURE__ */ r.jsx(
|
|
197
197
|
w,
|
|
198
198
|
{
|
|
@@ -219,7 +219,7 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
219
219
|
}
|
|
220
220
|
),
|
|
221
221
|
/* @__PURE__ */ r.jsx(
|
|
222
|
-
|
|
222
|
+
z,
|
|
223
223
|
{
|
|
224
224
|
evaluation: e.evaluation,
|
|
225
225
|
locale: t,
|
|
@@ -228,13 +228,13 @@ const P = ".bitflow-blank-text{white-space:pre-wrap;line-height:2.2;margin:0}.bi
|
|
|
228
228
|
)
|
|
229
229
|
] })
|
|
230
230
|
] });
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
type:
|
|
231
|
+
}, H = "task-fill-in-the-blank";
|
|
232
|
+
B({
|
|
233
|
+
type: H,
|
|
234
234
|
kind: "task",
|
|
235
|
-
schema:
|
|
236
|
-
evaluate:
|
|
237
|
-
Task:
|
|
235
|
+
schema: U,
|
|
236
|
+
evaluate: M,
|
|
237
|
+
Task: D,
|
|
238
238
|
Form: W,
|
|
239
239
|
info: (e) => ({
|
|
240
240
|
name: k(p, "name", e),
|
|
@@ -250,16 +250,16 @@ E({
|
|
|
250
250
|
evaluation: A()
|
|
251
251
|
})
|
|
252
252
|
});
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
R(H);
|
|
254
|
+
E("bitflow-styles-task-fill-in-the-blank", F);
|
|
255
255
|
export {
|
|
256
256
|
O as AnswerSchema,
|
|
257
257
|
y as BLANK_PATTERN,
|
|
258
|
-
|
|
258
|
+
U as DataSchema,
|
|
259
259
|
W as Form,
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
H as TYPE,
|
|
261
|
+
D as Task,
|
|
262
262
|
f as blankIdsIn,
|
|
263
|
-
|
|
263
|
+
M as evaluate,
|
|
264
264
|
p as messages
|
|
265
265
|
};
|