alexsys-exam-renderer 0.1.6 → 0.1.8
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/index.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import { Fragment as e, useEffect as t, useLayoutEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
2
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
3
3
|
import { DragDropProvider as l, useDraggable as u, useDroppable as d } from "@dnd-kit/react";
|
|
4
|
-
import { Apple as f, CheckCircle2 as p, Circle as m, Diamond as h, Eraser as g, Flower2 as _, Heart as v, Hexagon as y, ImagePlus as b, Mic as x, MousePointer2 as S, Pencil as C, PencilRuler as w, Pentagon as T, RectangleHorizontal as E, RotateCcw as
|
|
5
|
-
import { Arc as
|
|
6
|
-
import { move as
|
|
7
|
-
import { useSortable as
|
|
4
|
+
import { Apple as f, CheckCircle2 as p, Circle as m, Diamond as h, Eraser as g, Flower2 as _, Heart as v, Hexagon as y, ImagePlus as b, Mic as x, MousePointer2 as S, Pencil as C, PencilRuler as w, Pentagon as T, RectangleHorizontal as E, RotateCcw as D, Shapes as O, Square as ee, Star as k, Sun as A, Trash2 as j, Triangle as M, Type as N, VolumeX as te, XCircle as P } from "lucide-react";
|
|
5
|
+
import { Arc as F, Circle as I, Ellipse as L, Group as R, Image as z, Layer as ne, Line as B, Rect as V, RegularPolygon as re, Stage as ie, Star as ae, Text as H, Transformer as oe, Wedge as se } from "react-konva";
|
|
6
|
+
import { move as U } from "@dnd-kit/helpers";
|
|
7
|
+
import { useSortable as ce } from "@dnd-kit/react/sortable";
|
|
8
8
|
//#region src/exam-session/examPoints.ts
|
|
9
|
-
function
|
|
9
|
+
function le(e) {
|
|
10
10
|
if (!e) return 0;
|
|
11
11
|
let t = Number.parseFloat(e.replace(",", "."));
|
|
12
12
|
return Number.isFinite(t) ? t : 0;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function ue(e) {
|
|
15
15
|
let t = Math.round(e * 100) / 100;
|
|
16
16
|
return String(t);
|
|
17
17
|
}
|
|
18
|
-
function H(e) {
|
|
19
|
-
return de(e.maxScore);
|
|
20
|
-
}
|
|
21
|
-
function U(e) {
|
|
22
|
-
return e.questions.some((e) => me(e.maxScore));
|
|
23
|
-
}
|
|
24
18
|
function W(e) {
|
|
25
|
-
return
|
|
19
|
+
return le(e.maxScore);
|
|
20
|
+
}
|
|
21
|
+
function de(e) {
|
|
22
|
+
return e.questions.some((e) => pe(e.maxScore));
|
|
26
23
|
}
|
|
27
24
|
function G(e) {
|
|
28
|
-
return
|
|
25
|
+
return de(e) ? me(e.questions.reduce((e, t) => e + W(t), 0)) : le(e.points);
|
|
29
26
|
}
|
|
30
|
-
function
|
|
27
|
+
function K(e) {
|
|
28
|
+
return ue(G(e));
|
|
29
|
+
}
|
|
30
|
+
function fe(e) {
|
|
31
31
|
return {
|
|
32
32
|
...e,
|
|
33
|
-
points:
|
|
33
|
+
points: K(e)
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function pe(e) {
|
|
37
37
|
return typeof e == "string" && e.trim().length > 0;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function me(e) {
|
|
40
40
|
return Math.round(e * 100) / 100;
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/renderer/operationNumbers.ts
|
|
44
|
-
function
|
|
44
|
+
function q(e) {
|
|
45
45
|
return e.replace(/[.\u066b]/g, ",");
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let t =
|
|
47
|
+
function he(e) {
|
|
48
|
+
let t = q(e).trim().replace(/[\u0660-\u0669]/g, (e) => `${e.charCodeAt(0) - 1632}`).replace(/[\u06f0-\u06f9]/g, (e) => `${e.charCodeAt(0) - 1776}`).replace(",", ".");
|
|
49
49
|
if (!/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(t)) return null;
|
|
50
50
|
let n = Number(t);
|
|
51
51
|
return Number.isFinite(n) ? n : null;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function ge(e) {
|
|
54
54
|
let t = Math.round((e + 2 ** -52) * 1e10) / 1e10;
|
|
55
|
-
return
|
|
55
|
+
return q(String(t));
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/exam-session/examScoring.ts
|
|
59
|
-
var
|
|
60
|
-
function
|
|
61
|
-
let n = e.sections.filter((e) => e.isScored !== !1).map((e) =>
|
|
59
|
+
var _e = 1e3, ve = 600, ye = 70;
|
|
60
|
+
function be(e, t) {
|
|
61
|
+
let n = e.sections.filter((e) => e.isScored !== !1).map((e) => xe(e, t)), r = Y(n, (e) => e.correctCount), i = Y(n, (e) => e.incorrectCount), a = Y(n, (e) => e.unansweredCount), o = i + a, s = Y(n, (e) => e.totalUnits), c = Ue(Y(n, (e) => e.maxScore)), l = Ue(Y(n, (e) => e.score));
|
|
62
62
|
return {
|
|
63
63
|
attentionWarningCount: 0,
|
|
64
64
|
correctCount: r,
|
|
@@ -66,7 +66,7 @@ function xe(e, t) {
|
|
|
66
66
|
incorrectCount: i,
|
|
67
67
|
maxScore: c,
|
|
68
68
|
notCorrectCount: o,
|
|
69
|
-
percentage: c > 0 ?
|
|
69
|
+
percentage: c > 0 ? Ue(l / c * 100) : 0,
|
|
70
70
|
score: l,
|
|
71
71
|
sections: n,
|
|
72
72
|
subject: e.subject,
|
|
@@ -75,19 +75,19 @@ function xe(e, t) {
|
|
|
75
75
|
unansweredCount: a
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
let n =
|
|
80
|
-
maxScore: n ?
|
|
81
|
-
units:
|
|
82
|
-
})), a = !n &&
|
|
78
|
+
function xe(e, t) {
|
|
79
|
+
let n = de(e), r = G(e), i = e.questions.map((e) => ({
|
|
80
|
+
maxScore: n ? W(e) : 0,
|
|
81
|
+
units: Se(e, t)
|
|
82
|
+
})), a = !n && Y(i, (e) => e.units.length) > 0 ? r / Y(i, (e) => e.units.length) : 0, o = i.flatMap((t) => {
|
|
83
83
|
let r = n ? t.units.length > 0 ? t.maxScore / t.units.length : 0 : a;
|
|
84
84
|
return t.units.map((t) => ({
|
|
85
85
|
...t,
|
|
86
|
-
maxScore:
|
|
87
|
-
score: t.status === "correct" ?
|
|
86
|
+
maxScore: Ue(r),
|
|
87
|
+
score: t.status === "correct" ? Ue(r) : 0,
|
|
88
88
|
sectionId: e.id
|
|
89
89
|
}));
|
|
90
|
-
}), s =
|
|
90
|
+
}), s = He(o, "correct"), c = He(o, "incorrect"), l = He(o, "unanswered"), u = c + l;
|
|
91
91
|
return {
|
|
92
92
|
badge: e.badge,
|
|
93
93
|
correctCount: s,
|
|
@@ -95,7 +95,7 @@ function Se(e, t) {
|
|
|
95
95
|
incorrectCount: c,
|
|
96
96
|
maxScore: r,
|
|
97
97
|
notCorrectCount: u,
|
|
98
|
-
score:
|
|
98
|
+
score: Ue(Y(o, (e) => e.score)),
|
|
99
99
|
title: e.title,
|
|
100
100
|
tone: e.tone,
|
|
101
101
|
totalUnits: o.length,
|
|
@@ -103,104 +103,104 @@ function Se(e, t) {
|
|
|
103
103
|
units: o
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Se(e, t) {
|
|
107
107
|
switch (e.type) {
|
|
108
108
|
case "inline-inputs":
|
|
109
109
|
case "equation-inputs": return e.items.flatMap((n) => {
|
|
110
110
|
if (n.answers?.length) return n.answers.flatMap((r) => {
|
|
111
111
|
if (!r.correctAnswer) return [];
|
|
112
112
|
let i = `${e.id}:${n.id}:${r.id}`;
|
|
113
|
-
return [
|
|
113
|
+
return [Te(i, e.id, r.before, r.correctAnswer, t[i])];
|
|
114
114
|
});
|
|
115
115
|
if (!n.correctAnswer) return [];
|
|
116
116
|
let r = `${e.id}:${n.id}`;
|
|
117
|
-
return [
|
|
117
|
+
return [Te(r, e.id, n.before, n.correctAnswer, t[r])];
|
|
118
118
|
});
|
|
119
|
-
case "number-line": return [
|
|
120
|
-
case "operation-solving": return [
|
|
121
|
-
case "visual-choice": return
|
|
122
|
-
case "length-estimation": return
|
|
123
|
-
case "shape-choice": return
|
|
124
|
-
case "drag-match": return
|
|
125
|
-
case "drawing-grid": return [
|
|
126
|
-
case "table-response": return
|
|
127
|
-
case "text-input": return e.correctAnswer ? [
|
|
119
|
+
case "number-line": return [Te(e.id, e.id, e.expression, e.correctAnswer, t[e.id])];
|
|
120
|
+
case "operation-solving": return [Te(e.id, e.id, we(e), e.correctAnswer, t[e.id])];
|
|
121
|
+
case "visual-choice": return Ee(e.id, e.id, e.grading.pairs, t[e.id]);
|
|
122
|
+
case "length-estimation": return De(e, t);
|
|
123
|
+
case "shape-choice": return Ee(e.id, e.id, e.grading.pairs, t[e.id]);
|
|
124
|
+
case "drag-match": return Ee(e.id, e.id, e.grading?.pairs, t[e.id]);
|
|
125
|
+
case "drawing-grid": return [Ne(e, t[e.id])];
|
|
126
|
+
case "table-response": return ke(e, t[e.id]);
|
|
127
|
+
case "text-input": return e.correctAnswer ? [Te(e.id, e.id, e.prompt, e.correctAnswer, t[e.id])] : [];
|
|
128
128
|
case "word-problem": return e.parts.flatMap((n) => {
|
|
129
129
|
let r = `${e.id}:${n.id}`;
|
|
130
|
-
return n.type === "coin-table" ?
|
|
130
|
+
return n.type === "coin-table" ? Ae(e.id, n, t[r]) : n.type === "table" ? je(e.id, n, t) : n.correctAnswer ? [Te(r, e.id, n.prompt, n.correctAnswer, t[r])] : [];
|
|
131
131
|
});
|
|
132
132
|
case "sortable-answer": return [];
|
|
133
|
-
case "label-placement": return
|
|
134
|
-
case "audio-recording": return [
|
|
133
|
+
case "label-placement": return Me(e.id, e.grading?.targetsByLabelId, t[e.id]);
|
|
134
|
+
case "audio-recording": return [Ce(e, t[e.id])];
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return t?.kind === "audio-recording" ?
|
|
137
|
+
function Ce(e, t) {
|
|
138
|
+
return t?.kind === "audio-recording" ? J(e.id, e.id, e.expectedAnswer, t.evaluation.isCorrect ? "correct" : "incorrect") : J(e.id, e.id, e.expectedAnswer, "unanswered");
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return `${
|
|
140
|
+
function we(e) {
|
|
141
|
+
return `${q(e.leftOperand)} ${e.operator} ${q(e.rightOperand)} =`;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
144
|
-
return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ?
|
|
143
|
+
function Te(e, t, n, r, i) {
|
|
144
|
+
return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ? J(e, t, n, "unanswered") : J(e, t, n, i.recognizedValue && Be(i.recognizedValue, r) ? "correct" : "incorrect") : i?.kind !== "text" || Ve(i.value) === "" ? J(e, t, n, "unanswered") : J(e, t, n, Be(i.value, r) ? "correct" : "incorrect") : J(e, t, n, "incorrect");
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Ee(e, t, n, r) {
|
|
147
147
|
return n ? Object.entries(n).map(([n, i]) => {
|
|
148
148
|
let a = r?.kind === "matches" ? r.pairs[n] : void 0, o = a ? a === i ? "correct" : "incorrect" : "unanswered";
|
|
149
|
-
return
|
|
149
|
+
return J(`${e}:${n}`, t, n, o);
|
|
150
150
|
}) : [];
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function De(e, t) {
|
|
153
153
|
let n = e.items.map((n) => {
|
|
154
154
|
let r = `${e.id}:squares:${n.id}`;
|
|
155
|
-
return
|
|
155
|
+
return Te(r, e.id, n.label, n.squareLength.toString(), t[r]);
|
|
156
156
|
}), r = e.items.flatMap((n) => {
|
|
157
157
|
if (!n.correctColorId) return [];
|
|
158
158
|
let r = `${e.id}:color:${n.id}`;
|
|
159
|
-
return [
|
|
159
|
+
return [Oe(r, e.id, n.label, n.correctColorId, t[r])];
|
|
160
160
|
});
|
|
161
161
|
return n.concat(r);
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return i?.kind !== "choice" || !i.choiceId ?
|
|
163
|
+
function Oe(e, t, n, r, i) {
|
|
164
|
+
return i?.kind !== "choice" || !i.choiceId ? J(e, t, n, "unanswered") : J(e, t, n, i.choiceId === r ? "correct" : "incorrect");
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function ke(e, t) {
|
|
167
167
|
return e.columns.flatMap((n) => {
|
|
168
168
|
if (typeof n.correctCount != "number") return [];
|
|
169
169
|
let r = t?.kind === "coin-table" ? t.counts[n.id] : void 0, i = r === void 0 ? "unanswered" : r === n.correctCount ? "correct" : "incorrect";
|
|
170
|
-
return
|
|
170
|
+
return J(`${e.id}:${n.id}`, e.id, n.title, i);
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function Ae(e, t, n) {
|
|
174
174
|
return t.columns.flatMap((r) => {
|
|
175
175
|
if (typeof r.correctCount != "number") return [];
|
|
176
176
|
let i = n?.kind === "coin-table" ? n.counts[r.id] : void 0, a = i === void 0 ? "unanswered" : i === r.correctCount ? "correct" : "incorrect";
|
|
177
|
-
return
|
|
177
|
+
return J(`${e}:${t.id}:${r.id}`, e, r.title, a);
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function je(e, t, n) {
|
|
181
181
|
return t.cells.flatMap((r) => {
|
|
182
182
|
if (t.hasHeaderRow && r.row === 0 || r.mode === "static" || !r.correctAnswer?.trim()) return [];
|
|
183
183
|
let i = `${e}:${t.id}:${r.id}`;
|
|
184
|
-
return [
|
|
184
|
+
return [Te(i, e, `${t.prompt} ${r.initialText}`.trim(), r.correctAnswer, n[i])];
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function Me(e, t, n) {
|
|
188
188
|
return t ? Object.entries(t).map(([t, r]) => {
|
|
189
189
|
let i = n?.kind === "placements" ? n.placements[t]?.targetId : void 0, a = i ? i === r ? "correct" : "incorrect" : "unanswered";
|
|
190
|
-
return
|
|
190
|
+
return J(`${e}:${t}`, e, t, a);
|
|
191
191
|
}) : [];
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Ne(e, t) {
|
|
194
194
|
let n = e.grading.expectedSegments, r = t?.kind === "drawing" && ((t.elements?.length ?? 0) > 0 || (t.strokes?.length ?? 0) > 0);
|
|
195
|
-
if (t?.kind !== "drawing" || !r) return
|
|
196
|
-
let i = n.every((n) =>
|
|
197
|
-
return
|
|
195
|
+
if (t?.kind !== "drawing" || !r) return J(e.id, e.id, e.prompt, "unanswered");
|
|
196
|
+
let i = n.every((n) => Pe(t, e, n));
|
|
197
|
+
return J(e.id, e.id, e.prompt, i ? "correct" : "incorrect");
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
let r =
|
|
201
|
-
return !r || !i ? !1 :
|
|
199
|
+
function Pe(e, t, n) {
|
|
200
|
+
let r = Re(t, n.from), i = Re(t, n.to);
|
|
201
|
+
return !r || !i ? !1 : Fe(e).some((e) => Ie(e, r, i));
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function Fe(e) {
|
|
204
204
|
let t = e.elements.flatMap((e) => e.type === "line" ? [{
|
|
205
205
|
end: {
|
|
206
206
|
x: e.points[2],
|
|
@@ -234,31 +234,31 @@ function Ie(e) {
|
|
|
234
234
|
}]) ?? [];
|
|
235
235
|
return t.concat(n);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
let r =
|
|
239
|
-
return !r && !i ? !1 :
|
|
237
|
+
function Ie(e, t, n) {
|
|
238
|
+
let r = We(e.start, t) <= ye && We(e.end, n) <= ye, i = We(e.start, n) <= ye && We(e.end, t) <= ye;
|
|
239
|
+
return !r && !i ? !1 : Le(e.points, t, n, ye);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
for (let i = 0; i < e.length - 1; i += 4) if (
|
|
241
|
+
function Le(e, t, n, r) {
|
|
242
|
+
for (let i = 0; i < e.length - 1; i += 4) if (Ge({
|
|
243
243
|
x: e[i],
|
|
244
244
|
y: e[i + 1]
|
|
245
245
|
}, t, n) > r) return !1;
|
|
246
246
|
return !0;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function Re(e, t) {
|
|
249
249
|
if ("pointId" in t) {
|
|
250
250
|
let n = e.points.find((e) => e.id === t.pointId);
|
|
251
|
-
return n ?
|
|
251
|
+
return n ? ze(n.x, n.y) : null;
|
|
252
252
|
}
|
|
253
|
-
return
|
|
253
|
+
return ze(t.percentX, t.percentY);
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function ze(e, t) {
|
|
256
256
|
return {
|
|
257
|
-
x: e / 100 *
|
|
258
|
-
y: t / 100 *
|
|
257
|
+
x: e / 100 * _e,
|
|
258
|
+
y: t / 100 * ve
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function J(e, t, n, r) {
|
|
262
262
|
return {
|
|
263
263
|
id: e,
|
|
264
264
|
label: n,
|
|
@@ -266,41 +266,41 @@ function q(e, t, n, r) {
|
|
|
266
266
|
status: r
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
-
function
|
|
270
|
-
let n =
|
|
269
|
+
function Be(e, t) {
|
|
270
|
+
let n = Ve(e), r = Ve(t), i = he(n), a = he(r);
|
|
271
271
|
return i !== null && a !== null ? i === a : n === r;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Ve(e) {
|
|
274
274
|
return e.trim().replace(/[٠-٩]/g, (e) => `${e.charCodeAt(0) - 1632}`).replace(/[۰-۹]/g, (e) => `${e.charCodeAt(0) - 1776}`);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function He(e, t) {
|
|
277
277
|
return e.filter((e) => e.status === t).length;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Y(e, t) {
|
|
280
280
|
return e.reduce((e, n) => e + t(n), 0);
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Ue(e) {
|
|
283
283
|
return Math.round(e * 100) / 100;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function We(e, t) {
|
|
286
286
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function Ge(e, t, n) {
|
|
289
289
|
let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
|
|
290
|
-
if (a === 0) return
|
|
290
|
+
if (a === 0) return We(e, t);
|
|
291
291
|
let o = Math.max(0, Math.min(1, ((e.x - t.x) * r + (e.y - t.y) * i) / a));
|
|
292
|
-
return
|
|
292
|
+
return We(e, {
|
|
293
293
|
x: t.x + o * r,
|
|
294
294
|
y: t.y + o * i
|
|
295
295
|
});
|
|
296
296
|
}
|
|
297
297
|
//#endregion
|
|
298
298
|
//#region src/exam-session/interactions/CoinTableResponse.tsx
|
|
299
|
-
var
|
|
300
|
-
function
|
|
299
|
+
var Ke = 0, qe = 12;
|
|
300
|
+
function Je({ columns: e, value: t, onChange: n }) {
|
|
301
301
|
let r = t?.counts ?? {};
|
|
302
302
|
function i(e, t) {
|
|
303
|
-
let i = e.maxCoins ??
|
|
303
|
+
let i = e.maxCoins ?? qe, a = Math.max(Ke, Math.min(i, t));
|
|
304
304
|
n({
|
|
305
305
|
kind: "coin-table",
|
|
306
306
|
counts: {
|
|
@@ -312,7 +312,7 @@ function Ye({ columns: e, value: t, onChange: n }) {
|
|
|
312
312
|
return /* @__PURE__ */ s("div", {
|
|
313
313
|
className: "response-table",
|
|
314
314
|
children: e.map((e) => {
|
|
315
|
-
let t = r[e.id] ?? 0, n = e.maxCoins ??
|
|
315
|
+
let t = r[e.id] ?? 0, n = e.maxCoins ?? qe;
|
|
316
316
|
return /* @__PURE__ */ c("div", {
|
|
317
317
|
className: "response-column",
|
|
318
318
|
children: [
|
|
@@ -337,7 +337,7 @@ function Ye({ columns: e, value: t, onChange: n }) {
|
|
|
337
337
|
children: "إِضافَةٌ"
|
|
338
338
|
}), /* @__PURE__ */ s("button", {
|
|
339
339
|
className: "coin-action coin-action--secondary",
|
|
340
|
-
disabled: t <=
|
|
340
|
+
disabled: t <= Ke,
|
|
341
341
|
onClick: () => i(e, t - 1),
|
|
342
342
|
type: "button",
|
|
343
343
|
children: "حَذْفٌ"
|
|
@@ -364,17 +364,17 @@ function Ye({ columns: e, value: t, onChange: n }) {
|
|
|
364
364
|
}
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/renderer/shapeCatalog.tsx
|
|
367
|
-
var
|
|
367
|
+
var Ye = {
|
|
368
368
|
circle: m,
|
|
369
369
|
diamond: h,
|
|
370
370
|
heart: v,
|
|
371
371
|
hexagon: y,
|
|
372
372
|
pentagon: T,
|
|
373
373
|
rectangle: E,
|
|
374
|
-
square:
|
|
375
|
-
star:
|
|
376
|
-
triangle:
|
|
377
|
-
},
|
|
374
|
+
square: ee,
|
|
375
|
+
star: k,
|
|
376
|
+
triangle: M
|
|
377
|
+
}, Xe = {
|
|
378
378
|
circle: "Cercle",
|
|
379
379
|
diamond: "Losange",
|
|
380
380
|
heart: "Coeur",
|
|
@@ -384,15 +384,15 @@ var Xe = {
|
|
|
384
384
|
square: "Carre",
|
|
385
385
|
star: "Etoile",
|
|
386
386
|
triangle: "Triangle"
|
|
387
|
-
},
|
|
388
|
-
label:
|
|
387
|
+
}, Ze = Object.keys(Xe).map((e) => ({
|
|
388
|
+
label: Xe[e],
|
|
389
389
|
value: e
|
|
390
390
|
}));
|
|
391
|
-
function
|
|
392
|
-
return
|
|
391
|
+
function Qe(e) {
|
|
392
|
+
return Xe[e];
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
let n =
|
|
394
|
+
function $e({ shapeId: e, title: t }) {
|
|
395
|
+
let n = Ye[e];
|
|
396
396
|
return /* @__PURE__ */ s("span", {
|
|
397
397
|
"aria-label": t,
|
|
398
398
|
role: t ? "img" : void 0,
|
|
@@ -402,7 +402,7 @@ function et({ shapeId: e, title: t }) {
|
|
|
402
402
|
}
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/exam-session/interactions/DragMatch.tsx
|
|
405
|
-
function
|
|
405
|
+
function et({ items: e, targets: t, value: n, onChange: r }) {
|
|
406
406
|
let i = n?.pairs ?? {}, a = new Set(Object.values(i));
|
|
407
407
|
return /* @__PURE__ */ s(l, {
|
|
408
408
|
onDragEnd: (e) => {
|
|
@@ -420,10 +420,10 @@ function tt({ items: e, targets: t, value: n, onChange: r }) {
|
|
|
420
420
|
className: "drag-match",
|
|
421
421
|
children: [/* @__PURE__ */ s("div", {
|
|
422
422
|
className: "drag-match__items",
|
|
423
|
-
children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ s(
|
|
423
|
+
children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ s(tt, { item: e }, e.id))
|
|
424
424
|
}), /* @__PURE__ */ s("div", {
|
|
425
425
|
className: "drag-match__targets",
|
|
426
|
-
children: t.map((t) => /* @__PURE__ */ s(
|
|
426
|
+
children: t.map((t) => /* @__PURE__ */ s(nt, {
|
|
427
427
|
assignedItem: e.find((e) => e.id === i[t.id]),
|
|
428
428
|
target: t
|
|
429
429
|
}, t.id))
|
|
@@ -431,7 +431,7 @@ function tt({ items: e, targets: t, value: n, onChange: r }) {
|
|
|
431
431
|
})
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function tt({ item: e }) {
|
|
435
435
|
let { ref: t, isDragging: n } = u({ id: e.id });
|
|
436
436
|
return /* @__PURE__ */ s("button", {
|
|
437
437
|
className: n ? "drag-pill drag-pill--dragging" : "drag-pill",
|
|
@@ -440,24 +440,24 @@ function nt({ item: e }) {
|
|
|
440
440
|
children: e.label
|
|
441
441
|
});
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function nt({ assignedItem: e, target: t }) {
|
|
444
444
|
let { ref: n, isDropTarget: r } = d({ id: t.id });
|
|
445
445
|
return /* @__PURE__ */ c("div", {
|
|
446
446
|
className: r ? "drop-slot drop-slot--active" : "drop-slot",
|
|
447
447
|
ref: n,
|
|
448
448
|
children: [/* @__PURE__ */ s("span", {
|
|
449
449
|
className: t.shapeId ? "drop-slot__visual drop-slot__visual--shape" : "drop-slot__visual",
|
|
450
|
-
children: t.shapeId ? /* @__PURE__ */ s(
|
|
450
|
+
children: t.shapeId ? /* @__PURE__ */ s($e, {
|
|
451
451
|
shapeId: t.shapeId,
|
|
452
452
|
title: t.label
|
|
453
453
|
}) : t.label
|
|
454
|
-
}), e ? /* @__PURE__ */ s(
|
|
454
|
+
}), e ? /* @__PURE__ */ s(tt, { item: e }) : /* @__PURE__ */ s("span", { children: "ضع الإجابة هنا" })]
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
//#endregion
|
|
458
458
|
//#region src/exam-session/interactions/HandwrittenNumberAnswer.tsx
|
|
459
|
-
var
|
|
460
|
-
function
|
|
459
|
+
var rt = 132, it = 88, at = 650;
|
|
460
|
+
function ot({ ariaLabel: e, canvasWidth: n = rt, onChange: r, onClear: o, recognizer: l, value: u }) {
|
|
461
461
|
let d = u?.strokes ?? [], f = d.length === 0, p = i(r), [m, h] = a(!1), [_, v] = a(!1), y = !!l?.isAvailable(), b = l?.getStatus?.() ?? (y ? "ready" : "unavailable"), x = b === "preparing" || b === "error", S = b === "preparing" ? "preparing-model" : b === "error" ? "model-error" : f || m ? "idle" : u?.recognizedValue === void 0 ? !y || b === "unavailable" ? "unavailable" : _ ? "unrecognized" : "recognizing" : "recognized";
|
|
462
462
|
t(() => {
|
|
463
463
|
p.current = r;
|
|
@@ -475,7 +475,7 @@ function Y({ ariaLabel: e, canvasWidth: n = it, onChange: r, onClear: o, recogni
|
|
|
475
475
|
}).catch(() => {
|
|
476
476
|
e || v(!0);
|
|
477
477
|
});
|
|
478
|
-
},
|
|
478
|
+
}, at);
|
|
479
479
|
return () => {
|
|
480
480
|
e = !0, window.clearTimeout(t);
|
|
481
481
|
};
|
|
@@ -489,7 +489,7 @@ function Y({ ariaLabel: e, canvasWidth: n = it, onChange: r, onClear: o, recogni
|
|
|
489
489
|
]);
|
|
490
490
|
function C(e) {
|
|
491
491
|
v(!1), r({
|
|
492
|
-
canvasHeight:
|
|
492
|
+
canvasHeight: it,
|
|
493
493
|
canvasWidth: n,
|
|
494
494
|
kind: "handwritten-number",
|
|
495
495
|
strokes: e
|
|
@@ -520,7 +520,7 @@ function Y({ ariaLabel: e, canvasWidth: n = it, onChange: r, onClear: o, recogni
|
|
|
520
520
|
function E(e) {
|
|
521
521
|
x || (e.evt.preventDefault(), h(!1));
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function D() {
|
|
524
524
|
h(!1), C([]), o?.();
|
|
525
525
|
}
|
|
526
526
|
return /* @__PURE__ */ c("div", {
|
|
@@ -529,46 +529,46 @@ function Y({ ariaLabel: e, canvasWidth: n = it, onChange: r, onClear: o, recogni
|
|
|
529
529
|
className: "handwritten-number-answer",
|
|
530
530
|
"data-model-state": b,
|
|
531
531
|
children: [
|
|
532
|
-
/* @__PURE__ */ c(
|
|
532
|
+
/* @__PURE__ */ c(ie, {
|
|
533
533
|
className: "handwritten-number-stage",
|
|
534
|
-
height:
|
|
534
|
+
height: it,
|
|
535
535
|
onPointerCancel: E,
|
|
536
536
|
onPointerDown: w,
|
|
537
537
|
onPointerMove: T,
|
|
538
538
|
onPointerUp: E,
|
|
539
539
|
role: "img",
|
|
540
540
|
width: n,
|
|
541
|
-
children: [/* @__PURE__ */ c(
|
|
541
|
+
children: [/* @__PURE__ */ c(ne, {
|
|
542
542
|
listening: !1,
|
|
543
543
|
children: [
|
|
544
|
-
/* @__PURE__ */ s(
|
|
544
|
+
/* @__PURE__ */ s(V, {
|
|
545
545
|
cornerRadius: 14,
|
|
546
546
|
fill: "#fff",
|
|
547
|
-
height:
|
|
547
|
+
height: it,
|
|
548
548
|
stroke: "#cfe3d9",
|
|
549
549
|
strokeWidth: 2,
|
|
550
550
|
width: n,
|
|
551
551
|
x: 0,
|
|
552
552
|
y: 0
|
|
553
553
|
}),
|
|
554
|
-
/* @__PURE__ */ s(
|
|
554
|
+
/* @__PURE__ */ s(B, {
|
|
555
555
|
dash: [6, 8],
|
|
556
556
|
points: [
|
|
557
557
|
16,
|
|
558
|
-
|
|
558
|
+
it - 18,
|
|
559
559
|
n - 16,
|
|
560
|
-
|
|
560
|
+
it - 18
|
|
561
561
|
],
|
|
562
562
|
stroke: "#dbe9e2",
|
|
563
563
|
strokeWidth: 2
|
|
564
564
|
}),
|
|
565
|
-
f ? /* @__PURE__ */ s(
|
|
565
|
+
f ? /* @__PURE__ */ s(H, {
|
|
566
566
|
align: "center",
|
|
567
567
|
fill: "#9aaca3",
|
|
568
568
|
fontFamily: "Arial, sans-serif",
|
|
569
569
|
fontSize: 15,
|
|
570
570
|
fontStyle: "bold",
|
|
571
|
-
height:
|
|
571
|
+
height: it,
|
|
572
572
|
text: "ارسم هنا",
|
|
573
573
|
verticalAlign: "middle",
|
|
574
574
|
width: n,
|
|
@@ -576,7 +576,7 @@ function Y({ ariaLabel: e, canvasWidth: n = it, onChange: r, onClear: o, recogni
|
|
|
576
576
|
y: 0
|
|
577
577
|
}) : null
|
|
578
578
|
]
|
|
579
|
-
}), /* @__PURE__ */ s(
|
|
579
|
+
}), /* @__PURE__ */ s(ne, { children: d.map((e) => /* @__PURE__ */ s(B, {
|
|
580
580
|
globalCompositeOperation: "source-over",
|
|
581
581
|
lineCap: "round",
|
|
582
582
|
lineJoin: "round",
|
|
@@ -590,7 +590,7 @@ function Y({ ariaLabel: e, canvasWidth: n = it, onChange: r, onClear: o, recogni
|
|
|
590
590
|
"aria-label": "مسح الجواب المرسوم",
|
|
591
591
|
className: "handwritten-number-clear",
|
|
592
592
|
disabled: f || x,
|
|
593
|
-
onClick:
|
|
593
|
+
onClick: D,
|
|
594
594
|
type: "button",
|
|
595
595
|
children: /* @__PURE__ */ s(g, { "aria-hidden": "true" })
|
|
596
596
|
}),
|
|
@@ -730,33 +730,33 @@ var mt = 1e3, ht = 600, gt = 30, _t = 240, vt = 12, yt = lt[0].value, X = "#0a8f
|
|
|
730
730
|
"compass"
|
|
731
731
|
];
|
|
732
732
|
function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWidth: r = mt, className: o = "", colorOptions: l = lt, defaultColor: u, disabled: d = !1, minStageWidth: f = _t, onChange: p, paper: m = "squared", points: h = [], showColorPalette: g = !0, value: _, variant: v = "question" }) {
|
|
733
|
-
let y = l.length > 0 ? l : lt, [b, x] = a(null), [S, C] = a([]), [w, T] = a(() => dt(y, u ?? "black")), [E,
|
|
733
|
+
let y = l.length > 0 ? l : lt, [b, x] = a(null), [S, C] = a([]), [w, T] = a(() => dt(y, u ?? "black")), [E, D] = a(() => Pt(_)), [O, ee] = a(() => _?.guides ?? Nt(r, n)), [k, A] = a(null), [j, M] = a(null), [N, te] = a({
|
|
734
734
|
height: n,
|
|
735
735
|
scale: 1,
|
|
736
736
|
width: r
|
|
737
|
-
}), [
|
|
737
|
+
}), [P, F] = a({
|
|
738
738
|
canRedo: !1,
|
|
739
739
|
canUndo: !1
|
|
740
|
-
}),
|
|
741
|
-
Tt(
|
|
742
|
-
let
|
|
740
|
+
}), I = i(null), L = i([It(E)]), R = i(0), z = i(0), B = i(null);
|
|
741
|
+
Tt(I, r, n, f, te);
|
|
742
|
+
let re = Lt(h, r, n), ae = [
|
|
743
743
|
"geometry-canvas",
|
|
744
744
|
`geometry-canvas--${v}`,
|
|
745
745
|
o
|
|
746
|
-
].filter(Boolean).join(" "),
|
|
747
|
-
function
|
|
748
|
-
return xt.has(e) ? !
|
|
746
|
+
].filter(Boolean).join(" "), H = y.some((e) => e.id === w) ? w : dt(y, "black"), oe = ft(y, H), se = bt.concat(St).filter((e) => (t ?? Ct).includes(e.id)), U = Bt(b);
|
|
747
|
+
function ce(e) {
|
|
748
|
+
return xt.has(e) ? !U && S.includes(e) : b === e || S.includes(e);
|
|
749
749
|
}
|
|
750
|
-
function
|
|
750
|
+
function le(e) {
|
|
751
751
|
C((t) => t.includes(e) ? t.filter((t) => t !== e) : t.concat(e));
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function ue(e) {
|
|
754
754
|
if (e === "ruler" || e === "protractor") {
|
|
755
|
-
if (
|
|
755
|
+
if (U) {
|
|
756
756
|
x(null), C((t) => t.includes(e) ? t : t.concat(e));
|
|
757
757
|
return;
|
|
758
758
|
}
|
|
759
|
-
|
|
759
|
+
le(e);
|
|
760
760
|
return;
|
|
761
761
|
}
|
|
762
762
|
if (e === "compass") {
|
|
@@ -769,10 +769,10 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
769
769
|
}
|
|
770
770
|
x(e);
|
|
771
771
|
}
|
|
772
|
-
function
|
|
773
|
-
return
|
|
772
|
+
function W(e) {
|
|
773
|
+
return z.current += 1, `${e}-${Date.now()}-${z.current}`;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function de(e, t = O) {
|
|
776
776
|
p({
|
|
777
777
|
elements: It(e),
|
|
778
778
|
guides: t,
|
|
@@ -780,53 +780,53 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
780
780
|
strokes: Ft(e)
|
|
781
781
|
});
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
|
|
785
|
-
canRedo:
|
|
786
|
-
canUndo:
|
|
783
|
+
function G() {
|
|
784
|
+
F({
|
|
785
|
+
canRedo: R.current < L.current.length - 1,
|
|
786
|
+
canUndo: R.current > 0
|
|
787
787
|
});
|
|
788
788
|
}
|
|
789
|
-
function
|
|
790
|
-
let n = It(e), r =
|
|
791
|
-
r.push(n),
|
|
789
|
+
function K(e, t = O) {
|
|
790
|
+
let n = It(e), r = L.current.slice(0, R.current + 1);
|
|
791
|
+
r.push(n), L.current = r, R.current = r.length - 1, D(n), de(n, t), G();
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
|
|
793
|
+
function fe(e) {
|
|
794
|
+
ee(e), de(E, e);
|
|
795
795
|
}
|
|
796
|
-
function
|
|
797
|
-
if (!
|
|
798
|
-
--
|
|
799
|
-
let e = It(
|
|
800
|
-
|
|
796
|
+
function pe() {
|
|
797
|
+
if (!P.canUndo || d) return;
|
|
798
|
+
--R.current;
|
|
799
|
+
let e = It(L.current[R.current]);
|
|
800
|
+
D(e), de(e), G();
|
|
801
801
|
}
|
|
802
|
-
function
|
|
803
|
-
if (!
|
|
804
|
-
|
|
805
|
-
let e = It(
|
|
806
|
-
|
|
802
|
+
function me() {
|
|
803
|
+
if (!P.canRedo || d) return;
|
|
804
|
+
R.current += 1;
|
|
805
|
+
let e = It(L.current[R.current]);
|
|
806
|
+
D(e), de(e), G();
|
|
807
807
|
}
|
|
808
|
-
function
|
|
809
|
-
d || E.length === 0 ||
|
|
808
|
+
function q() {
|
|
809
|
+
d || E.length === 0 || K([]);
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function he(e) {
|
|
812
812
|
let t = e.target.getStage()?.getPointerPosition();
|
|
813
813
|
return t ? {
|
|
814
|
-
x: Zt(t.x /
|
|
815
|
-
y: Zt(t.y /
|
|
814
|
+
x: Zt(t.x / N.scale, 0, r),
|
|
815
|
+
y: Zt(t.y / N.scale, 0, n)
|
|
816
816
|
} : null;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
if (d || !
|
|
820
|
-
let t =
|
|
818
|
+
function ge(e) {
|
|
819
|
+
if (d || !U && zt(e.target)) return;
|
|
820
|
+
let t = he(e);
|
|
821
821
|
if (!t || !b) return;
|
|
822
822
|
if (b === "eraser") {
|
|
823
|
-
|
|
823
|
+
ye(t);
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
|
-
let n = Rt(t,
|
|
826
|
+
let n = Rt(t, re);
|
|
827
827
|
if (b === "text") {
|
|
828
|
-
|
|
829
|
-
color:
|
|
828
|
+
M({
|
|
829
|
+
color: oe,
|
|
830
830
|
text: "",
|
|
831
831
|
x: n.x,
|
|
832
832
|
y: n.y
|
|
@@ -834,9 +834,9 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
836
|
if (b === "pen") {
|
|
837
|
-
|
|
838
|
-
color:
|
|
839
|
-
id:
|
|
837
|
+
B.current = n, A({
|
|
838
|
+
color: oe,
|
|
839
|
+
id: W("freehand"),
|
|
840
840
|
points: [n.x, n.y],
|
|
841
841
|
strokeWidth: 4,
|
|
842
842
|
type: "freehand"
|
|
@@ -844,9 +844,9 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
844
844
|
return;
|
|
845
845
|
}
|
|
846
846
|
if (b === "line") {
|
|
847
|
-
|
|
848
|
-
color:
|
|
849
|
-
id:
|
|
847
|
+
B.current = n, A({
|
|
848
|
+
color: oe,
|
|
849
|
+
id: W("line"),
|
|
850
850
|
points: [
|
|
851
851
|
n.x,
|
|
852
852
|
n.y,
|
|
@@ -858,109 +858,109 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
858
858
|
});
|
|
859
859
|
return;
|
|
860
860
|
}
|
|
861
|
-
b === "compass" && (
|
|
861
|
+
b === "compass" && (B.current = n, A({
|
|
862
862
|
center: n,
|
|
863
|
-
color:
|
|
864
|
-
id:
|
|
863
|
+
color: oe,
|
|
864
|
+
id: W("circle"),
|
|
865
865
|
radius: 1,
|
|
866
866
|
strokeWidth: 3,
|
|
867
867
|
type: "circle"
|
|
868
868
|
}));
|
|
869
869
|
}
|
|
870
|
-
function
|
|
871
|
-
let t =
|
|
870
|
+
function _e(e) {
|
|
871
|
+
let t = he(e);
|
|
872
872
|
if (t) {
|
|
873
873
|
if (b === "eraser" && !d) {
|
|
874
|
-
|
|
874
|
+
ye(t);
|
|
875
875
|
return;
|
|
876
876
|
}
|
|
877
|
-
if (!(!
|
|
878
|
-
if (
|
|
879
|
-
|
|
880
|
-
...
|
|
881
|
-
points:
|
|
877
|
+
if (!(!k || !B.current || d)) {
|
|
878
|
+
if (k.type === "freehand") {
|
|
879
|
+
A({
|
|
880
|
+
...k,
|
|
881
|
+
points: k.points.concat([t.x, t.y])
|
|
882
882
|
});
|
|
883
883
|
return;
|
|
884
884
|
}
|
|
885
|
-
if (
|
|
886
|
-
let e = Rt(t,
|
|
887
|
-
|
|
888
|
-
...
|
|
885
|
+
if (k.type === "line") {
|
|
886
|
+
let e = Rt(t, re);
|
|
887
|
+
A({
|
|
888
|
+
...k,
|
|
889
889
|
points: [
|
|
890
|
-
|
|
891
|
-
|
|
890
|
+
B.current.x,
|
|
891
|
+
B.current.y,
|
|
892
892
|
e.x,
|
|
893
893
|
e.y
|
|
894
894
|
]
|
|
895
895
|
});
|
|
896
896
|
return;
|
|
897
897
|
}
|
|
898
|
-
|
|
899
|
-
...
|
|
900
|
-
radius: Xt(
|
|
898
|
+
k.type === "circle" && A({
|
|
899
|
+
...k,
|
|
900
|
+
radius: Xt(k.center, t)
|
|
901
901
|
});
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
|
-
function
|
|
906
|
-
if (!
|
|
907
|
-
|
|
905
|
+
function ve() {
|
|
906
|
+
if (!k || d) {
|
|
907
|
+
B.current = null, A(null);
|
|
908
908
|
return;
|
|
909
909
|
}
|
|
910
|
-
let e =
|
|
911
|
-
if (
|
|
910
|
+
let e = k;
|
|
911
|
+
if (B.current = null, A(null), Ht(e)) {
|
|
912
912
|
if (e.type === "circle") {
|
|
913
913
|
let t = {
|
|
914
|
-
...
|
|
914
|
+
...O,
|
|
915
915
|
compass: {
|
|
916
916
|
center: e.center,
|
|
917
917
|
radius: e.radius
|
|
918
918
|
}
|
|
919
919
|
};
|
|
920
|
-
|
|
920
|
+
ee(t), K(E.concat(e), t);
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
|
-
|
|
923
|
+
K(E.concat(e));
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
|
-
function
|
|
926
|
+
function ye(e) {
|
|
927
927
|
if (E.length === 0) return;
|
|
928
928
|
let t = Ut(E, e);
|
|
929
|
-
t < 0 ||
|
|
929
|
+
t < 0 || K(E.filter((e, n) => n !== t));
|
|
930
930
|
}
|
|
931
|
-
function
|
|
932
|
-
if (!
|
|
933
|
-
|
|
931
|
+
function be() {
|
|
932
|
+
if (!j || d) {
|
|
933
|
+
M(null);
|
|
934
934
|
return;
|
|
935
935
|
}
|
|
936
|
-
let e =
|
|
937
|
-
|
|
938
|
-
color:
|
|
936
|
+
let e = j.text.trim();
|
|
937
|
+
M(null), e && K(E.concat({
|
|
938
|
+
color: j.color,
|
|
939
939
|
fontSize: 28,
|
|
940
|
-
id:
|
|
940
|
+
id: W("text"),
|
|
941
941
|
text: e,
|
|
942
942
|
type: "text",
|
|
943
|
-
x:
|
|
944
|
-
y:
|
|
943
|
+
x: j.x,
|
|
944
|
+
y: j.y
|
|
945
945
|
}));
|
|
946
946
|
}
|
|
947
947
|
return /* @__PURE__ */ c("div", {
|
|
948
|
-
className:
|
|
948
|
+
className: ae,
|
|
949
949
|
"data-disabled": d ? "true" : "false",
|
|
950
950
|
dir: "rtl",
|
|
951
951
|
children: [
|
|
952
952
|
/* @__PURE__ */ s("div", {
|
|
953
953
|
className: "geometry-toolbar",
|
|
954
954
|
"aria-label": "أَدَواتُ الوَرَقَةِ المُسَوَّدَةِ",
|
|
955
|
-
children:
|
|
956
|
-
"aria-pressed":
|
|
955
|
+
children: se.map((e) => /* @__PURE__ */ c("button", {
|
|
956
|
+
"aria-pressed": ce(e.id),
|
|
957
957
|
className: [
|
|
958
958
|
"geometry-tool-button",
|
|
959
|
-
|
|
959
|
+
ce(e.id) ? "geometry-tool-button--active" : "",
|
|
960
960
|
xt.has(e.id) ? "geometry-tool-button--guide" : ""
|
|
961
961
|
].filter(Boolean).join(" "),
|
|
962
962
|
disabled: d,
|
|
963
|
-
onClick: () =>
|
|
963
|
+
onClick: () => ue(e.id),
|
|
964
964
|
type: "button",
|
|
965
965
|
children: [/* @__PURE__ */ s("span", {
|
|
966
966
|
"aria-hidden": "true",
|
|
@@ -974,26 +974,26 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
974
974
|
colors: y,
|
|
975
975
|
disabled: d,
|
|
976
976
|
onChange: T,
|
|
977
|
-
selectedColorId:
|
|
977
|
+
selectedColorId: H
|
|
978
978
|
}) : null,
|
|
979
979
|
/* @__PURE__ */ c("div", {
|
|
980
980
|
className: "geometry-stage-shell",
|
|
981
|
-
ref:
|
|
982
|
-
children: [/* @__PURE__ */ s(
|
|
983
|
-
height:
|
|
984
|
-
onMouseDown:
|
|
985
|
-
onMouseLeave:
|
|
986
|
-
onMouseMove:
|
|
987
|
-
onMouseUp:
|
|
988
|
-
onTouchEnd:
|
|
989
|
-
onTouchMove:
|
|
990
|
-
onTouchStart:
|
|
991
|
-
width:
|
|
992
|
-
children: /* @__PURE__ */ c(
|
|
993
|
-
scaleX:
|
|
994
|
-
scaleY:
|
|
981
|
+
ref: I,
|
|
982
|
+
children: [/* @__PURE__ */ s(ie, {
|
|
983
|
+
height: N.height,
|
|
984
|
+
onMouseDown: ge,
|
|
985
|
+
onMouseLeave: ve,
|
|
986
|
+
onMouseMove: _e,
|
|
987
|
+
onMouseUp: ve,
|
|
988
|
+
onTouchEnd: ve,
|
|
989
|
+
onTouchMove: _e,
|
|
990
|
+
onTouchStart: ge,
|
|
991
|
+
width: N.width,
|
|
992
|
+
children: /* @__PURE__ */ c(ne, {
|
|
993
|
+
scaleX: N.scale,
|
|
994
|
+
scaleY: N.scale,
|
|
995
995
|
children: [
|
|
996
|
-
/* @__PURE__ */ s(
|
|
996
|
+
/* @__PURE__ */ s(V, {
|
|
997
997
|
fill: "#fff",
|
|
998
998
|
height: n,
|
|
999
999
|
stroke: "#bad3c8",
|
|
@@ -1011,56 +1011,56 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
1011
1011
|
y: e.y / 100 * n
|
|
1012
1012
|
}, e.id)),
|
|
1013
1013
|
E.map((e) => Mt(e)),
|
|
1014
|
-
|
|
1014
|
+
k ? Mt(k, !0) : null,
|
|
1015
1015
|
S.includes("ruler") ? /* @__PURE__ */ s(kt, {
|
|
1016
1016
|
disabled: d,
|
|
1017
|
-
guide:
|
|
1018
|
-
locked:
|
|
1019
|
-
onCommit: (e) =>
|
|
1020
|
-
...
|
|
1017
|
+
guide: O.ruler,
|
|
1018
|
+
locked: U,
|
|
1019
|
+
onCommit: (e) => fe({
|
|
1020
|
+
...O,
|
|
1021
1021
|
ruler: e
|
|
1022
1022
|
})
|
|
1023
|
-
}, `${
|
|
1023
|
+
}, `${O.ruler.x}:${O.ruler.y}:${O.ruler.length}:${O.ruler.rotation}`) : null,
|
|
1024
1024
|
S.includes("protractor") ? /* @__PURE__ */ s(At, {
|
|
1025
1025
|
disabled: d,
|
|
1026
|
-
guide:
|
|
1027
|
-
locked:
|
|
1028
|
-
onChange: (e) =>
|
|
1029
|
-
...
|
|
1026
|
+
guide: O.protractor,
|
|
1027
|
+
locked: U,
|
|
1028
|
+
onChange: (e) => fe({
|
|
1029
|
+
...O,
|
|
1030
1030
|
protractor: e
|
|
1031
1031
|
})
|
|
1032
1032
|
}) : null,
|
|
1033
1033
|
S.includes("compass") ? /* @__PURE__ */ s(jt, {
|
|
1034
1034
|
disabled: d,
|
|
1035
|
-
guide:
|
|
1036
|
-
locked:
|
|
1037
|
-
onChange: (e) =>
|
|
1038
|
-
...
|
|
1035
|
+
guide: O.compass,
|
|
1036
|
+
locked: U,
|
|
1037
|
+
onChange: (e) => fe({
|
|
1038
|
+
...O,
|
|
1039
1039
|
compass: e
|
|
1040
1040
|
})
|
|
1041
1041
|
}) : null
|
|
1042
1042
|
]
|
|
1043
1043
|
})
|
|
1044
|
-
}),
|
|
1044
|
+
}), j ? /* @__PURE__ */ s("textarea", {
|
|
1045
1045
|
autoFocus: !0,
|
|
1046
1046
|
className: "geometry-text-editor",
|
|
1047
1047
|
dir: "auto",
|
|
1048
|
-
onBlur:
|
|
1049
|
-
onChange: (e) =>
|
|
1048
|
+
onBlur: be,
|
|
1049
|
+
onChange: (e) => M((t) => t && {
|
|
1050
1050
|
...t,
|
|
1051
1051
|
text: e.target.value
|
|
1052
1052
|
}),
|
|
1053
1053
|
onKeyDown: (e) => {
|
|
1054
|
-
(e.ctrlKey || e.metaKey) && e.key === "Enter" && (e.preventDefault(),
|
|
1054
|
+
(e.ctrlKey || e.metaKey) && e.key === "Enter" && (e.preventDefault(), be());
|
|
1055
1055
|
},
|
|
1056
1056
|
placeholder: "Write here",
|
|
1057
1057
|
rows: 3,
|
|
1058
1058
|
style: {
|
|
1059
|
-
left: `${
|
|
1060
|
-
top: `${
|
|
1061
|
-
width: `${Math.max(140, Math.min(320,
|
|
1059
|
+
left: `${j.x * N.scale}px`,
|
|
1060
|
+
top: `${j.y * N.scale}px`,
|
|
1061
|
+
width: `${Math.max(140, Math.min(320, N.width - j.x * N.scale - 12))}px`
|
|
1062
1062
|
},
|
|
1063
|
-
value:
|
|
1063
|
+
value: j.text
|
|
1064
1064
|
}) : null]
|
|
1065
1065
|
}),
|
|
1066
1066
|
/* @__PURE__ */ c("div", {
|
|
@@ -1068,20 +1068,20 @@ function wt({ actionLabel: e, availableTools: t, canvasHeight: n = ht, canvasWid
|
|
|
1068
1068
|
children: [
|
|
1069
1069
|
e ? /* @__PURE__ */ s("span", { children: e }) : null,
|
|
1070
1070
|
/* @__PURE__ */ s("button", {
|
|
1071
|
-
disabled: !
|
|
1072
|
-
onClick:
|
|
1071
|
+
disabled: !P.canUndo || d,
|
|
1072
|
+
onClick: pe,
|
|
1073
1073
|
type: "button",
|
|
1074
1074
|
children: "تَراجُعٌ"
|
|
1075
1075
|
}),
|
|
1076
1076
|
/* @__PURE__ */ s("button", {
|
|
1077
|
-
disabled: !
|
|
1078
|
-
onClick:
|
|
1077
|
+
disabled: !P.canRedo || d,
|
|
1078
|
+
onClick: me,
|
|
1079
1079
|
type: "button",
|
|
1080
1080
|
children: "إِعادَةٌ"
|
|
1081
1081
|
}),
|
|
1082
1082
|
/* @__PURE__ */ s("button", {
|
|
1083
1083
|
disabled: E.length === 0 || d,
|
|
1084
|
-
onClick:
|
|
1084
|
+
onClick: q,
|
|
1085
1085
|
type: "button",
|
|
1086
1086
|
children: "مَسْحٌ"
|
|
1087
1087
|
})
|
|
@@ -1120,7 +1120,7 @@ function Et({ canvasHeight: e, canvasWidth: t, paper: n }) {
|
|
|
1120
1120
|
if (n === "blank") return null;
|
|
1121
1121
|
if (n === "ruled") {
|
|
1122
1122
|
let n = Math.floor(e / 46);
|
|
1123
|
-
return /* @__PURE__ */ s(o, { children: Array.from({ length: n }, (e, n) => /* @__PURE__ */ s(
|
|
1123
|
+
return /* @__PURE__ */ s(o, { children: Array.from({ length: n }, (e, n) => /* @__PURE__ */ s(B, {
|
|
1124
1124
|
points: [
|
|
1125
1125
|
0,
|
|
1126
1126
|
38 + n * 46,
|
|
@@ -1132,7 +1132,7 @@ function Et({ canvasHeight: e, canvasWidth: t, paper: n }) {
|
|
|
1132
1132
|
}, `ruled-${n}`)) });
|
|
1133
1133
|
}
|
|
1134
1134
|
let r = Math.floor(t / gt), i = Math.floor(e / gt);
|
|
1135
|
-
return /* @__PURE__ */ c(o, { children: [Array.from({ length: r + 1 }, (t, n) => /* @__PURE__ */ s(
|
|
1135
|
+
return /* @__PURE__ */ c(o, { children: [Array.from({ length: r + 1 }, (t, n) => /* @__PURE__ */ s(B, {
|
|
1136
1136
|
points: [
|
|
1137
1137
|
n * gt,
|
|
1138
1138
|
0,
|
|
@@ -1141,7 +1141,7 @@ function Et({ canvasHeight: e, canvasWidth: t, paper: n }) {
|
|
|
1141
1141
|
],
|
|
1142
1142
|
stroke: "#d2ded8",
|
|
1143
1143
|
strokeWidth: 1
|
|
1144
|
-
}, `vertical-${n}`)), Array.from({ length: i + 1 }, (e, n) => /* @__PURE__ */ s(
|
|
1144
|
+
}, `vertical-${n}`)), Array.from({ length: i + 1 }, (e, n) => /* @__PURE__ */ s(B, {
|
|
1145
1145
|
points: [
|
|
1146
1146
|
0,
|
|
1147
1147
|
n * gt,
|
|
@@ -1153,7 +1153,7 @@ function Et({ canvasHeight: e, canvasWidth: t, paper: n }) {
|
|
|
1153
1153
|
}, `horizontal-${n}`))] });
|
|
1154
1154
|
}
|
|
1155
1155
|
function Dt({ label: e, x: t, y: n }) {
|
|
1156
|
-
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(
|
|
1156
|
+
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(I, {
|
|
1157
1157
|
fill: "#e63542",
|
|
1158
1158
|
radius: 4.75,
|
|
1159
1159
|
shadowBlur: 5,
|
|
@@ -1162,7 +1162,7 @@ function Dt({ label: e, x: t, y: n }) {
|
|
|
1162
1162
|
strokeWidth: 1.7,
|
|
1163
1163
|
x: t,
|
|
1164
1164
|
y: n
|
|
1165
|
-
}), /* @__PURE__ */ s(
|
|
1165
|
+
}), /* @__PURE__ */ s(H, {
|
|
1166
1166
|
fill: "#111",
|
|
1167
1167
|
fontSize: 14,
|
|
1168
1168
|
fontStyle: "bold",
|
|
@@ -1213,7 +1213,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1213
1213
|
};
|
|
1214
1214
|
v(e), r(e);
|
|
1215
1215
|
}
|
|
1216
|
-
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c(
|
|
1216
|
+
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c(R, {
|
|
1217
1217
|
listening: _,
|
|
1218
1218
|
name: "geometry-guide",
|
|
1219
1219
|
onDblClick: S,
|
|
@@ -1222,7 +1222,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1222
1222
|
x: l.x,
|
|
1223
1223
|
y: l.y,
|
|
1224
1224
|
children: [
|
|
1225
|
-
/* @__PURE__ */ s(
|
|
1225
|
+
/* @__PURE__ */ s(V, {
|
|
1226
1226
|
cornerRadius: 7,
|
|
1227
1227
|
fill: "rgba(14, 173, 100, 0.13)",
|
|
1228
1228
|
height: 38,
|
|
@@ -1233,7 +1233,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1233
1233
|
strokeWidth: 2,
|
|
1234
1234
|
width: l.length
|
|
1235
1235
|
}),
|
|
1236
|
-
/* @__PURE__ */ s(
|
|
1236
|
+
/* @__PURE__ */ s(B, {
|
|
1237
1237
|
points: [
|
|
1238
1238
|
-l.length / 2 + 12,
|
|
1239
1239
|
0,
|
|
@@ -1246,7 +1246,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1246
1246
|
}),
|
|
1247
1247
|
Array.from({ length: Math.floor(l.length / 20) + 1 }, (e, t) => {
|
|
1248
1248
|
let n = -l.length / 2 + t * 20, r = t % 5 == 0;
|
|
1249
|
-
return /* @__PURE__ */ s(
|
|
1249
|
+
return /* @__PURE__ */ s(B, {
|
|
1250
1250
|
listening: !1,
|
|
1251
1251
|
points: [
|
|
1252
1252
|
n,
|
|
@@ -1258,7 +1258,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1258
1258
|
strokeWidth: r ? 1.5 : 1
|
|
1259
1259
|
}, t);
|
|
1260
1260
|
}),
|
|
1261
|
-
/* @__PURE__ */ s(
|
|
1261
|
+
/* @__PURE__ */ s(B, {
|
|
1262
1262
|
dash: [7, 7],
|
|
1263
1263
|
listening: !1,
|
|
1264
1264
|
opacity: .72,
|
|
@@ -1271,7 +1271,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1271
1271
|
stroke: X,
|
|
1272
1272
|
strokeWidth: 2
|
|
1273
1273
|
}),
|
|
1274
|
-
/* @__PURE__ */ s(
|
|
1274
|
+
/* @__PURE__ */ s(B, {
|
|
1275
1275
|
dash: [7, 7],
|
|
1276
1276
|
listening: !1,
|
|
1277
1277
|
opacity: .72,
|
|
@@ -1284,14 +1284,14 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1284
1284
|
stroke: X,
|
|
1285
1285
|
strokeWidth: 2
|
|
1286
1286
|
}),
|
|
1287
|
-
/* @__PURE__ */ s(
|
|
1287
|
+
/* @__PURE__ */ s(R, {
|
|
1288
1288
|
draggable: _,
|
|
1289
1289
|
name: "geometry-guide",
|
|
1290
1290
|
onDblClick: S,
|
|
1291
1291
|
onDblTap: S,
|
|
1292
1292
|
onDragEnd: b,
|
|
1293
1293
|
onDragMove: (e) => x(e, "right"),
|
|
1294
|
-
children: /* @__PURE__ */ s(
|
|
1294
|
+
children: /* @__PURE__ */ s(V, {
|
|
1295
1295
|
fill: "rgba(255, 255, 255, 0.01)",
|
|
1296
1296
|
height: 106,
|
|
1297
1297
|
offsetY: 53,
|
|
@@ -1299,14 +1299,14 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1299
1299
|
x: 0
|
|
1300
1300
|
})
|
|
1301
1301
|
}),
|
|
1302
|
-
/* @__PURE__ */ s(
|
|
1302
|
+
/* @__PURE__ */ s(R, {
|
|
1303
1303
|
draggable: _,
|
|
1304
1304
|
name: "geometry-guide",
|
|
1305
1305
|
onDblClick: S,
|
|
1306
1306
|
onDblTap: S,
|
|
1307
1307
|
onDragEnd: b,
|
|
1308
1308
|
onDragMove: (e) => x(e, "left"),
|
|
1309
|
-
children: /* @__PURE__ */ s(
|
|
1309
|
+
children: /* @__PURE__ */ s(V, {
|
|
1310
1310
|
fill: "rgba(255, 255, 255, 0.01)",
|
|
1311
1311
|
height: 106,
|
|
1312
1312
|
offsetY: 53,
|
|
@@ -1314,7 +1314,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1314
1314
|
x: m - 24
|
|
1315
1315
|
})
|
|
1316
1316
|
}),
|
|
1317
|
-
/* @__PURE__ */ s(
|
|
1317
|
+
/* @__PURE__ */ s(I, {
|
|
1318
1318
|
fill: "#f7fffb",
|
|
1319
1319
|
listening: !1,
|
|
1320
1320
|
radius: 16,
|
|
@@ -1325,7 +1325,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1325
1325
|
x: p,
|
|
1326
1326
|
y: 0
|
|
1327
1327
|
}),
|
|
1328
|
-
/* @__PURE__ */ s(
|
|
1328
|
+
/* @__PURE__ */ s(I, {
|
|
1329
1329
|
fill: "#f7fffb",
|
|
1330
1330
|
listening: !1,
|
|
1331
1331
|
radius: 16,
|
|
@@ -1336,12 +1336,12 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1336
1336
|
x: m,
|
|
1337
1337
|
y: 0
|
|
1338
1338
|
}),
|
|
1339
|
-
/* @__PURE__ */ c(
|
|
1339
|
+
/* @__PURE__ */ c(R, {
|
|
1340
1340
|
draggable: _,
|
|
1341
1341
|
name: "geometry-guide",
|
|
1342
1342
|
onDragEnd: b,
|
|
1343
1343
|
onDragMove: y,
|
|
1344
|
-
children: [/* @__PURE__ */ s(
|
|
1344
|
+
children: [/* @__PURE__ */ s(V, {
|
|
1345
1345
|
cornerRadius: 13,
|
|
1346
1346
|
fill: "#ffffff",
|
|
1347
1347
|
height: 26,
|
|
@@ -1356,7 +1356,7 @@ function kt({ disabled: e, guide: t, locked: n, onCommit: r }) {
|
|
|
1356
1356
|
-14,
|
|
1357
1357
|
0,
|
|
1358
1358
|
14
|
|
1359
|
-
].map((e) => /* @__PURE__ */ s(
|
|
1359
|
+
].map((e) => /* @__PURE__ */ s(B, {
|
|
1360
1360
|
lineCap: "round",
|
|
1361
1361
|
points: [
|
|
1362
1362
|
e,
|
|
@@ -1379,7 +1379,7 @@ function At({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1379
1379
|
x: t.x,
|
|
1380
1380
|
y: t.y
|
|
1381
1381
|
});
|
|
1382
|
-
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c(
|
|
1382
|
+
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c(R, {
|
|
1383
1383
|
draggable: i,
|
|
1384
1384
|
listening: i,
|
|
1385
1385
|
name: "geometry-guide",
|
|
@@ -1392,7 +1392,7 @@ function At({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1392
1392
|
x: t.x,
|
|
1393
1393
|
y: t.y,
|
|
1394
1394
|
children: [
|
|
1395
|
-
/* @__PURE__ */ s(
|
|
1395
|
+
/* @__PURE__ */ s(F, {
|
|
1396
1396
|
angle: 180,
|
|
1397
1397
|
fill: "rgba(14, 173, 100, 0.11)",
|
|
1398
1398
|
innerRadius: 0,
|
|
@@ -1401,7 +1401,7 @@ function At({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1401
1401
|
stroke: X,
|
|
1402
1402
|
strokeWidth: 2
|
|
1403
1403
|
}),
|
|
1404
|
-
/* @__PURE__ */ s(
|
|
1404
|
+
/* @__PURE__ */ s(B, {
|
|
1405
1405
|
points: [
|
|
1406
1406
|
-110,
|
|
1407
1407
|
0,
|
|
@@ -1419,7 +1419,7 @@ function At({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1419
1419
|
x: Math.cos(r) * (t % 3 == 0 ? 92 : 100),
|
|
1420
1420
|
y: -Math.sin(r) * (t % 3 == 0 ? 92 : 100)
|
|
1421
1421
|
};
|
|
1422
|
-
return /* @__PURE__ */ s(
|
|
1422
|
+
return /* @__PURE__ */ s(B, {
|
|
1423
1423
|
points: [
|
|
1424
1424
|
a.x,
|
|
1425
1425
|
a.y,
|
|
@@ -1436,7 +1436,7 @@ function At({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1436
1436
|
180
|
|
1437
1437
|
].map((e) => {
|
|
1438
1438
|
let t = (180 - e) * Math.PI / 180;
|
|
1439
|
-
return /* @__PURE__ */ s(
|
|
1439
|
+
return /* @__PURE__ */ s(H, {
|
|
1440
1440
|
fill: X,
|
|
1441
1441
|
fontSize: 12,
|
|
1442
1442
|
fontStyle: "bold",
|
|
@@ -1446,7 +1446,7 @@ function At({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1446
1446
|
}, e);
|
|
1447
1447
|
})
|
|
1448
1448
|
]
|
|
1449
|
-
}), /* @__PURE__ */ s(
|
|
1449
|
+
}), /* @__PURE__ */ s(I, {
|
|
1450
1450
|
draggable: i,
|
|
1451
1451
|
fill: "#fff",
|
|
1452
1452
|
listening: i,
|
|
@@ -1474,7 +1474,7 @@ function jt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1474
1474
|
y: t.center.y - Math.min(90, Math.max(34, t.radius * .68))
|
|
1475
1475
|
};
|
|
1476
1476
|
return /* @__PURE__ */ c(o, { children: [
|
|
1477
|
-
/* @__PURE__ */ s(
|
|
1477
|
+
/* @__PURE__ */ s(I, {
|
|
1478
1478
|
dash: [8, 8],
|
|
1479
1479
|
radius: t.radius,
|
|
1480
1480
|
stroke: X,
|
|
@@ -1482,7 +1482,7 @@ function jt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1482
1482
|
x: t.center.x,
|
|
1483
1483
|
y: t.center.y
|
|
1484
1484
|
}),
|
|
1485
|
-
/* @__PURE__ */ s(
|
|
1485
|
+
/* @__PURE__ */ s(B, {
|
|
1486
1486
|
dash: [8, 8],
|
|
1487
1487
|
points: [
|
|
1488
1488
|
t.center.x,
|
|
@@ -1493,7 +1493,7 @@ function jt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1493
1493
|
stroke: X,
|
|
1494
1494
|
strokeWidth: 2
|
|
1495
1495
|
}),
|
|
1496
|
-
/* @__PURE__ */ s(
|
|
1496
|
+
/* @__PURE__ */ s(B, {
|
|
1497
1497
|
lineCap: "round",
|
|
1498
1498
|
lineJoin: "round",
|
|
1499
1499
|
points: [
|
|
@@ -1507,7 +1507,7 @@ function jt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1507
1507
|
stroke: X,
|
|
1508
1508
|
strokeWidth: 4
|
|
1509
1509
|
}),
|
|
1510
|
-
/* @__PURE__ */ s(
|
|
1510
|
+
/* @__PURE__ */ s(I, {
|
|
1511
1511
|
fill: "#fff",
|
|
1512
1512
|
radius: 8,
|
|
1513
1513
|
stroke: X,
|
|
@@ -1515,7 +1515,7 @@ function jt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1515
1515
|
x: l.x,
|
|
1516
1516
|
y: l.y
|
|
1517
1517
|
}),
|
|
1518
|
-
/* @__PURE__ */ s(
|
|
1518
|
+
/* @__PURE__ */ s(I, {
|
|
1519
1519
|
draggable: i,
|
|
1520
1520
|
fill: "#fff",
|
|
1521
1521
|
listening: i,
|
|
@@ -1530,7 +1530,7 @@ function jt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1530
1530
|
x: t.center.x,
|
|
1531
1531
|
y: t.center.y
|
|
1532
1532
|
}),
|
|
1533
|
-
/* @__PURE__ */ s(
|
|
1533
|
+
/* @__PURE__ */ s(I, {
|
|
1534
1534
|
draggable: i,
|
|
1535
1535
|
fill: "#fff",
|
|
1536
1536
|
listening: i,
|
|
@@ -1552,7 +1552,7 @@ function jt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1552
1552
|
}
|
|
1553
1553
|
function Mt(e, t = !1) {
|
|
1554
1554
|
let n = t ? .58 : 1;
|
|
1555
|
-
return e.type === "freehand" ? /* @__PURE__ */ s(
|
|
1555
|
+
return e.type === "freehand" ? /* @__PURE__ */ s(B, {
|
|
1556
1556
|
lineCap: "round",
|
|
1557
1557
|
lineJoin: "round",
|
|
1558
1558
|
opacity: n,
|
|
@@ -1560,13 +1560,13 @@ function Mt(e, t = !1) {
|
|
|
1560
1560
|
stroke: e.color,
|
|
1561
1561
|
strokeWidth: e.strokeWidth,
|
|
1562
1562
|
tension: .45
|
|
1563
|
-
}, e.id) : e.type === "line" ? /* @__PURE__ */ s(
|
|
1563
|
+
}, e.id) : e.type === "line" ? /* @__PURE__ */ s(B, {
|
|
1564
1564
|
lineCap: "round",
|
|
1565
1565
|
opacity: n,
|
|
1566
1566
|
points: e.points,
|
|
1567
1567
|
stroke: e.color,
|
|
1568
1568
|
strokeWidth: e.strokeWidth
|
|
1569
|
-
}, e.id) : e.type === "text" ? /* @__PURE__ */ s(
|
|
1569
|
+
}, e.id) : e.type === "text" ? /* @__PURE__ */ s(H, {
|
|
1570
1570
|
fill: e.color,
|
|
1571
1571
|
fontFamily: "Arial, sans-serif",
|
|
1572
1572
|
fontSize: e.fontSize,
|
|
@@ -1575,7 +1575,7 @@ function Mt(e, t = !1) {
|
|
|
1575
1575
|
width: 280,
|
|
1576
1576
|
x: e.x,
|
|
1577
1577
|
y: e.y
|
|
1578
|
-
}, e.id) : /* @__PURE__ */ s(
|
|
1578
|
+
}, e.id) : /* @__PURE__ */ s(I, {
|
|
1579
1579
|
opacity: n,
|
|
1580
1580
|
radius: e.radius,
|
|
1581
1581
|
stroke: e.color,
|
|
@@ -1834,7 +1834,7 @@ function rn({ answerId: e, expression: t, value: n, onChange: r, onClear: i, rec
|
|
|
1834
1834
|
className: "number-line-layout",
|
|
1835
1835
|
children: [/* @__PURE__ */ s(an, {}), /* @__PURE__ */ c("div", {
|
|
1836
1836
|
className: "compact-answer",
|
|
1837
|
-
children: [/* @__PURE__ */ s("span", { children: t }), /* @__PURE__ */ s(
|
|
1837
|
+
children: [/* @__PURE__ */ s("span", { children: t }), /* @__PURE__ */ s(ot, {
|
|
1838
1838
|
ariaLabel: t,
|
|
1839
1839
|
onChange: (t) => r(e, t),
|
|
1840
1840
|
onClear: () => i(e),
|
|
@@ -1874,13 +1874,13 @@ function an() {
|
|
|
1874
1874
|
//#region src/exam-session/interactions/OperationWorkArea.tsx
|
|
1875
1875
|
var Z = 900, on = 300, sn = 510, cn = 260;
|
|
1876
1876
|
function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onChange: l, onClear: u, operation: d = "+", placeholder: f = "اكتب خطوات العملية هنا", value: p }) {
|
|
1877
|
-
let m = r === "operation-worksheet" || r === "division-worksheet" ? sn : on, h = i(null), [_, v] = a(() =>
|
|
1877
|
+
let m = r === "operation-worksheet" || r === "division-worksheet" || r === "division-workspace" ? sn : on, h = i(null), [_, v] = a(() => pn(p)), [y, b] = a(!1), [x, S] = a({
|
|
1878
1878
|
height: m,
|
|
1879
1879
|
scale: 1,
|
|
1880
1880
|
width: Z
|
|
1881
1881
|
}), C = _.length === 0;
|
|
1882
1882
|
t(() => {
|
|
1883
|
-
v(
|
|
1883
|
+
v(pn(p));
|
|
1884
1884
|
}, [p]), t(() => {
|
|
1885
1885
|
let e = h.current;
|
|
1886
1886
|
if (!e) return;
|
|
@@ -1920,7 +1920,7 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
1920
1920
|
type: "freehand"
|
|
1921
1921
|
}]));
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1923
|
+
function D(e) {
|
|
1924
1924
|
if (!y || C || !e.evt.buttons && e.evt.pointerType === "mouse") return;
|
|
1925
1925
|
e.evt.preventDefault();
|
|
1926
1926
|
let t = T(e.target.getStage());
|
|
@@ -1933,30 +1933,30 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
1933
1933
|
]
|
|
1934
1934
|
} : e));
|
|
1935
1935
|
}
|
|
1936
|
-
function
|
|
1936
|
+
function O(e) {
|
|
1937
1937
|
e.evt.preventDefault(), b(!1);
|
|
1938
1938
|
}
|
|
1939
|
-
function
|
|
1939
|
+
function ee() {
|
|
1940
1940
|
b(!1), w([]), u?.();
|
|
1941
1941
|
}
|
|
1942
1942
|
return /* @__PURE__ */ c("div", {
|
|
1943
1943
|
"aria-label": e,
|
|
1944
|
-
className: ["operation-work-area", r === "operation-worksheet" ? "operation-work-area--operation-worksheet" : r === "division-worksheet" ? "operation-work-area--division-worksheet" : ""].filter(Boolean).join(" "),
|
|
1944
|
+
className: ["operation-work-area", r === "operation-worksheet" ? "operation-work-area--operation-worksheet" : r === "division-worksheet" || r === "division-workspace" ? "operation-work-area--division-worksheet" : ""].filter(Boolean).join(" "),
|
|
1945
1945
|
ref: h,
|
|
1946
|
-
children: [/* @__PURE__ */ s(
|
|
1947
|
-
className: ["operation-work-area__stage", r === "operation-worksheet" ? "operation-work-area__stage--operation-worksheet" : r === "division-worksheet" ? "operation-work-area__stage--division-worksheet" : ""].filter(Boolean).join(" "),
|
|
1946
|
+
children: [/* @__PURE__ */ s(ie, {
|
|
1947
|
+
className: ["operation-work-area__stage", r === "operation-worksheet" ? "operation-work-area__stage--operation-worksheet" : r === "division-worksheet" || r === "division-workspace" ? "operation-work-area__stage--division-worksheet" : ""].filter(Boolean).join(" "),
|
|
1948
1948
|
height: x.height,
|
|
1949
|
-
onPointerCancel:
|
|
1949
|
+
onPointerCancel: O,
|
|
1950
1950
|
onPointerDown: E,
|
|
1951
|
-
onPointerMove:
|
|
1952
|
-
onPointerUp:
|
|
1951
|
+
onPointerMove: D,
|
|
1952
|
+
onPointerUp: O,
|
|
1953
1953
|
role: "img",
|
|
1954
1954
|
width: x.width,
|
|
1955
|
-
children: /* @__PURE__ */ c(
|
|
1955
|
+
children: /* @__PURE__ */ c(ne, {
|
|
1956
1956
|
scaleX: x.scale,
|
|
1957
1957
|
scaleY: x.scale,
|
|
1958
1958
|
children: [
|
|
1959
|
-
/* @__PURE__ */ s(
|
|
1959
|
+
/* @__PURE__ */ s(V, {
|
|
1960
1960
|
cornerRadius: 22,
|
|
1961
1961
|
fill: "#fff",
|
|
1962
1962
|
height: m,
|
|
@@ -1971,11 +1971,14 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
1971
1971
|
divisor: n?.divisor,
|
|
1972
1972
|
height: m,
|
|
1973
1973
|
width: Z
|
|
1974
|
+
}) : r === "division-workspace" ? /* @__PURE__ */ s(fn, {
|
|
1975
|
+
height: m,
|
|
1976
|
+
width: Z
|
|
1974
1977
|
}) : r === "operation-worksheet" ? /* @__PURE__ */ s(un, {
|
|
1975
1978
|
height: m,
|
|
1976
1979
|
operation: d,
|
|
1977
1980
|
width: Z
|
|
1978
|
-
}) : r === "squared" ? /* @__PURE__ */ c(o, { children: [Array.from({ length: 13 }, (e, t) => /* @__PURE__ */ s(
|
|
1981
|
+
}) : r === "squared" ? /* @__PURE__ */ c(o, { children: [Array.from({ length: 13 }, (e, t) => /* @__PURE__ */ s(B, {
|
|
1979
1982
|
points: [
|
|
1980
1983
|
0,
|
|
1981
1984
|
t * 24,
|
|
@@ -1984,7 +1987,7 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
1984
1987
|
],
|
|
1985
1988
|
stroke: t % 4 == 0 ? "#4e68ff" : "#89d9ff",
|
|
1986
1989
|
strokeWidth: t % 4 == 0 ? 2 : 1
|
|
1987
|
-
}, `square-y-${t}`)), Array.from({ length: 13 }, (e, t) => /* @__PURE__ */ s(
|
|
1990
|
+
}, `square-y-${t}`)), Array.from({ length: 13 }, (e, t) => /* @__PURE__ */ s(B, {
|
|
1988
1991
|
points: [
|
|
1989
1992
|
t * 75,
|
|
1990
1993
|
0,
|
|
@@ -1993,7 +1996,7 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
1993
1996
|
],
|
|
1994
1997
|
stroke: "#4e68ff",
|
|
1995
1998
|
strokeWidth: 1.5
|
|
1996
|
-
}, `square-x-${t}`))] }) : Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ s(
|
|
1999
|
+
}, `square-x-${t}`))] }) : Array.from({ length: 6 }, (e, t) => /* @__PURE__ */ s(B, {
|
|
1997
2000
|
dash: [8, 12],
|
|
1998
2001
|
points: [
|
|
1999
2002
|
28,
|
|
@@ -2004,7 +2007,7 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
2004
2007
|
stroke: "#edf3ef",
|
|
2005
2008
|
strokeWidth: 2
|
|
2006
2009
|
}, `line-${t}`)),
|
|
2007
|
-
C && f ? /* @__PURE__ */ s(
|
|
2010
|
+
C && f ? /* @__PURE__ */ s(H, {
|
|
2008
2011
|
align: "center",
|
|
2009
2012
|
fill: "#8fa39a",
|
|
2010
2013
|
fontFamily: "Arial, sans-serif",
|
|
@@ -2017,7 +2020,7 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
2017
2020
|
x: 0,
|
|
2018
2021
|
y: 0
|
|
2019
2022
|
}) : null,
|
|
2020
|
-
_.map((e) => /* @__PURE__ */ s(
|
|
2023
|
+
_.map((e) => /* @__PURE__ */ s(B, {
|
|
2021
2024
|
globalCompositeOperation: "source-over",
|
|
2022
2025
|
lineCap: "round",
|
|
2023
2026
|
lineJoin: "round",
|
|
@@ -2032,7 +2035,7 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
2032
2035
|
"aria-label": "مسح خطوات العملية",
|
|
2033
2036
|
className: "operation-work-area__clear",
|
|
2034
2037
|
disabled: C,
|
|
2035
|
-
onClick:
|
|
2038
|
+
onClick: ee,
|
|
2036
2039
|
type: "button",
|
|
2037
2040
|
children: /* @__PURE__ */ s(g, { "aria-hidden": "true" })
|
|
2038
2041
|
})]
|
|
@@ -2041,7 +2044,7 @@ function ln({ ariaLabel: e, divisionOperands: n, gridVariant: r = "ruled", onCha
|
|
|
2041
2044
|
function un({ height: e, operation: t, width: n }) {
|
|
2042
2045
|
let r = n - 166 - 94;
|
|
2043
2046
|
return /* @__PURE__ */ c(o, { children: [
|
|
2044
|
-
Array.from({ length: Math.floor(e / 24) + 1 }, (e, t) => /* @__PURE__ */ s(
|
|
2047
|
+
Array.from({ length: Math.floor(e / 24) + 1 }, (e, t) => /* @__PURE__ */ s(B, {
|
|
2045
2048
|
points: [
|
|
2046
2049
|
0,
|
|
2047
2050
|
t * 24,
|
|
@@ -2051,7 +2054,7 @@ function un({ height: e, operation: t, width: n }) {
|
|
|
2051
2054
|
stroke: t % 4 == 0 ? "#4e68ff" : "#89d9ff",
|
|
2052
2055
|
strokeWidth: t % 4 == 0 ? 2 : 1
|
|
2053
2056
|
}, `worksheet-y-${t}`)),
|
|
2054
|
-
Array.from({ length: 13 }, (t, n) => /* @__PURE__ */ s(
|
|
2057
|
+
Array.from({ length: 13 }, (t, n) => /* @__PURE__ */ s(B, {
|
|
2055
2058
|
points: [
|
|
2056
2059
|
n * 75,
|
|
2057
2060
|
0,
|
|
@@ -2061,7 +2064,7 @@ function un({ height: e, operation: t, width: n }) {
|
|
|
2061
2064
|
stroke: "#4e68ff",
|
|
2062
2065
|
strokeWidth: 1.5
|
|
2063
2066
|
}, `worksheet-x-${n}`)),
|
|
2064
|
-
/* @__PURE__ */ s(
|
|
2067
|
+
/* @__PURE__ */ s(V, {
|
|
2065
2068
|
cornerRadius: 16,
|
|
2066
2069
|
fill: "rgba(255, 255, 255, 0.74)",
|
|
2067
2070
|
height: 94,
|
|
@@ -2071,7 +2074,7 @@ function un({ height: e, operation: t, width: n }) {
|
|
|
2071
2074
|
x: 166,
|
|
2072
2075
|
y: 42
|
|
2073
2076
|
}),
|
|
2074
|
-
/* @__PURE__ */ s(
|
|
2077
|
+
/* @__PURE__ */ s(V, {
|
|
2075
2078
|
cornerRadius: 16,
|
|
2076
2079
|
fill: "rgba(255, 255, 255, 0.74)",
|
|
2077
2080
|
height: 94,
|
|
@@ -2081,7 +2084,7 @@ function un({ height: e, operation: t, width: n }) {
|
|
|
2081
2084
|
x: 166,
|
|
2082
2085
|
y: 158
|
|
2083
2086
|
}),
|
|
2084
|
-
/* @__PURE__ */ s(
|
|
2087
|
+
/* @__PURE__ */ s(H, {
|
|
2085
2088
|
align: "center",
|
|
2086
2089
|
fill: "#111827",
|
|
2087
2090
|
fontFamily: "Arial, sans-serif",
|
|
@@ -2094,7 +2097,7 @@ function un({ height: e, operation: t, width: n }) {
|
|
|
2094
2097
|
x: 34,
|
|
2095
2098
|
y: 158
|
|
2096
2099
|
}),
|
|
2097
|
-
/* @__PURE__ */ s(
|
|
2100
|
+
/* @__PURE__ */ s(B, {
|
|
2098
2101
|
lineCap: "round",
|
|
2099
2102
|
points: [
|
|
2100
2103
|
134,
|
|
@@ -2105,7 +2108,7 @@ function un({ height: e, operation: t, width: n }) {
|
|
|
2105
2108
|
stroke: "#111827",
|
|
2106
2109
|
strokeWidth: 7
|
|
2107
2110
|
}),
|
|
2108
|
-
/* @__PURE__ */ s(
|
|
2111
|
+
/* @__PURE__ */ s(V, {
|
|
2109
2112
|
cornerRadius: 16,
|
|
2110
2113
|
fill: "rgba(255, 255, 255, 0.82)",
|
|
2111
2114
|
height: 120,
|
|
@@ -2120,27 +2123,11 @@ function un({ height: e, operation: t, width: n }) {
|
|
|
2120
2123
|
function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
2121
2124
|
let i = r - 588 - 70;
|
|
2122
2125
|
return /* @__PURE__ */ c(o, { children: [
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
t * 24
|
|
2129
|
-
],
|
|
2130
|
-
stroke: t % 4 == 0 ? "#4e68ff" : "#89d9ff",
|
|
2131
|
-
strokeWidth: t % 4 == 0 ? 2 : 1
|
|
2132
|
-
}, `division-y-${t}`)),
|
|
2133
|
-
Array.from({ length: 13 }, (e, t) => /* @__PURE__ */ s(z, {
|
|
2134
|
-
points: [
|
|
2135
|
-
t * 75,
|
|
2136
|
-
0,
|
|
2137
|
-
t * 75,
|
|
2138
|
-
n
|
|
2139
|
-
],
|
|
2140
|
-
stroke: "#4e68ff",
|
|
2141
|
-
strokeWidth: 1.5
|
|
2142
|
-
}, `division-x-${t}`)),
|
|
2143
|
-
/* @__PURE__ */ s(B, {
|
|
2126
|
+
/* @__PURE__ */ s(fn, {
|
|
2127
|
+
height: n,
|
|
2128
|
+
width: r
|
|
2129
|
+
}),
|
|
2130
|
+
/* @__PURE__ */ s(V, {
|
|
2144
2131
|
cornerRadius: 16,
|
|
2145
2132
|
fill: "rgba(255, 255, 255, 0.82)",
|
|
2146
2133
|
height: 96,
|
|
@@ -2150,7 +2137,7 @@ function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
|
2150
2137
|
x: 588,
|
|
2151
2138
|
y: 274
|
|
2152
2139
|
}),
|
|
2153
|
-
/* @__PURE__ */ s(
|
|
2140
|
+
/* @__PURE__ */ s(B, {
|
|
2154
2141
|
lineCap: "round",
|
|
2155
2142
|
points: [
|
|
2156
2143
|
560,
|
|
@@ -2163,7 +2150,7 @@ function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
|
2163
2150
|
stroke: "#101827",
|
|
2164
2151
|
strokeWidth: 6
|
|
2165
2152
|
}),
|
|
2166
|
-
/* @__PURE__ */ s(
|
|
2153
|
+
/* @__PURE__ */ s(V, {
|
|
2167
2154
|
cornerRadius: 14,
|
|
2168
2155
|
fill: "rgba(255, 255, 255, 0.64)",
|
|
2169
2156
|
height: 76,
|
|
@@ -2173,7 +2160,7 @@ function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
|
2173
2160
|
x: 56,
|
|
2174
2161
|
y: 170
|
|
2175
2162
|
}),
|
|
2176
|
-
/* @__PURE__ */ s(
|
|
2163
|
+
/* @__PURE__ */ s(V, {
|
|
2177
2164
|
cornerRadius: 14,
|
|
2178
2165
|
fill: "rgba(255, 255, 255, 0.64)",
|
|
2179
2166
|
height: 76,
|
|
@@ -2183,7 +2170,7 @@ function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
|
2183
2170
|
x: 588,
|
|
2184
2171
|
y: 170
|
|
2185
2172
|
}),
|
|
2186
|
-
e ? /* @__PURE__ */ s(
|
|
2173
|
+
e ? /* @__PURE__ */ s(H, {
|
|
2187
2174
|
align: "center",
|
|
2188
2175
|
fill: "#101827",
|
|
2189
2176
|
fontFamily: "Arial, sans-serif",
|
|
@@ -2196,7 +2183,7 @@ function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
|
2196
2183
|
x: 56,
|
|
2197
2184
|
y: 170
|
|
2198
2185
|
}) : null,
|
|
2199
|
-
t ? /* @__PURE__ */ s(
|
|
2186
|
+
t ? /* @__PURE__ */ s(H, {
|
|
2200
2187
|
align: "center",
|
|
2201
2188
|
fill: "#101827",
|
|
2202
2189
|
fontFamily: "Arial, sans-serif",
|
|
@@ -2209,7 +2196,7 @@ function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
|
2209
2196
|
x: 588,
|
|
2210
2197
|
y: 170
|
|
2211
2198
|
}) : null,
|
|
2212
|
-
/* @__PURE__ */ s(
|
|
2199
|
+
/* @__PURE__ */ s(V, {
|
|
2213
2200
|
cornerRadius: 18,
|
|
2214
2201
|
fill: "rgba(255, 255, 255, 0.58)",
|
|
2215
2202
|
height: n - 294,
|
|
@@ -2221,12 +2208,33 @@ function dn({ dividend: e, divisor: t, height: n, width: r }) {
|
|
|
2221
2208
|
})
|
|
2222
2209
|
] });
|
|
2223
2210
|
}
|
|
2224
|
-
function fn(e) {
|
|
2211
|
+
function fn({ height: e, width: t }) {
|
|
2212
|
+
return /* @__PURE__ */ c(o, { children: [Array.from({ length: Math.floor(e / 24) + 1 }, (e, n) => /* @__PURE__ */ s(B, {
|
|
2213
|
+
points: [
|
|
2214
|
+
0,
|
|
2215
|
+
n * 24,
|
|
2216
|
+
t,
|
|
2217
|
+
n * 24
|
|
2218
|
+
],
|
|
2219
|
+
stroke: n % 4 == 0 ? "#4e68ff" : "#89d9ff",
|
|
2220
|
+
strokeWidth: n % 4 == 0 ? 2 : 1
|
|
2221
|
+
}, `division-y-${n}`)), Array.from({ length: Math.ceil(t / 75) + 1 }, (t, n) => /* @__PURE__ */ s(B, {
|
|
2222
|
+
points: [
|
|
2223
|
+
n * 75,
|
|
2224
|
+
0,
|
|
2225
|
+
n * 75,
|
|
2226
|
+
e
|
|
2227
|
+
],
|
|
2228
|
+
stroke: "#4e68ff",
|
|
2229
|
+
strokeWidth: 1.5
|
|
2230
|
+
}, `division-x-${n}`))] });
|
|
2231
|
+
}
|
|
2232
|
+
function pn(e) {
|
|
2225
2233
|
return e?.elements?.filter((e) => e.type === "freehand") ?? [];
|
|
2226
2234
|
}
|
|
2227
2235
|
//#endregion
|
|
2228
2236
|
//#region src/exam-session/interactions/ProblemSheetShape.tsx
|
|
2229
|
-
var
|
|
2237
|
+
var mn = [
|
|
2230
2238
|
{
|
|
2231
2239
|
id: "basic",
|
|
2232
2240
|
label: "Formes",
|
|
@@ -2268,7 +2276,7 @@ var pn = [
|
|
|
2268
2276
|
"arc"
|
|
2269
2277
|
]
|
|
2270
2278
|
}
|
|
2271
|
-
],
|
|
2279
|
+
], hn = {
|
|
2272
2280
|
arc: "Arc",
|
|
2273
2281
|
"arrow-down": "Flèche vers le bas",
|
|
2274
2282
|
"arrow-left": "Flèche vers la gauche",
|
|
@@ -2293,19 +2301,19 @@ var pn = [
|
|
|
2293
2301
|
triangle: "Triangle",
|
|
2294
2302
|
wedge: "Secteur"
|
|
2295
2303
|
};
|
|
2296
|
-
function hn(e) {
|
|
2297
|
-
return mn[e];
|
|
2298
|
-
}
|
|
2299
2304
|
function gn(e) {
|
|
2305
|
+
return hn[e];
|
|
2306
|
+
}
|
|
2307
|
+
function _n(e) {
|
|
2300
2308
|
return e === "circle";
|
|
2301
2309
|
}
|
|
2302
|
-
function
|
|
2310
|
+
function vn({ element: e, hitStrokeWidth: t }) {
|
|
2303
2311
|
let n = e.fill ?? "#e8f1ff", r = e.stroke ?? "#0f172a", i = e.strokeWidth ?? 3, a = Math.max(1, e.width), l = Math.max(1, e.height), u = Math.min(a, l) / 2, d = {
|
|
2304
2312
|
fill: n,
|
|
2305
2313
|
stroke: r,
|
|
2306
2314
|
strokeWidth: i
|
|
2307
2315
|
};
|
|
2308
|
-
if (e.shape === "line") return /* @__PURE__ */ s(
|
|
2316
|
+
if (e.shape === "line") return /* @__PURE__ */ s(B, {
|
|
2309
2317
|
hitStrokeWidth: t,
|
|
2310
2318
|
lineCap: "round",
|
|
2311
2319
|
points: [
|
|
@@ -2317,18 +2325,18 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2317
2325
|
stroke: r,
|
|
2318
2326
|
strokeWidth: i
|
|
2319
2327
|
});
|
|
2320
|
-
if (e.shape === "rectangle") return /* @__PURE__ */ s(
|
|
2328
|
+
if (e.shape === "rectangle") return /* @__PURE__ */ s(V, {
|
|
2321
2329
|
...d,
|
|
2322
2330
|
height: l,
|
|
2323
2331
|
width: a
|
|
2324
2332
|
});
|
|
2325
|
-
if (e.shape === "rounded-rectangle") return /* @__PURE__ */ s(
|
|
2333
|
+
if (e.shape === "rounded-rectangle") return /* @__PURE__ */ s(V, {
|
|
2326
2334
|
...d,
|
|
2327
2335
|
cornerRadius: Math.min(24, u / 2),
|
|
2328
2336
|
height: l,
|
|
2329
2337
|
width: a
|
|
2330
2338
|
});
|
|
2331
|
-
if (e.shape === "circle" || e.shape === "ellipse") return /* @__PURE__ */ s(
|
|
2339
|
+
if (e.shape === "circle" || e.shape === "ellipse") return /* @__PURE__ */ s(L, {
|
|
2332
2340
|
...d,
|
|
2333
2341
|
radiusX: e.shape === "circle" ? u : a / 2,
|
|
2334
2342
|
radiusY: e.shape === "circle" ? u : l / 2,
|
|
@@ -2337,7 +2345,7 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2337
2345
|
});
|
|
2338
2346
|
if (e.shape === "triangle" || e.shape === "pentagon" || e.shape === "hexagon" || e.shape === "octagon") {
|
|
2339
2347
|
let t = e.shape === "triangle" ? 3 : e.shape === "pentagon" ? 5 : e.shape === "hexagon" ? 6 : 8;
|
|
2340
|
-
return /* @__PURE__ */ s(
|
|
2348
|
+
return /* @__PURE__ */ s(re, {
|
|
2341
2349
|
...d,
|
|
2342
2350
|
radius: 1,
|
|
2343
2351
|
scaleX: a / 2,
|
|
@@ -2347,7 +2355,7 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2347
2355
|
y: l / 2
|
|
2348
2356
|
});
|
|
2349
2357
|
}
|
|
2350
|
-
return e.shape === "star" ? /* @__PURE__ */ s(
|
|
2358
|
+
return e.shape === "star" ? /* @__PURE__ */ s(ae, {
|
|
2351
2359
|
...d,
|
|
2352
2360
|
innerRadius: .46,
|
|
2353
2361
|
numPoints: 5,
|
|
@@ -2356,7 +2364,7 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2356
2364
|
scaleY: l / 2,
|
|
2357
2365
|
x: a / 2,
|
|
2358
2366
|
y: l / 2
|
|
2359
|
-
}) : e.shape === "diamond" ? /* @__PURE__ */ s(
|
|
2367
|
+
}) : e.shape === "diamond" ? /* @__PURE__ */ s(yn, {
|
|
2360
2368
|
...d,
|
|
2361
2369
|
points: [
|
|
2362
2370
|
a / 2,
|
|
@@ -2368,7 +2376,7 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2368
2376
|
0,
|
|
2369
2377
|
l / 2
|
|
2370
2378
|
]
|
|
2371
|
-
}) : e.shape === "parallelogram" ? /* @__PURE__ */ s(
|
|
2379
|
+
}) : e.shape === "parallelogram" ? /* @__PURE__ */ s(yn, {
|
|
2372
2380
|
...d,
|
|
2373
2381
|
points: [
|
|
2374
2382
|
a * .22,
|
|
@@ -2380,7 +2388,7 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2380
2388
|
0,
|
|
2381
2389
|
l
|
|
2382
2390
|
]
|
|
2383
|
-
}) : e.shape === "trapezoid" ? /* @__PURE__ */ s(
|
|
2391
|
+
}) : e.shape === "trapezoid" ? /* @__PURE__ */ s(yn, {
|
|
2384
2392
|
...d,
|
|
2385
2393
|
points: [
|
|
2386
2394
|
a * .18,
|
|
@@ -2392,10 +2400,10 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2392
2400
|
0,
|
|
2393
2401
|
l
|
|
2394
2402
|
]
|
|
2395
|
-
}) : e.shape === "arrow-right" || e.shape === "arrow-left" || e.shape === "arrow-up" || e.shape === "arrow-down" ? /* @__PURE__ */ s(
|
|
2403
|
+
}) : e.shape === "arrow-right" || e.shape === "arrow-left" || e.shape === "arrow-up" || e.shape === "arrow-down" ? /* @__PURE__ */ s(yn, {
|
|
2396
2404
|
...d,
|
|
2397
|
-
points:
|
|
2398
|
-
}) : e.shape === "chevron" ? /* @__PURE__ */ s(
|
|
2405
|
+
points: bn(e.shape, a, l)
|
|
2406
|
+
}) : e.shape === "chevron" ? /* @__PURE__ */ s(yn, {
|
|
2399
2407
|
...d,
|
|
2400
2408
|
points: [
|
|
2401
2409
|
0,
|
|
@@ -2411,7 +2419,7 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2411
2419
|
a * .42,
|
|
2412
2420
|
l / 2
|
|
2413
2421
|
]
|
|
2414
|
-
}) : e.shape === "heart" ? /* @__PURE__ */ s(
|
|
2422
|
+
}) : e.shape === "heart" ? /* @__PURE__ */ s(B, {
|
|
2415
2423
|
...d,
|
|
2416
2424
|
closed: !0,
|
|
2417
2425
|
lineJoin: "round",
|
|
@@ -2438,7 +2446,7 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2438
2446
|
l * .46
|
|
2439
2447
|
],
|
|
2440
2448
|
tension: .42
|
|
2441
|
-
}) : e.shape === "cloud" ? /* @__PURE__ */ s(
|
|
2449
|
+
}) : e.shape === "cloud" ? /* @__PURE__ */ s(B, {
|
|
2442
2450
|
...d,
|
|
2443
2451
|
closed: !0,
|
|
2444
2452
|
lineJoin: "round",
|
|
@@ -2469,12 +2477,12 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2469
2477
|
l * .96
|
|
2470
2478
|
],
|
|
2471
2479
|
tension: .5
|
|
2472
|
-
}) : e.shape === "speech-bubble" ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(
|
|
2480
|
+
}) : e.shape === "speech-bubble" ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(V, {
|
|
2473
2481
|
...d,
|
|
2474
2482
|
cornerRadius: Math.min(22, u / 2),
|
|
2475
2483
|
height: l * .76,
|
|
2476
2484
|
width: a
|
|
2477
|
-
}), /* @__PURE__ */ s(
|
|
2485
|
+
}), /* @__PURE__ */ s(yn, {
|
|
2478
2486
|
...d,
|
|
2479
2487
|
points: [
|
|
2480
2488
|
a * .2,
|
|
@@ -2484,14 +2492,14 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2484
2492
|
a * .22,
|
|
2485
2493
|
l
|
|
2486
2494
|
]
|
|
2487
|
-
})] }) : e.shape === "wedge" ? /* @__PURE__ */ s(
|
|
2495
|
+
})] }) : e.shape === "wedge" ? /* @__PURE__ */ s(se, {
|
|
2488
2496
|
...d,
|
|
2489
2497
|
angle: 110,
|
|
2490
2498
|
radius: u,
|
|
2491
2499
|
rotation: -55,
|
|
2492
2500
|
x: a / 2,
|
|
2493
2501
|
y: l / 2
|
|
2494
|
-
}) : /* @__PURE__ */ s(
|
|
2502
|
+
}) : /* @__PURE__ */ s(F, {
|
|
2495
2503
|
...d,
|
|
2496
2504
|
angle: 180,
|
|
2497
2505
|
innerRadius: Math.max(0, u - Math.max(14, u * .3)),
|
|
@@ -2501,15 +2509,15 @@ function _n({ element: e, hitStrokeWidth: t }) {
|
|
|
2501
2509
|
y: l / 2
|
|
2502
2510
|
});
|
|
2503
2511
|
}
|
|
2504
|
-
function
|
|
2505
|
-
return /* @__PURE__ */ s(
|
|
2512
|
+
function yn({ points: e, ...t }) {
|
|
2513
|
+
return /* @__PURE__ */ s(B, {
|
|
2506
2514
|
...t,
|
|
2507
2515
|
closed: !0,
|
|
2508
2516
|
lineJoin: "round",
|
|
2509
2517
|
points: e
|
|
2510
2518
|
});
|
|
2511
2519
|
}
|
|
2512
|
-
function
|
|
2520
|
+
function bn(e, t, n) {
|
|
2513
2521
|
return {
|
|
2514
2522
|
"arrow-right": [
|
|
2515
2523
|
0,
|
|
@@ -2579,8 +2587,8 @@ function yn(e, t, n) {
|
|
|
2579
2587
|
}
|
|
2580
2588
|
//#endregion
|
|
2581
2589
|
//#region src/exam-session/interactions/problemSheetCanvas.tsx
|
|
2582
|
-
var Q = 1e3,
|
|
2583
|
-
function
|
|
2590
|
+
var Q = 1e3, xn = 40;
|
|
2591
|
+
function Sn(e) {
|
|
2584
2592
|
switch (e) {
|
|
2585
2593
|
case "blue": return "#eef7ff";
|
|
2586
2594
|
case "green": return "#f0fbf5";
|
|
@@ -2588,10 +2596,10 @@ function xn(e) {
|
|
|
2588
2596
|
default: return "#ffffff";
|
|
2589
2597
|
}
|
|
2590
2598
|
}
|
|
2591
|
-
function
|
|
2599
|
+
function Cn({ height: e, paper: t }) {
|
|
2592
2600
|
if (t === "blank") return null;
|
|
2593
2601
|
let n = [];
|
|
2594
|
-
for (let r = 0; r <= e; r +=
|
|
2602
|
+
for (let r = 0; r <= e; r += xn) n.push(/* @__PURE__ */ s(B, {
|
|
2595
2603
|
points: [
|
|
2596
2604
|
0,
|
|
2597
2605
|
r,
|
|
@@ -2601,7 +2609,7 @@ function Sn({ height: e, paper: t }) {
|
|
|
2601
2609
|
stroke: t === "ruled" ? "#9fc0e9" : "#bad5f0",
|
|
2602
2610
|
strokeWidth: t === "ruled" ? 1.4 : 1
|
|
2603
2611
|
}, `h-${r}`));
|
|
2604
|
-
if (t === "squared") for (let t = 0; t <= Q; t +=
|
|
2612
|
+
if (t === "squared") for (let t = 0; t <= Q; t += xn) n.push(/* @__PURE__ */ s(B, {
|
|
2605
2613
|
points: [
|
|
2606
2614
|
t,
|
|
2607
2615
|
0,
|
|
@@ -2613,8 +2621,8 @@ function Sn({ height: e, paper: t }) {
|
|
|
2613
2621
|
}, `v-${t}`));
|
|
2614
2622
|
return /* @__PURE__ */ s(o, { children: n });
|
|
2615
2623
|
}
|
|
2616
|
-
function
|
|
2617
|
-
return e.type === "image" ? /* @__PURE__ */ s(
|
|
2624
|
+
function wn({ element: e }) {
|
|
2625
|
+
return e.type === "image" ? /* @__PURE__ */ s(Tn, { element: e }) : e.type === "drawing" ? /* @__PURE__ */ s(B, {
|
|
2618
2626
|
lineCap: "round",
|
|
2619
2627
|
lineJoin: "round",
|
|
2620
2628
|
points: e.points,
|
|
@@ -2623,7 +2631,7 @@ function Cn({ element: e }) {
|
|
|
2623
2631
|
tension: .38,
|
|
2624
2632
|
x: e.x,
|
|
2625
2633
|
y: e.y
|
|
2626
|
-
}) : e.type === "text" ? /* @__PURE__ */ s(
|
|
2634
|
+
}) : e.type === "text" ? /* @__PURE__ */ s(H, {
|
|
2627
2635
|
fill: e.color ?? "#0f172a",
|
|
2628
2636
|
fontFamily: "Arial, sans-serif",
|
|
2629
2637
|
fontSize: e.fontSize ?? 28,
|
|
@@ -2631,17 +2639,17 @@ function Cn({ element: e }) {
|
|
|
2631
2639
|
width: 320,
|
|
2632
2640
|
x: e.x,
|
|
2633
2641
|
y: e.y
|
|
2634
|
-
}) : /* @__PURE__ */ s(
|
|
2642
|
+
}) : /* @__PURE__ */ s(R, {
|
|
2635
2643
|
rotation: e.rotation ?? 0,
|
|
2636
2644
|
x: e.x,
|
|
2637
2645
|
y: e.y,
|
|
2638
|
-
children: /* @__PURE__ */ s(
|
|
2646
|
+
children: /* @__PURE__ */ s(vn, { element: e })
|
|
2639
2647
|
});
|
|
2640
2648
|
}
|
|
2641
|
-
function
|
|
2642
|
-
let t =
|
|
2643
|
-
return t ? /* @__PURE__ */ s(
|
|
2644
|
-
crop:
|
|
2649
|
+
function Tn({ element: e }) {
|
|
2650
|
+
let t = En(e.source);
|
|
2651
|
+
return t ? /* @__PURE__ */ s(z, {
|
|
2652
|
+
crop: Dn(t, e.crop),
|
|
2645
2653
|
height: e.height,
|
|
2646
2654
|
image: t,
|
|
2647
2655
|
rotation: e.rotation ?? 0,
|
|
@@ -2650,7 +2658,7 @@ function wn({ element: e }) {
|
|
|
2650
2658
|
y: e.y
|
|
2651
2659
|
}) : null;
|
|
2652
2660
|
}
|
|
2653
|
-
function
|
|
2661
|
+
function En(e) {
|
|
2654
2662
|
let [n, r] = a(null);
|
|
2655
2663
|
return t(() => {
|
|
2656
2664
|
let t = !0, n = new Image();
|
|
@@ -2663,7 +2671,7 @@ function Tn(e) {
|
|
|
2663
2671
|
};
|
|
2664
2672
|
}, [e]), n;
|
|
2665
2673
|
}
|
|
2666
|
-
function
|
|
2674
|
+
function Dn(e, t) {
|
|
2667
2675
|
if (t) return {
|
|
2668
2676
|
height: Math.max(1, e.naturalHeight * t.height),
|
|
2669
2677
|
width: Math.max(1, e.naturalWidth * t.width),
|
|
@@ -2671,20 +2679,20 @@ function En(e, t) {
|
|
|
2671
2679
|
y: e.naturalHeight * t.y
|
|
2672
2680
|
};
|
|
2673
2681
|
}
|
|
2674
|
-
function
|
|
2675
|
-
return e.type === "freehand" ? /* @__PURE__ */ s(
|
|
2682
|
+
function On({ element: e }) {
|
|
2683
|
+
return e.type === "freehand" ? /* @__PURE__ */ s(B, {
|
|
2676
2684
|
lineCap: "round",
|
|
2677
2685
|
lineJoin: "round",
|
|
2678
2686
|
points: e.points,
|
|
2679
2687
|
stroke: e.color,
|
|
2680
2688
|
strokeWidth: e.strokeWidth,
|
|
2681
2689
|
tension: .45
|
|
2682
|
-
}) : e.type === "line" ? /* @__PURE__ */ s(
|
|
2690
|
+
}) : e.type === "line" ? /* @__PURE__ */ s(B, {
|
|
2683
2691
|
lineCap: "round",
|
|
2684
2692
|
points: e.points,
|
|
2685
2693
|
stroke: e.color,
|
|
2686
2694
|
strokeWidth: e.strokeWidth
|
|
2687
|
-
}) : e.type === "text" ? /* @__PURE__ */ s(
|
|
2695
|
+
}) : e.type === "text" ? /* @__PURE__ */ s(H, {
|
|
2688
2696
|
fill: e.color,
|
|
2689
2697
|
fontFamily: "Arial, sans-serif",
|
|
2690
2698
|
fontSize: e.fontSize,
|
|
@@ -2692,7 +2700,7 @@ function Dn({ element: e }) {
|
|
|
2692
2700
|
width: 280,
|
|
2693
2701
|
x: e.x,
|
|
2694
2702
|
y: e.y
|
|
2695
|
-
}) : /* @__PURE__ */ s(
|
|
2703
|
+
}) : /* @__PURE__ */ s(I, {
|
|
2696
2704
|
radius: e.radius,
|
|
2697
2705
|
stroke: e.color,
|
|
2698
2706
|
strokeWidth: e.strokeWidth,
|
|
@@ -2700,7 +2708,7 @@ function Dn({ element: e }) {
|
|
|
2700
2708
|
y: e.center.y
|
|
2701
2709
|
});
|
|
2702
2710
|
}
|
|
2703
|
-
function
|
|
2711
|
+
function kn(e) {
|
|
2704
2712
|
return e?.elements?.length ? e.elements : (e?.strokes ?? []).map((e) => ({
|
|
2705
2713
|
color: "#111827",
|
|
2706
2714
|
id: e.id,
|
|
@@ -2711,9 +2719,9 @@ function On(e) {
|
|
|
2711
2719
|
}
|
|
2712
2720
|
//#endregion
|
|
2713
2721
|
//#region src/exam-session/interactions/ProblemSheet.tsx
|
|
2714
|
-
var
|
|
2715
|
-
function
|
|
2716
|
-
let o = i(null), [l, u] = a(Q), d =
|
|
2722
|
+
var An = 460;
|
|
2723
|
+
function jn({ className: e, config: t, height: r }) {
|
|
2724
|
+
let o = i(null), [l, u] = a(Q), d = Mn(r ?? t?.height);
|
|
2717
2725
|
if (n(() => {
|
|
2718
2726
|
let e = o.current;
|
|
2719
2727
|
if (!e) return;
|
|
@@ -2722,7 +2730,7 @@ function An({ className: e, config: t, height: r }) {
|
|
|
2722
2730
|
let n = new ResizeObserver(t);
|
|
2723
2731
|
return n.observe(e), () => n.disconnect();
|
|
2724
2732
|
}, []), !t?.enabled) return null;
|
|
2725
|
-
let f = Math.min(Q, l), p = f / Q, m =
|
|
2733
|
+
let f = Math.min(Q, l), p = f / Q, m = kn(t.content), h = ["problem-sheet", e].filter(Boolean).join(" "), g = t.title?.trim();
|
|
2726
2734
|
return /* @__PURE__ */ c("section", {
|
|
2727
2735
|
className: h,
|
|
2728
2736
|
dir: "rtl",
|
|
@@ -2732,37 +2740,37 @@ function An({ className: e, config: t, height: r }) {
|
|
|
2732
2740
|
}) : null, /* @__PURE__ */ s("div", {
|
|
2733
2741
|
className: "problem-sheet__canvas",
|
|
2734
2742
|
ref: o,
|
|
2735
|
-
children: /* @__PURE__ */ s(
|
|
2743
|
+
children: /* @__PURE__ */ s(ie, {
|
|
2736
2744
|
height: d * p,
|
|
2737
2745
|
listening: !1,
|
|
2738
2746
|
width: f,
|
|
2739
|
-
children: /* @__PURE__ */ c(
|
|
2747
|
+
children: /* @__PURE__ */ c(ne, {
|
|
2740
2748
|
scaleX: p,
|
|
2741
2749
|
scaleY: p,
|
|
2742
2750
|
children: [
|
|
2743
|
-
/* @__PURE__ */ s(
|
|
2744
|
-
fill:
|
|
2751
|
+
/* @__PURE__ */ s(V, {
|
|
2752
|
+
fill: Sn(t.background),
|
|
2745
2753
|
height: d,
|
|
2746
2754
|
width: Q
|
|
2747
2755
|
}),
|
|
2748
|
-
/* @__PURE__ */ s(
|
|
2756
|
+
/* @__PURE__ */ s(Cn, {
|
|
2749
2757
|
height: d,
|
|
2750
2758
|
paper: t.paper ?? "squared"
|
|
2751
2759
|
}),
|
|
2752
|
-
t.elements?.map((e) => /* @__PURE__ */ s(
|
|
2753
|
-
m.map((e) => /* @__PURE__ */ s(
|
|
2760
|
+
t.elements?.map((e) => /* @__PURE__ */ s(wn, { element: e }, e.id)),
|
|
2761
|
+
m.map((e) => /* @__PURE__ */ s(On, { element: e }, e.id))
|
|
2754
2762
|
]
|
|
2755
2763
|
})
|
|
2756
2764
|
})
|
|
2757
2765
|
})]
|
|
2758
2766
|
});
|
|
2759
2767
|
}
|
|
2760
|
-
function
|
|
2761
|
-
return Number.isFinite(e) ? Math.min(900, Math.max(220, Math.round(e ??
|
|
2768
|
+
function Mn(e) {
|
|
2769
|
+
return Number.isFinite(e) ? Math.min(900, Math.max(220, Math.round(e ?? An))) : An;
|
|
2762
2770
|
}
|
|
2763
2771
|
//#endregion
|
|
2764
2772
|
//#region src/voice/evaluateVoiceAiResult.ts
|
|
2765
|
-
var
|
|
2773
|
+
var Nn = {
|
|
2766
2774
|
audioConfig: {
|
|
2767
2775
|
bitDepth: 16,
|
|
2768
2776
|
channels: 1,
|
|
@@ -2772,18 +2780,18 @@ var Mn = {
|
|
|
2772
2780
|
lang: "fr",
|
|
2773
2781
|
useModelAi: !0
|
|
2774
2782
|
};
|
|
2775
|
-
function
|
|
2776
|
-
let r =
|
|
2783
|
+
function Pn(e, t, n) {
|
|
2784
|
+
let r = Rn([t, ...n.acceptedPronunciations ?? []]), i = r.map(Fn), a = Fn(e.transcript), o = i.map((e, t) => ({
|
|
2777
2785
|
index: t,
|
|
2778
|
-
similarity:
|
|
2786
|
+
similarity: Ln(a, e)
|
|
2779
2787
|
})).reduce((e, t) => t.similarity > e.similarity ? t : e, {
|
|
2780
2788
|
index: -1,
|
|
2781
2789
|
similarity: 0
|
|
2782
|
-
}), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l =
|
|
2790
|
+
}), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l = zn(n.minimumSimilarity ?? In(s), 0, 1), u = e.language === n.expectedLanguage, d = a.length > 0, f = d && u && o.similarity >= l, p = d ? u ? f ? "correct" : "incorrect" : "language-mismatch" : "no-speech";
|
|
2783
2791
|
return {
|
|
2784
2792
|
acceptedPronunciations: r,
|
|
2785
2793
|
confidence: e.confidence,
|
|
2786
|
-
confidencePercent: Math.round(
|
|
2794
|
+
confidencePercent: Math.round(zn(e.confidence, 0, 1) * 100),
|
|
2787
2795
|
detectedPronunciation: e.transcript,
|
|
2788
2796
|
expectedLanguage: n.expectedLanguage,
|
|
2789
2797
|
expectedText: t,
|
|
@@ -2802,13 +2810,13 @@ function Nn(e, t, n) {
|
|
|
2802
2810
|
timestamps: e.timestamps ?? []
|
|
2803
2811
|
};
|
|
2804
2812
|
}
|
|
2805
|
-
function
|
|
2813
|
+
function Fn(e) {
|
|
2806
2814
|
return e.toLocaleLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[\u064b-\u065f\u0670]/g, "").replace(/[|]+/g, " ").replace(/[^\p{Letter}\p{Number}\s]/gu, " ").replace(/\s+/g, " ").trim();
|
|
2807
2815
|
}
|
|
2808
|
-
function
|
|
2809
|
-
return (e ?
|
|
2816
|
+
function In(e) {
|
|
2817
|
+
return (e ? Fn(e).length : 0) <= 4 ? 1 : .85;
|
|
2810
2818
|
}
|
|
2811
|
-
function
|
|
2819
|
+
function Ln(e, t) {
|
|
2812
2820
|
let n = Array.from(e), r = Array.from(t), i = Math.max(n.length, r.length);
|
|
2813
2821
|
if (i === 0) return 0;
|
|
2814
2822
|
let a = Array.from({ length: r.length + 1 }, (e, t) => t);
|
|
@@ -2820,22 +2828,22 @@ function In(e, t) {
|
|
|
2820
2828
|
}
|
|
2821
2829
|
a.splice(0, a.length, ...t);
|
|
2822
2830
|
}
|
|
2823
|
-
return
|
|
2831
|
+
return zn(1 - a[r.length] / i, 0, 1);
|
|
2824
2832
|
}
|
|
2825
|
-
function
|
|
2833
|
+
function Rn(e) {
|
|
2826
2834
|
let t = /* @__PURE__ */ new Set();
|
|
2827
2835
|
return e.filter((e) => {
|
|
2828
|
-
let n =
|
|
2836
|
+
let n = Fn(e);
|
|
2829
2837
|
return !n || t.has(n) ? !1 : (t.add(n), !0);
|
|
2830
2838
|
});
|
|
2831
2839
|
}
|
|
2832
|
-
function
|
|
2840
|
+
function zn(e, t, n) {
|
|
2833
2841
|
return Math.min(n, Math.max(t, e));
|
|
2834
2842
|
}
|
|
2835
2843
|
//#endregion
|
|
2836
2844
|
//#region src/exam-session/interactions/PronunciationRecorder.tsx
|
|
2837
|
-
function
|
|
2838
|
-
let [_, v] = a("idle"), [y, b] = a(null), [S, C] = a(0), w = i(null), T = i(!1), E = r(() => g ?
|
|
2845
|
+
function Bn({ acceptedPronunciations: e, expectedText: n, imageAlt: o, imageSrc: l, instruction: u, language: d, minimumSimilarity: f, onChange: p, onReset: m, recorder: h, value: g }) {
|
|
2846
|
+
let [_, v] = a("idle"), [y, b] = a(null), [S, C] = a(0), w = i(null), T = i(!1), E = r(() => g ? Pn(g.result.modelAiResult, n, {
|
|
2839
2847
|
acceptedPronunciations: e,
|
|
2840
2848
|
expectedLanguage: d,
|
|
2841
2849
|
minimumSimilarity: f
|
|
@@ -2856,29 +2864,29 @@ function zn({ acceptedPronunciations: e, expectedText: n, imageAlt: o, imageSrc:
|
|
|
2856
2864
|
}, [_]), t(() => () => {
|
|
2857
2865
|
T.current && h?.stopRecording().catch(() => void 0);
|
|
2858
2866
|
}, [h]);
|
|
2859
|
-
async function
|
|
2867
|
+
async function O() {
|
|
2860
2868
|
if (_ !== "recording") {
|
|
2861
2869
|
v("checking"), b(null), m();
|
|
2862
2870
|
try {
|
|
2863
2871
|
if (!h) throw Error("Ù…ÙØ³Ø¬Ù‘ÙÙ„ الصَّوت غَير Ù…ÙØªØ§ØÙ ÙÙÙŠ هذا التَّطبÙيق.");
|
|
2864
2872
|
let e = {
|
|
2865
|
-
...
|
|
2873
|
+
...Nn,
|
|
2866
2874
|
lang: d,
|
|
2867
2875
|
maxDuration: 10
|
|
2868
2876
|
};
|
|
2869
2877
|
if (!(await h.startRecording(e)).started) throw Error("تعذّر بدء التسجيل الصوتي.");
|
|
2870
2878
|
T.current = !0, w.current = Date.now(), C(0), v("recording");
|
|
2871
2879
|
} catch (e) {
|
|
2872
|
-
T.current = !1, w.current = null, b(
|
|
2880
|
+
T.current = !1, w.current = null, b(Gn(e)), v("error");
|
|
2873
2881
|
}
|
|
2874
2882
|
}
|
|
2875
2883
|
}
|
|
2876
|
-
async function
|
|
2884
|
+
async function k() {
|
|
2877
2885
|
if (_ === "recording") {
|
|
2878
2886
|
v("processing"), b(null);
|
|
2879
2887
|
try {
|
|
2880
2888
|
if (!h) throw Error("Ù…ÙØ³Ø¬Ù‘ÙÙ„ الصَّوت غَير Ù…ÙØªØ§ØÙ ÙÙÙŠ هذا التَّطبÙيق.");
|
|
2881
|
-
let t = await h.stopRecording(), r =
|
|
2889
|
+
let t = await h.stopRecording(), r = Pn(t.modelAiResult, n, {
|
|
2882
2890
|
acceptedPronunciations: e,
|
|
2883
2891
|
expectedLanguage: d,
|
|
2884
2892
|
minimumSimilarity: f
|
|
@@ -2889,14 +2897,14 @@ function zn({ acceptedPronunciations: e, expectedText: n, imageAlt: o, imageSrc:
|
|
|
2889
2897
|
result: t
|
|
2890
2898
|
}), v("idle");
|
|
2891
2899
|
} catch (e) {
|
|
2892
|
-
T.current = !1, w.current = null, b(
|
|
2900
|
+
T.current = !1, w.current = null, b(Gn(e)), v("error");
|
|
2893
2901
|
}
|
|
2894
2902
|
}
|
|
2895
2903
|
}
|
|
2896
|
-
function
|
|
2904
|
+
function A() {
|
|
2897
2905
|
b(null), C(0), v("idle"), m();
|
|
2898
2906
|
}
|
|
2899
|
-
let
|
|
2907
|
+
let j = _ === "checking" || _ === "processing", M = _ === "recording" ? S : g?.result.duration ?? S;
|
|
2900
2908
|
return /* @__PURE__ */ c("div", {
|
|
2901
2909
|
className: "audio-debug-card",
|
|
2902
2910
|
"data-status": _,
|
|
@@ -2914,7 +2922,7 @@ function zn({ acceptedPronunciations: e, expectedText: n, imageAlt: o, imageSrc:
|
|
|
2914
2922
|
children: [
|
|
2915
2923
|
/* @__PURE__ */ c("span", { children: [
|
|
2916
2924
|
"اُنْطِقِ الكَلِمَةَ بِـ",
|
|
2917
|
-
|
|
2925
|
+
Wn(d),
|
|
2918
2926
|
":"
|
|
2919
2927
|
] }),
|
|
2920
2928
|
/* @__PURE__ */ s("strong", {
|
|
@@ -2932,31 +2940,31 @@ function zn({ acceptedPronunciations: e, expectedText: n, imageAlt: o, imageSrc:
|
|
|
2932
2940
|
className: "audio-debug-card__icon",
|
|
2933
2941
|
"aria-hidden": "true",
|
|
2934
2942
|
children: /* @__PURE__ */ s(x, {})
|
|
2935
|
-
}), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("strong", { children:
|
|
2943
|
+
}), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("strong", { children: Kn(_, !!g) }), /* @__PURE__ */ s("span", { children: Un(M) })] })]
|
|
2936
2944
|
}),
|
|
2937
2945
|
/* @__PURE__ */ c("div", {
|
|
2938
2946
|
className: "audio-debug-actions",
|
|
2939
2947
|
children: [
|
|
2940
2948
|
/* @__PURE__ */ c("button", {
|
|
2941
2949
|
className: "audio-debug-button audio-debug-button--record",
|
|
2942
|
-
disabled: _ === "recording" ||
|
|
2943
|
-
onClick:
|
|
2950
|
+
disabled: _ === "recording" || j,
|
|
2951
|
+
onClick: O,
|
|
2944
2952
|
type: "button",
|
|
2945
2953
|
children: [/* @__PURE__ */ s(x, { "aria-hidden": "true" }), /* @__PURE__ */ s("span", { children: g ? "سَجِّلْ مُحاوَلَةً جَدِيدَةً" : "اِبْدَأِ التَّسْجِيلَ" })]
|
|
2946
2954
|
}),
|
|
2947
2955
|
/* @__PURE__ */ c("button", {
|
|
2948
2956
|
className: "audio-debug-button audio-debug-button--stop",
|
|
2949
2957
|
disabled: _ !== "recording",
|
|
2950
|
-
onClick:
|
|
2958
|
+
onClick: k,
|
|
2951
2959
|
type: "button",
|
|
2952
|
-
children: [/* @__PURE__ */ s(
|
|
2960
|
+
children: [/* @__PURE__ */ s(ee, { "aria-hidden": "true" }), /* @__PURE__ */ s("span", { children: "أَنْهِ التَّسْجِيلَ" })]
|
|
2953
2961
|
}),
|
|
2954
2962
|
/* @__PURE__ */ c("button", {
|
|
2955
2963
|
className: "audio-debug-button audio-debug-button--reset",
|
|
2956
|
-
disabled: _ === "recording" ||
|
|
2957
|
-
onClick:
|
|
2964
|
+
disabled: _ === "recording" || j || !g && !y,
|
|
2965
|
+
onClick: A,
|
|
2958
2966
|
type: "button",
|
|
2959
|
-
children: [/* @__PURE__ */ s(
|
|
2967
|
+
children: [/* @__PURE__ */ s(D, { "aria-hidden": "true" }), /* @__PURE__ */ s("span", { children: "إِعادَةُ المُحاوَلَةِ" })]
|
|
2960
2968
|
})
|
|
2961
2969
|
]
|
|
2962
2970
|
}),
|
|
@@ -2972,31 +2980,31 @@ function zn({ acceptedPronunciations: e, expectedText: n, imageAlt: o, imageSrc:
|
|
|
2972
2980
|
role: "status",
|
|
2973
2981
|
children: [/* @__PURE__ */ c("div", {
|
|
2974
2982
|
className: "audio-pronunciation-feedback__headline",
|
|
2975
|
-
children: [/* @__PURE__ */ s(
|
|
2983
|
+
children: [/* @__PURE__ */ s(Vn, { status: E.status }), /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("strong", { children: qn(E.status) }), /* @__PURE__ */ s("span", { children: Jn(E.status, n) })] })]
|
|
2976
2984
|
}), /* @__PURE__ */ c("div", {
|
|
2977
2985
|
className: "audio-debug-metadata",
|
|
2978
2986
|
children: [
|
|
2979
|
-
/* @__PURE__ */ s(
|
|
2987
|
+
/* @__PURE__ */ s(Hn, {
|
|
2980
2988
|
label: "ما تَعَرَّفَ عَلَيْهِ النَّمُوذَجُ",
|
|
2981
2989
|
value: E.detectedPronunciation || "—"
|
|
2982
2990
|
}),
|
|
2983
|
-
/* @__PURE__ */ s(
|
|
2991
|
+
/* @__PURE__ */ s(Hn, {
|
|
2984
2992
|
label: "نِسْبَةُ التَّطابُقِ",
|
|
2985
2993
|
value: `${E.similarityPercent}%`
|
|
2986
2994
|
}),
|
|
2987
|
-
/* @__PURE__ */ s(
|
|
2995
|
+
/* @__PURE__ */ s(Hn, {
|
|
2988
2996
|
label: "ثِقَةُ النَّمُوذَجِ",
|
|
2989
2997
|
value: `${E.confidencePercent}%`
|
|
2990
2998
|
}),
|
|
2991
|
-
/* @__PURE__ */ s(
|
|
2999
|
+
/* @__PURE__ */ s(Hn, {
|
|
2992
3000
|
label: "اللُّغَةُ",
|
|
2993
3001
|
value: E.language.toUpperCase()
|
|
2994
3002
|
}),
|
|
2995
|
-
/* @__PURE__ */ s(
|
|
3003
|
+
/* @__PURE__ */ s(Hn, {
|
|
2996
3004
|
label: "زَمَنُ التَّحْلِيلِ",
|
|
2997
3005
|
value: `${E.latencyMs} ms`
|
|
2998
3006
|
}),
|
|
2999
|
-
/* @__PURE__ */ s(
|
|
3007
|
+
/* @__PURE__ */ s(Hn, {
|
|
3000
3008
|
label: "عَدَدُ الرُّمُوزِ الصَّوْتِيَّةِ",
|
|
3001
3009
|
value: E.timestamps.length.toString()
|
|
3002
3010
|
})
|
|
@@ -3006,10 +3014,10 @@ function zn({ acceptedPronunciations: e, expectedText: n, imageAlt: o, imageSrc:
|
|
|
3006
3014
|
]
|
|
3007
3015
|
});
|
|
3008
3016
|
}
|
|
3009
|
-
function
|
|
3010
|
-
return s(e === "correct" ? p : e === "no-speech" ?
|
|
3017
|
+
function Vn({ status: e }) {
|
|
3018
|
+
return s(e === "correct" ? p : e === "no-speech" ? te : P, { "aria-hidden": "true" });
|
|
3011
3019
|
}
|
|
3012
|
-
function
|
|
3020
|
+
function Hn({ label: e, value: t }) {
|
|
3013
3021
|
return /* @__PURE__ */ c("span", {
|
|
3014
3022
|
className: "audio-debug-meta-card",
|
|
3015
3023
|
children: [/* @__PURE__ */ s("small", { children: e }), /* @__PURE__ */ s("strong", {
|
|
@@ -3018,42 +3026,42 @@ function Vn({ label: e, value: t }) {
|
|
|
3018
3026
|
})]
|
|
3019
3027
|
});
|
|
3020
3028
|
}
|
|
3021
|
-
function
|
|
3029
|
+
function Un(e) {
|
|
3022
3030
|
let t = Math.max(0, Math.round(e / 1e3)), n = Math.floor(t / 60), r = t % 60;
|
|
3023
3031
|
return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
|
|
3024
3032
|
}
|
|
3025
|
-
function
|
|
3033
|
+
function Wn(e) {
|
|
3026
3034
|
return e === "fr" ? "الفَرَنْسِيَّةِ" : "العَرَبِيَّةِ";
|
|
3027
3035
|
}
|
|
3028
|
-
function
|
|
3036
|
+
function Gn(e) {
|
|
3029
3037
|
let t = e;
|
|
3030
3038
|
return t.code === "MISSING_PERMISSION" ? "يَجِبُ السَّماحُ بِاسْتِعْمالِ المِيكْرُوفُونِ لِتَسْجِيلِ الإِجابَةِ." : t.code === "MODEL_VOCAB_MISMATCH" ? "مَلَفُّ نَمُوذَجِ اللُّغَةِ لا يُطابِقُ قامُوسَهُ. يُرْجى تَصْحِيحُ مَلَفِّ النَّمُوذَجِ." : t.message ? t.message : typeof e == "string" ? e : "حَدَثَ خَطَأٌ أَثْناءَ تَسْجِيلِ الإِجابَةِ الصَّوْتِيَّةِ.";
|
|
3031
3039
|
}
|
|
3032
|
-
function
|
|
3040
|
+
function Kn(e, t) {
|
|
3033
3041
|
return e === "checking" ? "جارِي تَجْهِيزُ المِيكْرُوفُونِ" : e === "recording" ? "جارِي التَّسْجِيلُ... تَكَلَّمِ الآنَ" : e === "processing" ? "جارِي تَحْلِيلُ النُّطْقِ" : e === "error" ? "تَعَذَّرَ تَحْلِيلُ التَّسْجِيلِ" : t ? "اِكْتَمَلَ تَحْلِيلُ الإِجابَةِ" : "المِيكْرُوفُونُ جاهِزٌ";
|
|
3034
3042
|
}
|
|
3035
|
-
function
|
|
3043
|
+
function qn(e) {
|
|
3036
3044
|
return e === "correct" ? "أَحْسَنْتَ! إِجابَةٌ صَحِيحَةٌ" : e === "no-speech" ? "لَمْ نَسْمَعْ كَلِمَةً واضِحَةً" : e === "language-mismatch" ? "اُسْتُعْمِلَ نَمُوذَجُ لُغَةٍ مُخْتَلِفَةٍ" : "حاوِلْ مَرَّةً أُخْرى";
|
|
3037
3045
|
}
|
|
3038
|
-
function
|
|
3046
|
+
function Jn(e, t) {
|
|
3039
3047
|
return e === "correct" ? `نَطَقْتَ «${t}» بِشَكْلٍ صَحِيحٍ.` : e === "no-speech" ? `قَرِّبْ فَمَكَ مِنَ المِيكْرُوفُونِ وَقُلْ «${t}».` : `اِسْتَمِعْ إِلى نُطْقِ «${t}» ثُمَّ أَعِدِ المُحاوَلَةَ.`;
|
|
3040
3048
|
}
|
|
3041
3049
|
//#endregion
|
|
3042
3050
|
//#region src/exam-session/interactions/SortableAnswer.tsx
|
|
3043
|
-
function
|
|
3051
|
+
function Yn({ answerId: e, items: t, value: n, onChange: r }) {
|
|
3044
3052
|
let i = new Map(t.map((e) => [e.id, e])), a = n?.itemIds.length === t.length ? n.itemIds.filter((e) => i.has(e)) : t.map((e) => e.id);
|
|
3045
3053
|
return /* @__PURE__ */ s(l, {
|
|
3046
3054
|
onDragEnd: (e) => {
|
|
3047
3055
|
e.canceled || r({
|
|
3048
3056
|
kind: "order",
|
|
3049
|
-
itemIds:
|
|
3057
|
+
itemIds: U(a, e).map((e) => e.toString())
|
|
3050
3058
|
});
|
|
3051
3059
|
},
|
|
3052
3060
|
children: /* @__PURE__ */ s("div", {
|
|
3053
3061
|
className: "sortable-answer",
|
|
3054
3062
|
children: a.map((t, n) => {
|
|
3055
3063
|
let r = i.get(t);
|
|
3056
|
-
return r ? /* @__PURE__ */ s(
|
|
3064
|
+
return r ? /* @__PURE__ */ s(Xn, {
|
|
3057
3065
|
group: e,
|
|
3058
3066
|
index: n,
|
|
3059
3067
|
item: r
|
|
@@ -3062,8 +3070,8 @@ function Jn({ answerId: e, items: t, value: n, onChange: r }) {
|
|
|
3062
3070
|
})
|
|
3063
3071
|
});
|
|
3064
3072
|
}
|
|
3065
|
-
function
|
|
3066
|
-
let { ref: r, isDragging: i, isDropTarget: a } =
|
|
3073
|
+
function Xn({ group: e, index: t, item: n }) {
|
|
3074
|
+
let { ref: r, isDragging: i, isDropTarget: a } = ce({
|
|
3067
3075
|
id: n.id,
|
|
3068
3076
|
index: t,
|
|
3069
3077
|
group: e,
|
|
@@ -3082,7 +3090,7 @@ function Yn({ group: e, index: t, item: n }) {
|
|
|
3082
3090
|
}
|
|
3083
3091
|
//#endregion
|
|
3084
3092
|
//#region src/exam-session/interactions/TextAnswer.tsx
|
|
3085
|
-
function
|
|
3093
|
+
function Zn({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onChange: i }) {
|
|
3086
3094
|
return /* @__PURE__ */ s("input", {
|
|
3087
3095
|
"aria-label": e,
|
|
3088
3096
|
className: t,
|
|
@@ -3096,17 +3104,17 @@ function Xn({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onCha
|
|
|
3096
3104
|
}
|
|
3097
3105
|
//#endregion
|
|
3098
3106
|
//#region src/renderer/visualScene.tsx
|
|
3099
|
-
var
|
|
3107
|
+
var Qn = {
|
|
3100
3108
|
apple: f,
|
|
3101
3109
|
circle: m,
|
|
3102
3110
|
flower: _,
|
|
3103
3111
|
heart: v,
|
|
3104
3112
|
hexagon: y,
|
|
3105
|
-
square:
|
|
3106
|
-
star:
|
|
3107
|
-
sun:
|
|
3108
|
-
triangle:
|
|
3109
|
-
},
|
|
3113
|
+
square: ee,
|
|
3114
|
+
star: k,
|
|
3115
|
+
sun: A,
|
|
3116
|
+
triangle: M
|
|
3117
|
+
}, $n = {
|
|
3110
3118
|
blue: "#4d89d9",
|
|
3111
3119
|
gray: "#8c97a0",
|
|
3112
3120
|
green: "#1f9d63",
|
|
@@ -3114,7 +3122,7 @@ var Zn = {
|
|
|
3114
3122
|
purple: "#8a63d2",
|
|
3115
3123
|
red: "#eb5b5b",
|
|
3116
3124
|
yellow: "#f2c641"
|
|
3117
|
-
},
|
|
3125
|
+
}, er = {
|
|
3118
3126
|
"counter-rows": { rows: [{
|
|
3119
3127
|
color: "yellow",
|
|
3120
3128
|
count: 5,
|
|
@@ -3141,7 +3149,7 @@ var Zn = {
|
|
|
3141
3149
|
id: "star-row",
|
|
3142
3150
|
state: "plain"
|
|
3143
3151
|
}] }
|
|
3144
|
-
},
|
|
3152
|
+
}, tr = [
|
|
3145
3153
|
{
|
|
3146
3154
|
label: "Cercle",
|
|
3147
3155
|
value: "circle"
|
|
@@ -3178,7 +3186,7 @@ var Zn = {
|
|
|
3178
3186
|
label: "Hexagone",
|
|
3179
3187
|
value: "hexagon"
|
|
3180
3188
|
}
|
|
3181
|
-
],
|
|
3189
|
+
], nr = [
|
|
3182
3190
|
{
|
|
3183
3191
|
label: "Jaune",
|
|
3184
3192
|
value: "yellow"
|
|
@@ -3207,20 +3215,20 @@ var Zn = {
|
|
|
3207
3215
|
label: "Gris",
|
|
3208
3216
|
value: "gray"
|
|
3209
3217
|
}
|
|
3210
|
-
],
|
|
3218
|
+
], rr = [{
|
|
3211
3219
|
label: "Normal",
|
|
3212
3220
|
value: "plain"
|
|
3213
3221
|
}, {
|
|
3214
3222
|
label: "Barre",
|
|
3215
3223
|
value: "crossed"
|
|
3216
3224
|
}];
|
|
3217
|
-
function rr(e) {
|
|
3218
|
-
return { rows: $n[e].rows.map((e) => ({ ...e })) };
|
|
3219
|
-
}
|
|
3220
3225
|
function ir(e) {
|
|
3221
|
-
return
|
|
3226
|
+
return { rows: er[e].rows.map((e) => ({ ...e })) };
|
|
3227
|
+
}
|
|
3228
|
+
function ar(e) {
|
|
3229
|
+
return $n[e];
|
|
3222
3230
|
}
|
|
3223
|
-
function
|
|
3231
|
+
function or({ scene: e }) {
|
|
3224
3232
|
return /* @__PURE__ */ s("div", {
|
|
3225
3233
|
className: "visual-panel visual-panel--custom",
|
|
3226
3234
|
"aria-hidden": "true",
|
|
@@ -3228,7 +3236,7 @@ function ar({ scene: e }) {
|
|
|
3228
3236
|
className: "visual-scene",
|
|
3229
3237
|
children: e.rows.map((e) => /* @__PURE__ */ s("div", {
|
|
3230
3238
|
className: "visual-scene-row",
|
|
3231
|
-
children: Array.from({ length: Math.max(1, Math.floor(e.count) || 1) }, (t, n) => /* @__PURE__ */ s(
|
|
3239
|
+
children: Array.from({ length: Math.max(1, Math.floor(e.count) || 1) }, (t, n) => /* @__PURE__ */ s(sr, {
|
|
3232
3240
|
color: e.color,
|
|
3233
3241
|
icon: e.icon,
|
|
3234
3242
|
state: e.state
|
|
@@ -3237,31 +3245,31 @@ function ar({ scene: e }) {
|
|
|
3237
3245
|
})
|
|
3238
3246
|
});
|
|
3239
3247
|
}
|
|
3240
|
-
function
|
|
3241
|
-
let r =
|
|
3248
|
+
function sr({ color: e, icon: t, state: n }) {
|
|
3249
|
+
let r = Qn[t];
|
|
3242
3250
|
return /* @__PURE__ */ s("span", {
|
|
3243
3251
|
className: n === "crossed" ? "visual-scene-icon visual-scene-icon--crossed" : "visual-scene-icon",
|
|
3244
|
-
style: { color:
|
|
3252
|
+
style: { color: ar(e) },
|
|
3245
3253
|
children: /* @__PURE__ */ s(r, { "aria-hidden": "true" })
|
|
3246
3254
|
});
|
|
3247
3255
|
}
|
|
3248
3256
|
//#endregion
|
|
3249
3257
|
//#region src/renderer/contentDirection.ts
|
|
3250
|
-
var
|
|
3251
|
-
function lr(e) {
|
|
3252
|
-
return e === "rtl" || e === "ltr" || e === "auto" ? e : "auto";
|
|
3253
|
-
}
|
|
3258
|
+
var cr = /[\u0590-\u08ff\ufb1d-\ufdff\ufe70-\ufeff]/, lr = /[A-Za-z\u00c0-\u024f]/;
|
|
3254
3259
|
function ur(e) {
|
|
3255
|
-
|
|
3256
|
-
return t === "auto" ? dr(fr(e)) ?? "ltr" : t;
|
|
3260
|
+
return e === "rtl" || e === "ltr" || e === "auto" ? e : "auto";
|
|
3257
3261
|
}
|
|
3258
3262
|
function dr(e) {
|
|
3263
|
+
let t = ur(e.contentDirection);
|
|
3264
|
+
return t === "auto" ? fr(pr(e)) ?? "ltr" : t;
|
|
3265
|
+
}
|
|
3266
|
+
function fr(e) {
|
|
3259
3267
|
for (let t of e) for (let e of t) {
|
|
3260
|
-
if (
|
|
3261
|
-
if (
|
|
3268
|
+
if (cr.test(e)) return "rtl";
|
|
3269
|
+
if (lr.test(e)) return "ltr";
|
|
3262
3270
|
}
|
|
3263
3271
|
}
|
|
3264
|
-
function
|
|
3272
|
+
function pr(e) {
|
|
3265
3273
|
let t = [e.prompt];
|
|
3266
3274
|
switch (e.type) {
|
|
3267
3275
|
case "inline-inputs":
|
|
@@ -3299,19 +3307,19 @@ function fr(e) {
|
|
|
3299
3307
|
}
|
|
3300
3308
|
//#endregion
|
|
3301
3309
|
//#region src/renderer/QuestionRenderer.tsx
|
|
3302
|
-
function
|
|
3303
|
-
let a =
|
|
3310
|
+
function mr({ adapters: e, clearAnswer: t, question: n, getAnswer: r, updateAnswer: i }) {
|
|
3311
|
+
let a = dr(n);
|
|
3304
3312
|
return /* @__PURE__ */ c("article", {
|
|
3305
3313
|
className: `question-block question-block--${n.type} question-block--${a}`,
|
|
3306
3314
|
dir: a,
|
|
3307
3315
|
lang: a === "rtl" ? "ar" : "fr",
|
|
3308
|
-
children: [/* @__PURE__ */ s(
|
|
3316
|
+
children: [/* @__PURE__ */ s(gr, {
|
|
3309
3317
|
number: n.number,
|
|
3310
3318
|
prompt: n.prompt
|
|
3311
|
-
}),
|
|
3319
|
+
}), _r(n, r, i, t, e)]
|
|
3312
3320
|
});
|
|
3313
3321
|
}
|
|
3314
|
-
function
|
|
3322
|
+
function hr({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswer: i }) {
|
|
3315
3323
|
return /* @__PURE__ */ c("section", {
|
|
3316
3324
|
className: `question-section question-section--${n.tone}`,
|
|
3317
3325
|
children: [/* @__PURE__ */ c("header", {
|
|
@@ -3319,7 +3327,7 @@ function mr({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
|
|
|
3319
3327
|
children: [
|
|
3320
3328
|
/* @__PURE__ */ c("span", {
|
|
3321
3329
|
className: "section-points",
|
|
3322
|
-
children: [/* @__PURE__ */ s("small", { children: "ن" }),
|
|
3330
|
+
children: [/* @__PURE__ */ s("small", { children: "ن" }), K(n)]
|
|
3323
3331
|
}),
|
|
3324
3332
|
/* @__PURE__ */ s("h3", { children: n.title }),
|
|
3325
3333
|
/* @__PURE__ */ s("span", {
|
|
@@ -3329,7 +3337,7 @@ function mr({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
|
|
|
3329
3337
|
]
|
|
3330
3338
|
}), /* @__PURE__ */ s("div", {
|
|
3331
3339
|
className: "section-body",
|
|
3332
|
-
children: n.questions.map((n) => /* @__PURE__ */ s(
|
|
3340
|
+
children: n.questions.map((n) => /* @__PURE__ */ s(mr, {
|
|
3333
3341
|
adapters: e,
|
|
3334
3342
|
clearAnswer: t,
|
|
3335
3343
|
getAnswer: r,
|
|
@@ -3339,17 +3347,17 @@ function mr({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
|
|
|
3339
3347
|
})]
|
|
3340
3348
|
});
|
|
3341
3349
|
}
|
|
3342
|
-
function
|
|
3350
|
+
function gr({ number: e, prompt: t }) {
|
|
3343
3351
|
return /* @__PURE__ */ c("div", {
|
|
3344
3352
|
className: "question-prompt",
|
|
3345
3353
|
children: [e > 0 ? /* @__PURE__ */ s("span", { children: e }) : null, /* @__PURE__ */ s("strong", { children: t })]
|
|
3346
3354
|
});
|
|
3347
3355
|
}
|
|
3348
|
-
function
|
|
3356
|
+
function _r(e, t, n, r, i) {
|
|
3349
3357
|
switch (e.type) {
|
|
3350
3358
|
case "inline-inputs": return /* @__PURE__ */ s("div", {
|
|
3351
3359
|
className: "inline-equation-grid",
|
|
3352
|
-
children: e.items.map((a) =>
|
|
3360
|
+
children: e.items.map((a) => vr({
|
|
3353
3361
|
adapters: i,
|
|
3354
3362
|
className: "equation-card",
|
|
3355
3363
|
clearAnswer: r,
|
|
@@ -3359,20 +3367,20 @@ function gr(e, t, n, r, i) {
|
|
|
3359
3367
|
updateAnswer: n
|
|
3360
3368
|
}))
|
|
3361
3369
|
});
|
|
3362
|
-
case "visual-choice": return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(
|
|
3370
|
+
case "visual-choice": return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(Hr, {
|
|
3363
3371
|
choices: e.choices,
|
|
3364
3372
|
onChange: (t) => n(e.id, t),
|
|
3365
3373
|
scene: e.scene,
|
|
3366
|
-
value:
|
|
3374
|
+
value: Sr(t(e.id)),
|
|
3367
3375
|
visual: e.visual
|
|
3368
3376
|
}), e.inputLabel ? /* @__PURE__ */ c("div", {
|
|
3369
3377
|
className: "compact-answer",
|
|
3370
|
-
children: [/* @__PURE__ */ s("span", { children: e.inputLabel }), /* @__PURE__ */ s(
|
|
3378
|
+
children: [/* @__PURE__ */ s("span", { children: e.inputLabel }), /* @__PURE__ */ s(ot, {
|
|
3371
3379
|
ariaLabel: e.inputLabel,
|
|
3372
3380
|
onChange: (t) => n(`${e.id}:input`, t),
|
|
3373
3381
|
onClear: () => r(`${e.id}:input`),
|
|
3374
3382
|
recognizer: i?.handwritingRecognizer,
|
|
3375
|
-
value:
|
|
3383
|
+
value: br(t(`${e.id}:input`))
|
|
3376
3384
|
})]
|
|
3377
3385
|
}) : null] });
|
|
3378
3386
|
case "number-line": return /* @__PURE__ */ s(rn, {
|
|
@@ -3381,10 +3389,10 @@ function gr(e, t, n, r, i) {
|
|
|
3381
3389
|
onClear: r,
|
|
3382
3390
|
onChange: n,
|
|
3383
3391
|
recognizer: i?.handwritingRecognizer,
|
|
3384
|
-
value:
|
|
3392
|
+
value: br(t(e.id))
|
|
3385
3393
|
});
|
|
3386
3394
|
case "operation-solving": {
|
|
3387
|
-
let a =
|
|
3395
|
+
let a = kr(e);
|
|
3388
3396
|
return /* @__PURE__ */ c("div", {
|
|
3389
3397
|
className: [
|
|
3390
3398
|
"operation-solving",
|
|
@@ -3393,8 +3401,8 @@ function gr(e, t, n, r, i) {
|
|
|
3393
3401
|
].join(" "),
|
|
3394
3402
|
children: [a === "equation-card-grid" ? /* @__PURE__ */ s("div", {
|
|
3395
3403
|
className: "operation-solving__equation-card",
|
|
3396
|
-
children: /* @__PURE__ */ s("span", { children:
|
|
3397
|
-
}) : null, /* @__PURE__ */ s(
|
|
3404
|
+
children: /* @__PURE__ */ s("span", { children: Or(e) })
|
|
3405
|
+
}) : null, /* @__PURE__ */ s(Ar, {
|
|
3398
3406
|
adapters: i,
|
|
3399
3407
|
clearAnswer: r,
|
|
3400
3408
|
getAnswer: t,
|
|
@@ -3407,7 +3415,7 @@ function gr(e, t, n, r, i) {
|
|
|
3407
3415
|
}
|
|
3408
3416
|
case "equation-inputs": return /* @__PURE__ */ s("div", {
|
|
3409
3417
|
className: "stacked-equations",
|
|
3410
|
-
children: e.items.map((a) =>
|
|
3418
|
+
children: e.items.map((a) => vr({
|
|
3411
3419
|
adapters: i,
|
|
3412
3420
|
ariaPrefix: e.prompt,
|
|
3413
3421
|
className: "wide-equation-card",
|
|
@@ -3418,7 +3426,7 @@ function gr(e, t, n, r, i) {
|
|
|
3418
3426
|
updateAnswer: n
|
|
3419
3427
|
}))
|
|
3420
3428
|
});
|
|
3421
|
-
case "length-estimation": return /* @__PURE__ */ s(
|
|
3429
|
+
case "length-estimation": return /* @__PURE__ */ s(Ur, {
|
|
3422
3430
|
answerId: e.id,
|
|
3423
3431
|
choices: e.choices,
|
|
3424
3432
|
getAnswer: t,
|
|
@@ -3427,7 +3435,7 @@ function gr(e, t, n, r, i) {
|
|
|
3427
3435
|
});
|
|
3428
3436
|
case "shape-choice": return /* @__PURE__ */ c("div", {
|
|
3429
3437
|
className: "shape-choice-layout",
|
|
3430
|
-
children: [/* @__PURE__ */ s(
|
|
3438
|
+
children: [/* @__PURE__ */ s(et, {
|
|
3431
3439
|
items: e.choices.map((e) => ({
|
|
3432
3440
|
id: `${e.id}-label`,
|
|
3433
3441
|
label: e.label
|
|
@@ -3435,9 +3443,9 @@ function gr(e, t, n, r, i) {
|
|
|
3435
3443
|
onChange: (t) => n(e.id, t),
|
|
3436
3444
|
targets: e.choices.map((e) => ({
|
|
3437
3445
|
id: `${e.id}-target`,
|
|
3438
|
-
label:
|
|
3446
|
+
label: Br(e.id)
|
|
3439
3447
|
})),
|
|
3440
|
-
value:
|
|
3448
|
+
value: Sr(t(e.id))
|
|
3441
3449
|
}), /* @__PURE__ */ s("div", {
|
|
3442
3450
|
className: "shape-row",
|
|
3443
3451
|
"aria-hidden": "true",
|
|
@@ -3447,12 +3455,12 @@ function gr(e, t, n, r, i) {
|
|
|
3447
3455
|
case "drawing-grid": return /* @__PURE__ */ s($t, {
|
|
3448
3456
|
onChange: (t) => n(e.id, t),
|
|
3449
3457
|
points: e.points,
|
|
3450
|
-
value:
|
|
3458
|
+
value: Tr(t(e.id))
|
|
3451
3459
|
});
|
|
3452
|
-
case "table-response": return /* @__PURE__ */ s(
|
|
3460
|
+
case "table-response": return /* @__PURE__ */ s(Je, {
|
|
3453
3461
|
columns: e.columns,
|
|
3454
3462
|
onChange: (t) => n(e.id, t),
|
|
3455
|
-
value:
|
|
3463
|
+
value: Er(t(e.id))
|
|
3456
3464
|
});
|
|
3457
3465
|
case "text-input": return e.before && !e.after && e.number === 0 ? /* @__PURE__ */ s("p", {
|
|
3458
3466
|
className: "problem-statement",
|
|
@@ -3461,12 +3469,12 @@ function gr(e, t, n, r, i) {
|
|
|
3461
3469
|
className: "sentence-answer",
|
|
3462
3470
|
children: [
|
|
3463
3471
|
e.before ? /* @__PURE__ */ s("span", { children: e.before }) : null,
|
|
3464
|
-
/* @__PURE__ */ s(
|
|
3472
|
+
/* @__PURE__ */ s(ot, {
|
|
3465
3473
|
ariaLabel: e.prompt,
|
|
3466
3474
|
onChange: (t) => n(e.id, t),
|
|
3467
3475
|
onClear: () => r(e.id),
|
|
3468
3476
|
recognizer: i?.handwritingRecognizer,
|
|
3469
|
-
value:
|
|
3477
|
+
value: br(t(e.id))
|
|
3470
3478
|
}),
|
|
3471
3479
|
e.after ? /* @__PURE__ */ s("span", { children: e.after }) : null
|
|
3472
3480
|
]
|
|
@@ -3480,10 +3488,10 @@ function gr(e, t, n, r, i) {
|
|
|
3480
3488
|
className: "problem-statement word-problem__situation",
|
|
3481
3489
|
children: e.situation
|
|
3482
3490
|
}),
|
|
3483
|
-
/* @__PURE__ */ s(
|
|
3491
|
+
/* @__PURE__ */ s(jn, { config: a }),
|
|
3484
3492
|
/* @__PURE__ */ s("div", {
|
|
3485
3493
|
className: "word-problem__parts",
|
|
3486
|
-
children: e.parts.map((a, o) => /* @__PURE__ */ s(
|
|
3494
|
+
children: e.parts.map((a, o) => /* @__PURE__ */ s(Rr, {
|
|
3487
3495
|
adapters: i,
|
|
3488
3496
|
clearAnswer: r,
|
|
3489
3497
|
getAnswer: t,
|
|
@@ -3496,25 +3504,25 @@ function gr(e, t, n, r, i) {
|
|
|
3496
3504
|
]
|
|
3497
3505
|
});
|
|
3498
3506
|
}
|
|
3499
|
-
case "drag-match": return /* @__PURE__ */ s(
|
|
3507
|
+
case "drag-match": return /* @__PURE__ */ s(et, {
|
|
3500
3508
|
items: e.items,
|
|
3501
3509
|
onChange: (t) => n(e.id, t),
|
|
3502
3510
|
targets: e.targets,
|
|
3503
|
-
value:
|
|
3511
|
+
value: Sr(t(e.id))
|
|
3504
3512
|
});
|
|
3505
|
-
case "sortable-answer": return /* @__PURE__ */ s(
|
|
3513
|
+
case "sortable-answer": return /* @__PURE__ */ s(Yn, {
|
|
3506
3514
|
answerId: e.id,
|
|
3507
3515
|
items: e.items,
|
|
3508
3516
|
onChange: (t) => n(e.id, t),
|
|
3509
|
-
value:
|
|
3517
|
+
value: Cr(t(e.id))
|
|
3510
3518
|
});
|
|
3511
3519
|
case "label-placement": return /* @__PURE__ */ s(en, {
|
|
3512
3520
|
labels: e.labels,
|
|
3513
3521
|
onChange: (t) => n(e.id, t),
|
|
3514
3522
|
targets: e.targets,
|
|
3515
|
-
value:
|
|
3523
|
+
value: wr(t(e.id))
|
|
3516
3524
|
});
|
|
3517
|
-
case "audio-recording": return /* @__PURE__ */ s(
|
|
3525
|
+
case "audio-recording": return /* @__PURE__ */ s(Bn, {
|
|
3518
3526
|
acceptedPronunciations: e.acceptedPronunciations,
|
|
3519
3527
|
expectedText: e.expectedAnswer,
|
|
3520
3528
|
imageAlt: e.imageAlt,
|
|
@@ -3525,21 +3533,21 @@ function gr(e, t, n, r, i) {
|
|
|
3525
3533
|
onChange: (t) => n(e.id, t),
|
|
3526
3534
|
onReset: () => r(e.id),
|
|
3527
3535
|
recorder: i?.audioRecorder,
|
|
3528
|
-
value:
|
|
3536
|
+
value: Dr(t(e.id))
|
|
3529
3537
|
});
|
|
3530
3538
|
}
|
|
3531
3539
|
}
|
|
3532
|
-
function
|
|
3540
|
+
function vr({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswer: a, item: o, questionId: l, updateAnswer: u }) {
|
|
3533
3541
|
if (o.answers?.length) return /* @__PURE__ */ c("div", {
|
|
3534
3542
|
className: r,
|
|
3535
3543
|
children: [o.answers.map((r) => {
|
|
3536
3544
|
let d = `${l}:${o.id}:${r.id}`, f = [n, r.before].filter(Boolean).join(" ");
|
|
3537
|
-
return /* @__PURE__ */ c(e, { children: [r.before ? /* @__PURE__ */ s("span", { children: r.before }) : null, /* @__PURE__ */ s(
|
|
3545
|
+
return /* @__PURE__ */ c(e, { children: [r.before ? /* @__PURE__ */ s("span", { children: r.before }) : null, /* @__PURE__ */ s(ot, {
|
|
3538
3546
|
ariaLabel: f,
|
|
3539
3547
|
onChange: (e) => u(d, e),
|
|
3540
3548
|
onClear: () => i(d),
|
|
3541
3549
|
recognizer: t?.handwritingRecognizer,
|
|
3542
|
-
value:
|
|
3550
|
+
value: br(a(d))
|
|
3543
3551
|
})] }, r.id);
|
|
3544
3552
|
}), o.after ? /* @__PURE__ */ s("span", { children: o.after }) : null]
|
|
3545
3553
|
}, o.id);
|
|
@@ -3552,57 +3560,55 @@ function _r({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswe
|
|
|
3552
3560
|
className: r,
|
|
3553
3561
|
children: [
|
|
3554
3562
|
/* @__PURE__ */ s("span", { children: o.before }),
|
|
3555
|
-
/* @__PURE__ */ s(
|
|
3563
|
+
/* @__PURE__ */ s(ot, {
|
|
3556
3564
|
ariaLabel: [n, o.before].filter(Boolean).join(" "),
|
|
3557
3565
|
onChange: (e) => u(d, e),
|
|
3558
3566
|
onClear: () => i(d),
|
|
3559
3567
|
recognizer: t?.handwritingRecognizer,
|
|
3560
|
-
value:
|
|
3568
|
+
value: br(a(d))
|
|
3561
3569
|
}),
|
|
3562
3570
|
o.after ? /* @__PURE__ */ s("span", { children: o.after }) : null
|
|
3563
3571
|
]
|
|
3564
3572
|
}, o.id);
|
|
3565
3573
|
}
|
|
3566
|
-
function vr(e) {
|
|
3567
|
-
return e?.kind === "text" ? e : void 0;
|
|
3568
|
-
}
|
|
3569
3574
|
function yr(e) {
|
|
3570
|
-
return e?.kind === "
|
|
3575
|
+
return e?.kind === "text" ? e : void 0;
|
|
3571
3576
|
}
|
|
3572
3577
|
function br(e) {
|
|
3573
|
-
return e?.kind === "
|
|
3578
|
+
return e?.kind === "handwritten-number" ? e : void 0;
|
|
3574
3579
|
}
|
|
3575
3580
|
function xr(e) {
|
|
3576
|
-
return e?.kind === "
|
|
3581
|
+
return e?.kind === "choice" ? e : void 0;
|
|
3577
3582
|
}
|
|
3578
3583
|
function Sr(e) {
|
|
3579
|
-
return e?.kind === "
|
|
3584
|
+
return e?.kind === "matches" ? e : void 0;
|
|
3580
3585
|
}
|
|
3581
3586
|
function Cr(e) {
|
|
3582
|
-
return e?.kind === "
|
|
3587
|
+
return e?.kind === "order" ? e : void 0;
|
|
3583
3588
|
}
|
|
3584
3589
|
function wr(e) {
|
|
3585
|
-
return e?.kind === "
|
|
3590
|
+
return e?.kind === "placements" ? e : void 0;
|
|
3586
3591
|
}
|
|
3587
3592
|
function Tr(e) {
|
|
3588
|
-
return e?.kind === "
|
|
3593
|
+
return e?.kind === "drawing" ? e : void 0;
|
|
3589
3594
|
}
|
|
3590
3595
|
function Er(e) {
|
|
3591
|
-
return e?.kind === "
|
|
3596
|
+
return e?.kind === "coin-table" ? e : void 0;
|
|
3592
3597
|
}
|
|
3593
3598
|
function Dr(e) {
|
|
3594
|
-
return
|
|
3599
|
+
return e?.kind === "audio-recording" ? e : void 0;
|
|
3595
3600
|
}
|
|
3596
3601
|
function Or(e) {
|
|
3597
|
-
return e.
|
|
3602
|
+
return `${q(e.leftOperand)} ${e.operator} ${q(e.rightOperand)} =`;
|
|
3603
|
+
}
|
|
3604
|
+
function kr(e) {
|
|
3605
|
+
return e.operator === "÷" || e.layout === "equation-card-grid" || e.solutionMode === "full-process" ? "equation-card-grid" : "vertical-operation";
|
|
3598
3606
|
}
|
|
3599
|
-
function
|
|
3600
|
-
if (r.operator === "÷") return /* @__PURE__ */ s(
|
|
3601
|
-
adapters: e,
|
|
3607
|
+
function Ar({ adapters: e, clearAnswer: t, getAnswer: n, question: r, showOperands: i, showWorkArea: a, updateAnswer: o }) {
|
|
3608
|
+
if (r.operator === "÷") return /* @__PURE__ */ s(jr, {
|
|
3602
3609
|
clearAnswer: t,
|
|
3603
3610
|
getAnswer: n,
|
|
3604
3611
|
question: r,
|
|
3605
|
-
showOperands: i,
|
|
3606
3612
|
updateAnswer: o
|
|
3607
3613
|
});
|
|
3608
3614
|
if (a) return /* @__PURE__ */ s(ln, {
|
|
@@ -3612,13 +3618,13 @@ function kr({ adapters: e, clearAnswer: t, getAnswer: n, question: r, showOperan
|
|
|
3612
3618
|
onClear: () => t(`${r.id}:work`),
|
|
3613
3619
|
operation: r.operator,
|
|
3614
3620
|
placeholder: "",
|
|
3615
|
-
value:
|
|
3621
|
+
value: Tr(n(`${r.id}:work`))
|
|
3616
3622
|
});
|
|
3617
|
-
let l =
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
]), u = l.columns, d = a ?
|
|
3623
|
+
let l = Mr([
|
|
3624
|
+
q(r.leftOperand),
|
|
3625
|
+
q(r.rightOperand),
|
|
3626
|
+
q(r.correctAnswer)
|
|
3627
|
+
]), u = l.columns, d = a ? Lr(u) : u, f = Nr(q(r.leftOperand), l, d), p = Nr(q(r.rightOperand), l, d), m = Ir(r, u);
|
|
3622
3628
|
return /* @__PURE__ */ c("div", {
|
|
3623
3629
|
className: [
|
|
3624
3630
|
"vertical-operation",
|
|
@@ -3635,7 +3641,7 @@ function kr({ adapters: e, clearAnswer: t, getAnswer: n, question: r, showOperan
|
|
|
3635
3641
|
onChange: (e) => o(`${r.id}:work`, e),
|
|
3636
3642
|
onClear: () => t(`${r.id}:work`),
|
|
3637
3643
|
placeholder: "",
|
|
3638
|
-
value:
|
|
3644
|
+
value: Tr(n(`${r.id}:work`))
|
|
3639
3645
|
})
|
|
3640
3646
|
}) : null,
|
|
3641
3647
|
/* @__PURE__ */ c("div", {
|
|
@@ -3667,48 +3673,33 @@ function kr({ adapters: e, clearAnswer: t, getAnswer: n, question: r, showOperan
|
|
|
3667
3673
|
children: [/* @__PURE__ */ s("span", {
|
|
3668
3674
|
className: "vertical-operation__answer-label",
|
|
3669
3675
|
children: "النَّتِيجَةُ"
|
|
3670
|
-
}), /* @__PURE__ */ s(
|
|
3676
|
+
}), /* @__PURE__ */ s(ot, {
|
|
3671
3677
|
ariaLabel: "اكتب نتيجة العملية",
|
|
3672
3678
|
canvasWidth: m,
|
|
3673
3679
|
onChange: (e) => o(r.id, e),
|
|
3674
3680
|
onClear: () => t(r.id),
|
|
3675
3681
|
recognizer: e?.handwritingRecognizer,
|
|
3676
|
-
value:
|
|
3682
|
+
value: br(n(r.id))
|
|
3677
3683
|
})]
|
|
3678
3684
|
})
|
|
3679
3685
|
]
|
|
3680
3686
|
});
|
|
3681
3687
|
}
|
|
3682
|
-
function
|
|
3683
|
-
|
|
3684
|
-
return /* @__PURE__ */ c("div", {
|
|
3688
|
+
function jr({ clearAnswer: e, getAnswer: t, question: n, updateAnswer: r }) {
|
|
3689
|
+
return /* @__PURE__ */ s("div", {
|
|
3685
3690
|
className: "division-operation",
|
|
3686
|
-
children:
|
|
3691
|
+
children: /* @__PURE__ */ s(ln, {
|
|
3687
3692
|
ariaLabel: "مساحة إنجاز القسمة",
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
} : void 0,
|
|
3692
|
-
gridVariant: "division-worksheet",
|
|
3693
|
-
onChange: (e) => a(`${r.id}:work`, e),
|
|
3694
|
-
onClear: () => t(`${r.id}:work`),
|
|
3693
|
+
gridVariant: "division-workspace",
|
|
3694
|
+
onChange: (e) => r(`${n.id}:work`, e),
|
|
3695
|
+
onClear: () => e(`${n.id}:work`),
|
|
3695
3696
|
placeholder: "",
|
|
3696
|
-
value:
|
|
3697
|
-
})
|
|
3698
|
-
className: "division-operation__quotient",
|
|
3699
|
-
children: /* @__PURE__ */ s(Y, {
|
|
3700
|
-
ariaLabel: "اكتب حاصل القسمة",
|
|
3701
|
-
canvasWidth: o,
|
|
3702
|
-
onChange: (e) => a(r.id, e),
|
|
3703
|
-
onClear: () => t(r.id),
|
|
3704
|
-
recognizer: e?.handwritingRecognizer,
|
|
3705
|
-
value: yr(n(r.id))
|
|
3706
|
-
})
|
|
3707
|
-
})]
|
|
3697
|
+
value: Tr(t(`${n.id}:work`))
|
|
3698
|
+
})
|
|
3708
3699
|
});
|
|
3709
3700
|
}
|
|
3710
|
-
function
|
|
3711
|
-
let t = e.map(
|
|
3701
|
+
function Mr(e) {
|
|
3702
|
+
let t = e.map(Fr), n = t.some((e) => e.separator.length > 0), r = Math.max(...t.map((e) => e.whole.length), 1), i = n ? Math.max(...t.map((e) => e.fraction.length), 0) : 0;
|
|
3712
3703
|
return {
|
|
3713
3704
|
columns: Math.max(n ? r + 1 + i : r, 2),
|
|
3714
3705
|
fractionColumns: i,
|
|
@@ -3716,8 +3707,8 @@ function jr(e) {
|
|
|
3716
3707
|
wholeColumns: r
|
|
3717
3708
|
};
|
|
3718
3709
|
}
|
|
3719
|
-
function
|
|
3720
|
-
let r =
|
|
3710
|
+
function Nr(e, t, n = t.columns) {
|
|
3711
|
+
let r = Fr(e), i = Math.max(0, t.wholeColumns - r.whole.length), a = t.hasDecimal ? [
|
|
3721
3712
|
...Array.from({ length: i }, () => ""),
|
|
3722
3713
|
...Array.from(r.whole),
|
|
3723
3714
|
r.separator,
|
|
@@ -3726,12 +3717,12 @@ function Mr(e, t, n = t.columns) {
|
|
|
3726
3717
|
] : [...Array.from({ length: i }, () => ""), ...Array.from(r.whole)];
|
|
3727
3718
|
return [...Array.from({ length: Math.max(0, n - a.length) }, () => ""), ...a];
|
|
3728
3719
|
}
|
|
3729
|
-
function
|
|
3730
|
-
let t =
|
|
3720
|
+
function Pr(e) {
|
|
3721
|
+
let t = q(e).trim();
|
|
3731
3722
|
return t.length > 0 ? Array.from(t) : [""];
|
|
3732
3723
|
}
|
|
3733
|
-
function
|
|
3734
|
-
let t =
|
|
3724
|
+
function Fr(e) {
|
|
3725
|
+
let t = q(e).trim(), n = t.indexOf(",");
|
|
3735
3726
|
return n < 0 ? {
|
|
3736
3727
|
fraction: "",
|
|
3737
3728
|
separator: "",
|
|
@@ -3742,27 +3733,27 @@ function Pr(e) {
|
|
|
3742
3733
|
whole: t.slice(0, n)
|
|
3743
3734
|
};
|
|
3744
3735
|
}
|
|
3745
|
-
function
|
|
3746
|
-
let n =
|
|
3736
|
+
function Ir(e, t) {
|
|
3737
|
+
let n = Pr(e.correctAnswer).length;
|
|
3747
3738
|
return Math.min(640, Math.max(220, Math.max(t, n, 2) * 102));
|
|
3748
3739
|
}
|
|
3749
|
-
function
|
|
3740
|
+
function Lr(e) {
|
|
3750
3741
|
return Math.max(e + 2, 5);
|
|
3751
3742
|
}
|
|
3752
|
-
function
|
|
3743
|
+
function Rr({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, part: i, partNumber: a, updateAnswer: o }) {
|
|
3753
3744
|
let l = `${r}:${i.id}`;
|
|
3754
3745
|
return /* @__PURE__ */ c("section", {
|
|
3755
3746
|
className: "word-problem-part",
|
|
3756
3747
|
children: [/* @__PURE__ */ c("div", {
|
|
3757
3748
|
className: "word-problem-part__prompt",
|
|
3758
3749
|
children: [/* @__PURE__ */ s("span", { children: a }), /* @__PURE__ */ s("strong", { children: i.prompt })]
|
|
3759
|
-
}), i.type === "coin-table" ? /* @__PURE__ */ s(
|
|
3750
|
+
}), i.type === "coin-table" ? /* @__PURE__ */ s(Je, {
|
|
3760
3751
|
columns: i.columns,
|
|
3761
3752
|
onChange: (e) => o(l, e),
|
|
3762
|
-
value:
|
|
3753
|
+
value: Er(n(l))
|
|
3763
3754
|
}) : i.type === "table" ? /* @__PURE__ */ s("div", {
|
|
3764
3755
|
className: "word-problem-table",
|
|
3765
|
-
style:
|
|
3756
|
+
style: zr(i),
|
|
3766
3757
|
children: i.cells.map((e) => {
|
|
3767
3758
|
let t = `${l}:${e.id}`, r = i.hasHeaderRow && e.row === 0, a = !r && e.mode !== "static";
|
|
3768
3759
|
return /* @__PURE__ */ c("div", {
|
|
@@ -3775,11 +3766,11 @@ function Lr({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, pa
|
|
|
3775
3766
|
gridColumn: e.column + 1,
|
|
3776
3767
|
gridRow: e.row + 1
|
|
3777
3768
|
},
|
|
3778
|
-
children: [(r || e.mode !== "student") && e.initialText ? /* @__PURE__ */ s("span", { children: e.initialText }) : null, a ? /* @__PURE__ */ s(
|
|
3769
|
+
children: [(r || e.mode !== "student") && e.initialText ? /* @__PURE__ */ s("span", { children: e.initialText }) : null, a ? /* @__PURE__ */ s(Zn, {
|
|
3779
3770
|
ariaLabel: `${i.prompt} ${e.row + 1}-${e.column + 1}`,
|
|
3780
3771
|
className: "word-problem-table__answer",
|
|
3781
3772
|
onChange: (e) => o(t, e),
|
|
3782
|
-
value:
|
|
3773
|
+
value: yr(n(t))
|
|
3783
3774
|
}) : null]
|
|
3784
3775
|
}, e.id);
|
|
3785
3776
|
})
|
|
@@ -3787,31 +3778,31 @@ function Lr({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, pa
|
|
|
3787
3778
|
className: "sentence-answer word-problem-part__sentence",
|
|
3788
3779
|
children: [
|
|
3789
3780
|
i.before ? /* @__PURE__ */ s("span", { children: i.before }) : null,
|
|
3790
|
-
/* @__PURE__ */ s(
|
|
3781
|
+
/* @__PURE__ */ s(ot, {
|
|
3791
3782
|
ariaLabel: i.prompt,
|
|
3792
3783
|
onChange: (e) => o(l, e),
|
|
3793
3784
|
onClear: () => t(l),
|
|
3794
3785
|
recognizer: e?.handwritingRecognizer,
|
|
3795
|
-
value:
|
|
3786
|
+
value: br(n(l))
|
|
3796
3787
|
}),
|
|
3797
3788
|
i.after ? /* @__PURE__ */ s("span", { children: i.after }) : null
|
|
3798
3789
|
]
|
|
3799
3790
|
})]
|
|
3800
3791
|
});
|
|
3801
3792
|
}
|
|
3802
|
-
function
|
|
3793
|
+
function zr(e) {
|
|
3803
3794
|
let t = Array.from({ length: e.columnCount }, (t, n) => Math.max(1, e.columnWidths[n] ?? 1)), n = Array.from({ length: e.rowCount }, (t, n) => Math.max(44, e.rowHeights[n] ?? 64));
|
|
3804
3795
|
return {
|
|
3805
3796
|
gridTemplateColumns: t.map((e) => `minmax(78px, ${e}fr)`).join(" "),
|
|
3806
3797
|
gridTemplateRows: n.map((e) => `${e}px`).join(" ")
|
|
3807
3798
|
};
|
|
3808
3799
|
}
|
|
3809
|
-
function
|
|
3800
|
+
function Br(e) {
|
|
3810
3801
|
return e === "triangle" ? "△" : e === "square" ? "□" : e === "rectangle" ? "▭" : e;
|
|
3811
3802
|
}
|
|
3812
|
-
var
|
|
3813
|
-
function
|
|
3814
|
-
let u = i(null), d = i(null), f = i(null), p = i({}), m = i(null), h = o?.pairs[
|
|
3803
|
+
var Vr = "picture";
|
|
3804
|
+
function Hr({ choices: e, onChange: n, scene: r, value: o, visual: l }) {
|
|
3805
|
+
let u = i(null), d = i(null), f = i(null), p = i({}), m = i(null), h = o?.pairs[Vr], [g, _] = a(null), [v, y] = a(null);
|
|
3815
3806
|
function b(e, t) {
|
|
3816
3807
|
let n = d.current;
|
|
3817
3808
|
if (n) {
|
|
@@ -3886,7 +3877,7 @@ function Vr({ choices: e, onChange: n, scene: r, value: o, visual: l }) {
|
|
|
3886
3877
|
let r = E(e.clientX, e.clientY);
|
|
3887
3878
|
r && n({
|
|
3888
3879
|
kind: "matches",
|
|
3889
|
-
pairs: { [
|
|
3880
|
+
pairs: { [Vr]: r }
|
|
3890
3881
|
}), m.current = null, y(null);
|
|
3891
3882
|
}
|
|
3892
3883
|
function T(e, t, n) {
|
|
@@ -3921,7 +3912,7 @@ function Vr({ choices: e, onChange: n, scene: r, value: o, visual: l }) {
|
|
|
3921
3912
|
}),
|
|
3922
3913
|
/* @__PURE__ */ c("div", {
|
|
3923
3914
|
className: "visual-match-picture",
|
|
3924
|
-
children: [/* @__PURE__ */ s(
|
|
3915
|
+
children: [/* @__PURE__ */ s(or, { scene: r ?? ir(l) }), /* @__PURE__ */ s("button", {
|
|
3925
3916
|
"aria-label": "اربط الصورة بالإجابة",
|
|
3926
3917
|
className: h ? "visual-match-point visual-match-point--target visual-match-point--target-active" : "visual-match-point visual-match-point--target",
|
|
3927
3918
|
onPointerCancel: w,
|
|
@@ -3953,7 +3944,7 @@ function Vr({ choices: e, onChange: n, scene: r, value: o, visual: l }) {
|
|
|
3953
3944
|
]
|
|
3954
3945
|
});
|
|
3955
3946
|
}
|
|
3956
|
-
function
|
|
3947
|
+
function Ur({ answerId: e, choices: t, getAnswer: n, items: r, updateAnswer: o }) {
|
|
3957
3948
|
let l = Math.max(...r.map((e) => e.squareLength)) + 2, u = pt(t), [d, f] = a(null), [p, m] = a(!1), [h, g] = a({}), _ = i(null);
|
|
3958
3949
|
function v(e, t, n) {
|
|
3959
3950
|
let r = d;
|
|
@@ -4005,7 +3996,7 @@ function Hr({ answerId: e, choices: t, getAnswer: n, items: r, updateAnswer: o }
|
|
|
4005
3996
|
}), /* @__PURE__ */ s("div", {
|
|
4006
3997
|
className: "length-card-row",
|
|
4007
3998
|
children: r.map((t) => {
|
|
4008
|
-
let r = `${e}:squares:${t.id}`, i = `${e}:color:${t.id}`, a =
|
|
3999
|
+
let r = `${e}:squares:${t.id}`, i = `${e}:color:${t.id}`, a = xr(n(i)), d = h[t.id], f = d?.colorId ?? a?.choiceId, p = d?.fill ?? +!!a?.choiceId, m = f ? ft(u, f) : "#9aa3a8", g = `${16 + Math.min(p, 1) * 68}%`;
|
|
4009
4000
|
return /* @__PURE__ */ c("div", {
|
|
4010
4001
|
className: "length-card",
|
|
4011
4002
|
children: [/* @__PURE__ */ s("div", {
|
|
@@ -4040,11 +4031,11 @@ function Hr({ answerId: e, choices: t, getAnswer: n, items: r, updateAnswer: o }
|
|
|
4040
4031
|
className: "length-value-row",
|
|
4041
4032
|
children: [
|
|
4042
4033
|
/* @__PURE__ */ s("span", { children: t.label }),
|
|
4043
|
-
/* @__PURE__ */ s(
|
|
4034
|
+
/* @__PURE__ */ s(Zn, {
|
|
4044
4035
|
ariaLabel: `طول ${t.label} بالمربعات`,
|
|
4045
4036
|
inputMode: "numeric",
|
|
4046
4037
|
onChange: (e) => o(r, e),
|
|
4047
|
-
value:
|
|
4038
|
+
value: yr(n(r))
|
|
4048
4039
|
}),
|
|
4049
4040
|
/* @__PURE__ */ s("span", { children: "مربعات" })
|
|
4050
4041
|
]
|
|
@@ -4056,7 +4047,7 @@ function Hr({ answerId: e, choices: t, getAnswer: n, items: r, updateAnswer: o }
|
|
|
4056
4047
|
}
|
|
4057
4048
|
//#endregion
|
|
4058
4049
|
//#region src/renderer/QuestionPreviewPanel.tsx
|
|
4059
|
-
function
|
|
4050
|
+
function Wr({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
|
|
4060
4051
|
let [i, o] = a({}), c = t ?? i;
|
|
4061
4052
|
function l(e) {
|
|
4062
4053
|
if (t !== void 0) {
|
|
@@ -4079,7 +4070,7 @@ function Ur({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
|
|
|
4079
4070
|
}
|
|
4080
4071
|
return /* @__PURE__ */ s("div", {
|
|
4081
4072
|
className: "exam-renderer-preview",
|
|
4082
|
-
children: /* @__PURE__ */ s(
|
|
4073
|
+
children: /* @__PURE__ */ s(mr, {
|
|
4083
4074
|
adapters: e,
|
|
4084
4075
|
clearAnswer: d,
|
|
4085
4076
|
getAnswer: (e) => c[e],
|
|
@@ -4090,7 +4081,7 @@ function Ur({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
|
|
|
4090
4081
|
}
|
|
4091
4082
|
//#endregion
|
|
4092
4083
|
//#region src/renderer/PrintableExamDocument.tsx
|
|
4093
|
-
var
|
|
4084
|
+
var Gr = {
|
|
4094
4085
|
ariaLabel: "معلومات المؤسسة",
|
|
4095
4086
|
logoAlt: "شعار المملكة المغربية",
|
|
4096
4087
|
logoSrc: "/logo/morocco-logo.png",
|
|
@@ -4101,39 +4092,39 @@ var Wr = {
|
|
|
4101
4092
|
"المديرية الإقليمية"
|
|
4102
4093
|
]
|
|
4103
4094
|
};
|
|
4104
|
-
function
|
|
4105
|
-
let r =
|
|
4095
|
+
function Kr({ exam: e, locale: t = "fr", variant: n }) {
|
|
4096
|
+
let r = Ei(t), i = $r(e);
|
|
4106
4097
|
return /* @__PURE__ */ c("article", {
|
|
4107
4098
|
className: `printable-exam printable-exam--${n}`,
|
|
4108
|
-
dir:
|
|
4099
|
+
dir: Ti(t) ? "rtl" : "ltr",
|
|
4109
4100
|
children: [/* @__PURE__ */ c("div", {
|
|
4110
4101
|
className: "printable-exam__top",
|
|
4111
4102
|
children: [/* @__PURE__ */ c("header", {
|
|
4112
4103
|
className: "printable-exam__header",
|
|
4113
4104
|
children: [/* @__PURE__ */ c("div", {
|
|
4114
4105
|
className: "printable-exam__title-row",
|
|
4115
|
-
children: [/* @__PURE__ */ s(
|
|
4106
|
+
children: [/* @__PURE__ */ s(Qr, { totalPoints: i }), /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s("h1", { children: e.title }) })]
|
|
4116
4107
|
}), /* @__PURE__ */ c("div", {
|
|
4117
4108
|
className: "printable-exam__meta",
|
|
4118
4109
|
children: [
|
|
4119
|
-
/* @__PURE__ */ s(
|
|
4110
|
+
/* @__PURE__ */ s(Zr, {
|
|
4120
4111
|
label: r.duration,
|
|
4121
4112
|
value: e.timer
|
|
4122
4113
|
}),
|
|
4123
|
-
/* @__PURE__ */ s(
|
|
4114
|
+
/* @__PURE__ */ s(Zr, {
|
|
4124
4115
|
label: r.level,
|
|
4125
4116
|
value: e.level
|
|
4126
4117
|
}),
|
|
4127
|
-
/* @__PURE__ */ s(
|
|
4128
|
-
label:
|
|
4118
|
+
/* @__PURE__ */ s(Zr, {
|
|
4119
|
+
label: Ti(t) ? "المادة" : r.subject ?? "Matiere",
|
|
4129
4120
|
value: e.subject
|
|
4130
4121
|
})
|
|
4131
4122
|
]
|
|
4132
4123
|
})]
|
|
4133
|
-
}), /* @__PURE__ */ s(
|
|
4124
|
+
}), /* @__PURE__ */ s(qr, {})]
|
|
4134
4125
|
}), /* @__PURE__ */ s("div", {
|
|
4135
4126
|
className: "printable-exam__sections",
|
|
4136
|
-
children: e.sections.map((e) => /* @__PURE__ */ s(
|
|
4127
|
+
children: e.sections.map((e) => /* @__PURE__ */ s(Jr, {
|
|
4137
4128
|
locale: t,
|
|
4138
4129
|
section: e,
|
|
4139
4130
|
variant: n
|
|
@@ -4141,24 +4132,24 @@ function Gr({ exam: e, locale: t = "fr", variant: n }) {
|
|
|
4141
4132
|
})]
|
|
4142
4133
|
});
|
|
4143
4134
|
}
|
|
4144
|
-
function
|
|
4135
|
+
function qr() {
|
|
4145
4136
|
return /* @__PURE__ */ c("section", {
|
|
4146
|
-
"aria-label":
|
|
4137
|
+
"aria-label": Gr.ariaLabel,
|
|
4147
4138
|
className: "printable-institution-header",
|
|
4148
4139
|
dir: "rtl",
|
|
4149
4140
|
children: [
|
|
4150
4141
|
/* @__PURE__ */ s("img", {
|
|
4151
|
-
alt:
|
|
4142
|
+
alt: Gr.logoAlt,
|
|
4152
4143
|
className: "printable-institution-header__logo",
|
|
4153
|
-
src:
|
|
4144
|
+
src: Gr.logoSrc
|
|
4154
4145
|
}),
|
|
4155
|
-
/* @__PURE__ */ s("h1", { children:
|
|
4156
|
-
|
|
4146
|
+
/* @__PURE__ */ s("h1", { children: Gr.title }),
|
|
4147
|
+
Gr.lines.map((e) => /* @__PURE__ */ s("p", { children: e }, e))
|
|
4157
4148
|
]
|
|
4158
4149
|
});
|
|
4159
4150
|
}
|
|
4160
|
-
function
|
|
4161
|
-
let r =
|
|
4151
|
+
function Jr({ locale: e = "fr", section: t, variant: n }) {
|
|
4152
|
+
let r = Ei(e);
|
|
4162
4153
|
return /* @__PURE__ */ c("section", {
|
|
4163
4154
|
className: `printable-section printable-section--${t.tone}`,
|
|
4164
4155
|
"data-variant": n,
|
|
@@ -4169,7 +4160,7 @@ function qr({ locale: e = "fr", section: t, variant: n }) {
|
|
|
4169
4160
|
className: "printable-section__score",
|
|
4170
4161
|
children: /* @__PURE__ */ c("span", {
|
|
4171
4162
|
className: "printable-section__obtained",
|
|
4172
|
-
children: [/* @__PURE__ */ c("strong", { children: [/* @__PURE__ */ s("i", { "aria-hidden": "true" }), /* @__PURE__ */ c("b", { children: ["/ ",
|
|
4163
|
+
children: [/* @__PURE__ */ c("strong", { children: [/* @__PURE__ */ s("i", { "aria-hidden": "true" }), /* @__PURE__ */ c("b", { children: ["/ ", K(t)] })] }), /* @__PURE__ */ s("small", { children: r.obtainedNote })]
|
|
4173
4164
|
})
|
|
4174
4165
|
}),
|
|
4175
4166
|
/* @__PURE__ */ s("h2", { children: t.title }),
|
|
@@ -4180,7 +4171,7 @@ function qr({ locale: e = "fr", section: t, variant: n }) {
|
|
|
4180
4171
|
]
|
|
4181
4172
|
}), /* @__PURE__ */ s("div", {
|
|
4182
4173
|
className: "printable-section__body",
|
|
4183
|
-
children: t.questions.map((t) => /* @__PURE__ */ s(
|
|
4174
|
+
children: t.questions.map((t) => /* @__PURE__ */ s(Yr, {
|
|
4184
4175
|
locale: e,
|
|
4185
4176
|
question: t,
|
|
4186
4177
|
variant: n
|
|
@@ -4188,8 +4179,8 @@ function qr({ locale: e = "fr", section: t, variant: n }) {
|
|
|
4188
4179
|
})]
|
|
4189
4180
|
});
|
|
4190
4181
|
}
|
|
4191
|
-
function
|
|
4192
|
-
let r =
|
|
4182
|
+
function Yr({ locale: e = "fr", question: t, variant: n }) {
|
|
4183
|
+
let r = Ei(e), i = dr(t), a = W(t), o = a > 0 ? ue(a) : "";
|
|
4193
4184
|
return /* @__PURE__ */ c("article", {
|
|
4194
4185
|
className: `printable-question printable-question--${t.type} printable-question--${i}`,
|
|
4195
4186
|
dir: i,
|
|
@@ -4214,28 +4205,28 @@ function Jr({ locale: e = "fr", question: t, variant: n }) {
|
|
|
4214
4205
|
}) : null
|
|
4215
4206
|
]
|
|
4216
4207
|
})
|
|
4217
|
-
}),
|
|
4208
|
+
}), Xr(t, n, r, e)]
|
|
4218
4209
|
});
|
|
4219
4210
|
}
|
|
4220
|
-
function
|
|
4211
|
+
function Xr(e, t, n, r) {
|
|
4221
4212
|
switch (e.type) {
|
|
4222
4213
|
case "inline-inputs":
|
|
4223
4214
|
case "equation-inputs": return /* @__PURE__ */ s("div", {
|
|
4224
4215
|
className: "printable-equation-grid",
|
|
4225
4216
|
children: e.items.map((e) => /* @__PURE__ */ s("div", {
|
|
4226
4217
|
className: "printable-equation-card",
|
|
4227
|
-
children: /* @__PURE__ */ s(
|
|
4218
|
+
children: /* @__PURE__ */ s(Si, { item: e })
|
|
4228
4219
|
}, e.id))
|
|
4229
4220
|
});
|
|
4230
4221
|
case "number-line": return /* @__PURE__ */ c("div", {
|
|
4231
4222
|
className: "printable-number-line-layout",
|
|
4232
4223
|
children: [/* @__PURE__ */ c("div", {
|
|
4233
4224
|
className: "printable-number-line-expression",
|
|
4234
|
-
children: [/* @__PURE__ */ s("span", { children: e.expression }), /* @__PURE__ */ s(
|
|
4235
|
-
}), /* @__PURE__ */ s(
|
|
4225
|
+
children: [/* @__PURE__ */ s("span", { children: e.expression }), /* @__PURE__ */ s(wi, {})]
|
|
4226
|
+
}), /* @__PURE__ */ s(_i, {})]
|
|
4236
4227
|
});
|
|
4237
4228
|
case "operation-solving": {
|
|
4238
|
-
let t =
|
|
4229
|
+
let t = ni(e);
|
|
4239
4230
|
return /* @__PURE__ */ c("div", {
|
|
4240
4231
|
className: [
|
|
4241
4232
|
"printable-operation-solving",
|
|
@@ -4244,11 +4235,8 @@ function Yr(e, t, n, r) {
|
|
|
4244
4235
|
].join(" "),
|
|
4245
4236
|
children: [t === "equation-card-grid" ? /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s("div", {
|
|
4246
4237
|
className: "printable-operation-solving__equation",
|
|
4247
|
-
children: /* @__PURE__ */ s(
|
|
4248
|
-
}) }) : null, e.operator === "÷" ? /* @__PURE__ */ s(ri, {
|
|
4249
|
-
question: e,
|
|
4250
|
-
showOperands: t === "vertical-operation"
|
|
4251
|
-
}) : /* @__PURE__ */ s(ni, {
|
|
4238
|
+
children: /* @__PURE__ */ s(ti, { question: e })
|
|
4239
|
+
}) }) : null, e.operator === "÷" ? /* @__PURE__ */ s(ii, {}) : /* @__PURE__ */ s(ri, {
|
|
4252
4240
|
question: e,
|
|
4253
4241
|
showOperands: t === "vertical-operation"
|
|
4254
4242
|
})]
|
|
@@ -4256,21 +4244,21 @@ function Yr(e, t, n, r) {
|
|
|
4256
4244
|
}
|
|
4257
4245
|
case "visual-choice": return /* @__PURE__ */ c("div", {
|
|
4258
4246
|
className: "printable-visual-match",
|
|
4259
|
-
children: [/* @__PURE__ */ s(
|
|
4247
|
+
children: [/* @__PURE__ */ s(ui, {
|
|
4260
4248
|
choices: e.choices,
|
|
4261
|
-
scene: e.scene ??
|
|
4249
|
+
scene: e.scene ?? ir(e.visual)
|
|
4262
4250
|
}), e.inputLabel ? /* @__PURE__ */ c("div", {
|
|
4263
4251
|
className: "printable-inline-answer",
|
|
4264
|
-
children: [/* @__PURE__ */ s("span", { children: e.inputLabel }), /* @__PURE__ */ s(
|
|
4252
|
+
children: [/* @__PURE__ */ s("span", { children: e.inputLabel }), /* @__PURE__ */ s(Ci, {})]
|
|
4265
4253
|
}) : null]
|
|
4266
4254
|
});
|
|
4267
4255
|
case "length-estimation": return /* @__PURE__ */ s("div", {
|
|
4268
4256
|
className: "printable-length-task",
|
|
4269
4257
|
children: /* @__PURE__ */ s("div", {
|
|
4270
4258
|
className: "printable-length-list",
|
|
4271
|
-
children: e.items.map((e) => /* @__PURE__ */ s(
|
|
4259
|
+
children: e.items.map((e) => /* @__PURE__ */ s(vi, {
|
|
4272
4260
|
item: e,
|
|
4273
|
-
squareUnit:
|
|
4261
|
+
squareUnit: Ti(r) ? "مربعات" : "carres",
|
|
4274
4262
|
variant: t
|
|
4275
4263
|
}, e.id))
|
|
4276
4264
|
})
|
|
@@ -4282,7 +4270,7 @@ function Yr(e, t, n, r) {
|
|
|
4282
4270
|
className: "printable-shape-bank",
|
|
4283
4271
|
children: e.choices.map((e) => /* @__PURE__ */ s("div", {
|
|
4284
4272
|
className: "printable-shape-card",
|
|
4285
|
-
children: /* @__PURE__ */ s(
|
|
4273
|
+
children: /* @__PURE__ */ s($e, { shapeId: e.id })
|
|
4286
4274
|
}, e.id))
|
|
4287
4275
|
}),
|
|
4288
4276
|
/* @__PURE__ */ s("div", {
|
|
@@ -4292,12 +4280,12 @@ function Yr(e, t, n, r) {
|
|
|
4292
4280
|
children: [/* @__PURE__ */ c("span", { children: [t + 1, "."] }), /* @__PURE__ */ s("strong", { children: e.label })]
|
|
4293
4281
|
}, e.id))
|
|
4294
4282
|
}),
|
|
4295
|
-
/* @__PURE__ */ s(
|
|
4283
|
+
/* @__PURE__ */ s(ei, { label: n.dragArea })
|
|
4296
4284
|
]
|
|
4297
4285
|
});
|
|
4298
4286
|
case "drawing-grid": return /* @__PURE__ */ s("div", {
|
|
4299
4287
|
className: "printable-drawing-block",
|
|
4300
|
-
children: /* @__PURE__ */ s(
|
|
4288
|
+
children: /* @__PURE__ */ s(gi, { points: e.points })
|
|
4301
4289
|
});
|
|
4302
4290
|
case "table-response": return /* @__PURE__ */ s("div", {
|
|
4303
4291
|
className: "printable-table-response",
|
|
@@ -4308,7 +4296,7 @@ function Yr(e, t, n, r) {
|
|
|
4308
4296
|
/* @__PURE__ */ s("div", { className: "printable-table-area" }),
|
|
4309
4297
|
/* @__PURE__ */ c("div", {
|
|
4310
4298
|
className: "printable-inline-answer",
|
|
4311
|
-
children: [/* @__PURE__ */ s("span", { children: e.answerLabel }), /* @__PURE__ */ s(
|
|
4299
|
+
children: [/* @__PURE__ */ s("span", { children: e.answerLabel }), /* @__PURE__ */ s(Ci, {})]
|
|
4312
4300
|
})
|
|
4313
4301
|
]
|
|
4314
4302
|
}, e.id))
|
|
@@ -4320,7 +4308,7 @@ function Yr(e, t, n, r) {
|
|
|
4320
4308
|
className: "printable-inline-answer printable-inline-answer--sentence",
|
|
4321
4309
|
children: [
|
|
4322
4310
|
e.before ? /* @__PURE__ */ s("span", { children: e.before }) : null,
|
|
4323
|
-
/* @__PURE__ */ s(
|
|
4311
|
+
/* @__PURE__ */ s(Ci, {}),
|
|
4324
4312
|
e.after ? /* @__PURE__ */ s("span", { children: e.after }) : null
|
|
4325
4313
|
]
|
|
4326
4314
|
});
|
|
@@ -4333,10 +4321,10 @@ function Yr(e, t, n, r) {
|
|
|
4333
4321
|
className: "printable-statement printable-word-problem__situation",
|
|
4334
4322
|
children: e.situation
|
|
4335
4323
|
}),
|
|
4336
|
-
t?.enabled ? /* @__PURE__ */ s(
|
|
4324
|
+
t?.enabled ? /* @__PURE__ */ s(bi, { config: t }) : null,
|
|
4337
4325
|
/* @__PURE__ */ s("div", {
|
|
4338
4326
|
className: "printable-word-problem__parts",
|
|
4339
|
-
children: e.parts.map((e, t) => /* @__PURE__ */ s(
|
|
4327
|
+
children: e.parts.map((e, t) => /* @__PURE__ */ s(yi, {
|
|
4340
4328
|
part: e,
|
|
4341
4329
|
partNumber: t + 1
|
|
4342
4330
|
}, e.id))
|
|
@@ -4344,7 +4332,7 @@ function Yr(e, t, n, r) {
|
|
|
4344
4332
|
]
|
|
4345
4333
|
});
|
|
4346
4334
|
}
|
|
4347
|
-
case "drag-match": return /* @__PURE__ */ s(
|
|
4335
|
+
case "drag-match": return /* @__PURE__ */ s(fi, {
|
|
4348
4336
|
items: e.items,
|
|
4349
4337
|
targets: e.targets
|
|
4350
4338
|
});
|
|
@@ -4360,14 +4348,14 @@ function Yr(e, t, n, r) {
|
|
|
4360
4348
|
className: "printable-sortable__slots",
|
|
4361
4349
|
children: [/* @__PURE__ */ s("strong", { children: n.sortOrder }), e.items.map((e, t) => /* @__PURE__ */ c("div", {
|
|
4362
4350
|
className: "printable-sortable__slot",
|
|
4363
|
-
children: [/* @__PURE__ */ c("span", { children: [t + 1, "."] }), /* @__PURE__ */ s(
|
|
4351
|
+
children: [/* @__PURE__ */ c("span", { children: [t + 1, "."] }), /* @__PURE__ */ s(Ci, {})]
|
|
4364
4352
|
}, e.id))]
|
|
4365
4353
|
})]
|
|
4366
4354
|
});
|
|
4367
4355
|
case "label-placement": return /* @__PURE__ */ c("div", {
|
|
4368
4356
|
className: "printable-label-placement",
|
|
4369
4357
|
children: [
|
|
4370
|
-
/* @__PURE__ */ s(
|
|
4358
|
+
/* @__PURE__ */ s(hi, { targets: e.targets }),
|
|
4371
4359
|
/* @__PURE__ */ s("div", {
|
|
4372
4360
|
className: "printable-placement-labels",
|
|
4373
4361
|
children: e.labels.map((e) => /* @__PURE__ */ s("span", {
|
|
@@ -4375,7 +4363,7 @@ function Yr(e, t, n, r) {
|
|
|
4375
4363
|
children: /* @__PURE__ */ s("strong", { children: e.label })
|
|
4376
4364
|
}, e.id))
|
|
4377
4365
|
}),
|
|
4378
|
-
/* @__PURE__ */ s(
|
|
4366
|
+
/* @__PURE__ */ s(ei, { label: n.placeLabels })
|
|
4379
4367
|
]
|
|
4380
4368
|
});
|
|
4381
4369
|
case "audio-recording": return /* @__PURE__ */ c("div", {
|
|
@@ -4400,49 +4388,49 @@ function Yr(e, t, n, r) {
|
|
|
4400
4388
|
});
|
|
4401
4389
|
}
|
|
4402
4390
|
}
|
|
4403
|
-
function
|
|
4391
|
+
function Zr({ label: e, value: t }) {
|
|
4404
4392
|
return /* @__PURE__ */ c("div", {
|
|
4405
4393
|
className: "printable-meta-pill",
|
|
4406
4394
|
children: [/* @__PURE__ */ s("span", { children: e }), /* @__PURE__ */ s("strong", { children: t })]
|
|
4407
4395
|
});
|
|
4408
4396
|
}
|
|
4409
|
-
function
|
|
4397
|
+
function Qr({ totalPoints: e }) {
|
|
4410
4398
|
return /* @__PURE__ */ s("div", {
|
|
4411
4399
|
className: "printable-note-box",
|
|
4412
4400
|
children: /* @__PURE__ */ c("strong", { children: [/* @__PURE__ */ s("i", { "aria-hidden": "true" }), /* @__PURE__ */ c("b", { children: ["/ ", e] })] })
|
|
4413
4401
|
});
|
|
4414
4402
|
}
|
|
4415
|
-
function
|
|
4416
|
-
let t = e.sections.filter((e) => e.isScored !== !1).map((e) =>
|
|
4403
|
+
function $r(e) {
|
|
4404
|
+
let t = e.sections.filter((e) => e.isScored !== !1).map((e) => G(e)).filter((e) => Number.isFinite(e));
|
|
4417
4405
|
if (t.length === 0) return "";
|
|
4418
4406
|
let n = t.reduce((e, t) => e + t, 0);
|
|
4419
4407
|
return String(Number.isInteger(n) ? n : Number(n.toFixed(2)));
|
|
4420
4408
|
}
|
|
4421
|
-
function
|
|
4409
|
+
function ei({ label: e }) {
|
|
4422
4410
|
return /* @__PURE__ */ c("div", {
|
|
4423
4411
|
className: "printable-hint-line",
|
|
4424
|
-
children: [/* @__PURE__ */ s("span", { children: e }), /* @__PURE__ */ s(
|
|
4412
|
+
children: [/* @__PURE__ */ s("span", { children: e }), /* @__PURE__ */ s(Ci, {})]
|
|
4425
4413
|
});
|
|
4426
4414
|
}
|
|
4427
|
-
function
|
|
4415
|
+
function ti({ question: e }) {
|
|
4428
4416
|
return /* @__PURE__ */ c(o, { children: [
|
|
4429
|
-
/* @__PURE__ */ s("span", { children:
|
|
4430
|
-
/* @__PURE__ */ s(
|
|
4417
|
+
/* @__PURE__ */ s("span", { children: q(e.leftOperand) }),
|
|
4418
|
+
/* @__PURE__ */ s(ai, {
|
|
4431
4419
|
className: "printable-operation-solving__symbol",
|
|
4432
4420
|
operator: e.operator
|
|
4433
4421
|
}),
|
|
4434
|
-
/* @__PURE__ */ c("span", { children: [
|
|
4422
|
+
/* @__PURE__ */ c("span", { children: [q(e.rightOperand), " ="] })
|
|
4435
4423
|
] });
|
|
4436
4424
|
}
|
|
4437
|
-
function
|
|
4438
|
-
return e.layout === "equation-card-grid" || e.solutionMode === "full-process" ? "equation-card-grid" : "vertical-operation";
|
|
4425
|
+
function ni(e) {
|
|
4426
|
+
return e.operator === "÷" || e.layout === "equation-card-grid" || e.solutionMode === "full-process" ? "equation-card-grid" : "vertical-operation";
|
|
4439
4427
|
}
|
|
4440
|
-
function
|
|
4441
|
-
let n =
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
]), r = n.columns, i = Math.max(r, 5), a = Math.max(r,
|
|
4428
|
+
function ri({ question: e, showOperands: t }) {
|
|
4429
|
+
let n = si([
|
|
4430
|
+
q(e.leftOperand),
|
|
4431
|
+
q(e.rightOperand),
|
|
4432
|
+
q(e.correctAnswer)
|
|
4433
|
+
]), r = n.columns, i = Math.max(r, 5), a = Math.max(r, oi(q(e.correctAnswer)).length, 2), o = ci(q(e.leftOperand), n, i), l = ci(q(e.rightOperand), n, i);
|
|
4446
4434
|
return /* @__PURE__ */ c("div", {
|
|
4447
4435
|
className: ["printable-vertical-operation", t ? "printable-vertical-operation--with-operands" : "printable-vertical-operation--blank-operands"].filter(Boolean).join(" "),
|
|
4448
4436
|
style: {
|
|
@@ -4462,7 +4450,7 @@ function ni({ question: e, showOperands: t }) {
|
|
|
4462
4450
|
}),
|
|
4463
4451
|
/* @__PURE__ */ c("div", {
|
|
4464
4452
|
className: "printable-vertical-operation__row",
|
|
4465
|
-
children: [/* @__PURE__ */ s(
|
|
4453
|
+
children: [/* @__PURE__ */ s(ai, {
|
|
4466
4454
|
className: "printable-vertical-operation__operator",
|
|
4467
4455
|
operator: e.operator
|
|
4468
4456
|
}), l.map((e, n) => /* @__PURE__ */ s("span", {
|
|
@@ -4481,26 +4469,10 @@ function ni({ question: e, showOperands: t }) {
|
|
|
4481
4469
|
]
|
|
4482
4470
|
});
|
|
4483
4471
|
}
|
|
4484
|
-
function
|
|
4485
|
-
return /* @__PURE__ */
|
|
4486
|
-
className: "printable-division-operation",
|
|
4487
|
-
children: [
|
|
4488
|
-
/* @__PURE__ */ s("span", { className: "printable-division-operation__quotient" }),
|
|
4489
|
-
/* @__PURE__ */ c("div", {
|
|
4490
|
-
className: "printable-division-operation__bracket",
|
|
4491
|
-
children: [/* @__PURE__ */ s("span", {
|
|
4492
|
-
className: "printable-division-operation__dividend",
|
|
4493
|
-
children: t ? K(e.leftOperand) : ""
|
|
4494
|
-
}), /* @__PURE__ */ s("span", {
|
|
4495
|
-
className: "printable-division-operation__divisor",
|
|
4496
|
-
children: t ? K(e.rightOperand) : ""
|
|
4497
|
-
})]
|
|
4498
|
-
}),
|
|
4499
|
-
/* @__PURE__ */ s("span", { className: "printable-division-operation__work" })
|
|
4500
|
-
]
|
|
4501
|
-
});
|
|
4472
|
+
function ii() {
|
|
4473
|
+
return /* @__PURE__ */ s("div", { className: "printable-division-operation" });
|
|
4502
4474
|
}
|
|
4503
|
-
function
|
|
4475
|
+
function ai({ className: e, operator: t }) {
|
|
4504
4476
|
let n = t.trim();
|
|
4505
4477
|
return /* @__PURE__ */ c("span", {
|
|
4506
4478
|
"aria-hidden": "true",
|
|
@@ -4512,12 +4484,12 @@ function ii({ className: e, operator: t }) {
|
|
|
4512
4484
|
]
|
|
4513
4485
|
});
|
|
4514
4486
|
}
|
|
4515
|
-
function
|
|
4516
|
-
let t =
|
|
4487
|
+
function oi(e) {
|
|
4488
|
+
let t = q(e).trim();
|
|
4517
4489
|
return t.length > 0 ? Array.from(t) : [""];
|
|
4518
4490
|
}
|
|
4519
|
-
function
|
|
4520
|
-
let t = e.map(
|
|
4491
|
+
function si(e) {
|
|
4492
|
+
let t = e.map(li), n = t.some((e) => e.separator.length > 0), r = Math.max(...t.map((e) => e.whole.length), 1), i = n ? Math.max(...t.map((e) => e.fraction.length), 0) : 0;
|
|
4521
4493
|
return {
|
|
4522
4494
|
columns: Math.max(n ? r + 1 + i : r, 2),
|
|
4523
4495
|
fractionColumns: i,
|
|
@@ -4525,8 +4497,8 @@ function oi(e) {
|
|
|
4525
4497
|
wholeColumns: r
|
|
4526
4498
|
};
|
|
4527
4499
|
}
|
|
4528
|
-
function
|
|
4529
|
-
let r =
|
|
4500
|
+
function ci(e, t, n = t.columns) {
|
|
4501
|
+
let r = li(e), i = Math.max(0, t.wholeColumns - r.whole.length), a = t.hasDecimal ? [
|
|
4530
4502
|
...Array.from({ length: i }, () => ""),
|
|
4531
4503
|
...Array.from(r.whole),
|
|
4532
4504
|
r.separator,
|
|
@@ -4535,8 +4507,8 @@ function si(e, t, n = t.columns) {
|
|
|
4535
4507
|
] : [...Array.from({ length: i }, () => ""), ...Array.from(r.whole)];
|
|
4536
4508
|
return [...Array.from({ length: Math.max(0, n - a.length) }, () => ""), ...a];
|
|
4537
4509
|
}
|
|
4538
|
-
function
|
|
4539
|
-
let t =
|
|
4510
|
+
function li(e) {
|
|
4511
|
+
let t = q(e).trim(), n = t.indexOf(",");
|
|
4540
4512
|
return n < 0 ? {
|
|
4541
4513
|
fraction: "",
|
|
4542
4514
|
separator: "",
|
|
@@ -4547,25 +4519,25 @@ function ci(e) {
|
|
|
4547
4519
|
whole: t.slice(0, n)
|
|
4548
4520
|
};
|
|
4549
4521
|
}
|
|
4550
|
-
function
|
|
4522
|
+
function ui({ choices: e, scene: t }) {
|
|
4551
4523
|
return /* @__PURE__ */ s("div", {
|
|
4552
4524
|
className: "printable-visual-match__preview",
|
|
4553
4525
|
children: /* @__PURE__ */ c("div", {
|
|
4554
4526
|
className: "visual-line-match printable-visual-line-match",
|
|
4555
4527
|
children: [/* @__PURE__ */ c("div", {
|
|
4556
4528
|
className: "visual-match-picture printable-visual-match-picture",
|
|
4557
|
-
children: [/* @__PURE__ */ s(
|
|
4529
|
+
children: [/* @__PURE__ */ s(or, { scene: t }), /* @__PURE__ */ s("span", {
|
|
4558
4530
|
"aria-hidden": "true",
|
|
4559
4531
|
className: "visual-match-point visual-match-point--target printable-match-point printable-match-point--target"
|
|
4560
4532
|
})]
|
|
4561
4533
|
}), /* @__PURE__ */ s("div", {
|
|
4562
4534
|
className: "visual-line-match__answers printable-visual-line-match__answers",
|
|
4563
|
-
children: e.map((e) => /* @__PURE__ */ s(
|
|
4535
|
+
children: e.map((e) => /* @__PURE__ */ s(di, { choice: e }, e.id))
|
|
4564
4536
|
})]
|
|
4565
4537
|
})
|
|
4566
4538
|
});
|
|
4567
4539
|
}
|
|
4568
|
-
function
|
|
4540
|
+
function di({ choice: e }) {
|
|
4569
4541
|
return /* @__PURE__ */ c("div", {
|
|
4570
4542
|
className: "visual-match-answer printable-visual-match-answer",
|
|
4571
4543
|
children: [/* @__PURE__ */ s("span", {
|
|
@@ -4577,25 +4549,25 @@ function ui({ choice: e }) {
|
|
|
4577
4549
|
})]
|
|
4578
4550
|
});
|
|
4579
4551
|
}
|
|
4580
|
-
function
|
|
4552
|
+
function fi({ items: e, targets: t }) {
|
|
4581
4553
|
return /* @__PURE__ */ c("div", {
|
|
4582
4554
|
className: "printable-drag-match-board",
|
|
4583
4555
|
children: [/* @__PURE__ */ s("div", {
|
|
4584
4556
|
className: "printable-drag-match-row printable-drag-match-row--answers",
|
|
4585
|
-
children: e.map((e, t) => /* @__PURE__ */ s(
|
|
4557
|
+
children: e.map((e, t) => /* @__PURE__ */ s(mi, {
|
|
4586
4558
|
index: t,
|
|
4587
4559
|
item: e
|
|
4588
4560
|
}, e.id))
|
|
4589
4561
|
}), /* @__PURE__ */ s("div", {
|
|
4590
4562
|
className: "printable-drag-match-row printable-drag-match-row--targets",
|
|
4591
|
-
children: t.map((e, t) => /* @__PURE__ */ s(
|
|
4563
|
+
children: t.map((e, t) => /* @__PURE__ */ s(pi, {
|
|
4592
4564
|
index: t,
|
|
4593
4565
|
target: e
|
|
4594
4566
|
}, e.id))
|
|
4595
4567
|
})]
|
|
4596
4568
|
});
|
|
4597
4569
|
}
|
|
4598
|
-
function
|
|
4570
|
+
function pi({ index: e, target: t }) {
|
|
4599
4571
|
return /* @__PURE__ */ c("div", {
|
|
4600
4572
|
className: "printable-drag-match-card printable-drag-match-card--target",
|
|
4601
4573
|
children: [/* @__PURE__ */ s("span", {
|
|
@@ -4603,11 +4575,11 @@ function fi({ index: e, target: t }) {
|
|
|
4603
4575
|
children: String.fromCharCode(65 + e)
|
|
4604
4576
|
}), /* @__PURE__ */ s("div", {
|
|
4605
4577
|
className: "printable-drag-match-content",
|
|
4606
|
-
children: t.shapeId ? /* @__PURE__ */ s(
|
|
4578
|
+
children: t.shapeId ? /* @__PURE__ */ s($e, { shapeId: t.shapeId }) : /* @__PURE__ */ s("strong", { children: t.label })
|
|
4607
4579
|
})]
|
|
4608
4580
|
});
|
|
4609
4581
|
}
|
|
4610
|
-
function
|
|
4582
|
+
function mi({ index: e, item: t }) {
|
|
4611
4583
|
return /* @__PURE__ */ c("div", {
|
|
4612
4584
|
className: "printable-drag-match-card printable-drag-match-card--answer",
|
|
4613
4585
|
children: [/* @__PURE__ */ s("div", {
|
|
@@ -4619,7 +4591,7 @@ function pi({ index: e, item: t }) {
|
|
|
4619
4591
|
})]
|
|
4620
4592
|
});
|
|
4621
4593
|
}
|
|
4622
|
-
function
|
|
4594
|
+
function hi({ targets: e }) {
|
|
4623
4595
|
return /* @__PURE__ */ s("div", {
|
|
4624
4596
|
className: "printable-placement-board",
|
|
4625
4597
|
children: e.map((e, t) => /* @__PURE__ */ s("div", {
|
|
@@ -4632,7 +4604,7 @@ function mi({ targets: e }) {
|
|
|
4632
4604
|
}, e.id))
|
|
4633
4605
|
});
|
|
4634
4606
|
}
|
|
4635
|
-
function
|
|
4607
|
+
function gi({ points: e }) {
|
|
4636
4608
|
return /* @__PURE__ */ c("svg", {
|
|
4637
4609
|
className: "printable-drawing-grid",
|
|
4638
4610
|
viewBox: "0 0 1000 420",
|
|
@@ -4663,7 +4635,7 @@ function hi({ points: e }) {
|
|
|
4663
4635
|
]
|
|
4664
4636
|
});
|
|
4665
4637
|
}
|
|
4666
|
-
function
|
|
4638
|
+
function _i() {
|
|
4667
4639
|
return /* @__PURE__ */ c("svg", {
|
|
4668
4640
|
className: "printable-number-line",
|
|
4669
4641
|
viewBox: "0 0 420 90",
|
|
@@ -4687,7 +4659,7 @@ function gi() {
|
|
|
4687
4659
|
}, t))]
|
|
4688
4660
|
});
|
|
4689
4661
|
}
|
|
4690
|
-
function
|
|
4662
|
+
function vi({ item: e, squareUnit: t, variant: n }) {
|
|
4691
4663
|
return /* @__PURE__ */ c("div", {
|
|
4692
4664
|
className: "length-card printable-length-card",
|
|
4693
4665
|
children: [/* @__PURE__ */ s("div", {
|
|
@@ -4716,13 +4688,13 @@ function _i({ item: e, squareUnit: t, variant: n }) {
|
|
|
4716
4688
|
className: "length-value-row printable-length-value-row",
|
|
4717
4689
|
children: [
|
|
4718
4690
|
/* @__PURE__ */ s("span", { children: e.label }),
|
|
4719
|
-
/* @__PURE__ */ s(
|
|
4691
|
+
/* @__PURE__ */ s(wi, {}),
|
|
4720
4692
|
/* @__PURE__ */ s("span", { children: t })
|
|
4721
4693
|
]
|
|
4722
4694
|
})]
|
|
4723
4695
|
});
|
|
4724
4696
|
}
|
|
4725
|
-
function
|
|
4697
|
+
function yi({ part: e, partNumber: t }) {
|
|
4726
4698
|
return /* @__PURE__ */ c("section", {
|
|
4727
4699
|
className: "printable-word-problem__part",
|
|
4728
4700
|
children: [/* @__PURE__ */ c("div", {
|
|
@@ -4737,13 +4709,13 @@ function vi({ part: e, partNumber: t }) {
|
|
|
4737
4709
|
/* @__PURE__ */ s("div", { className: "printable-table-area" }),
|
|
4738
4710
|
/* @__PURE__ */ c("div", {
|
|
4739
4711
|
className: "printable-inline-answer",
|
|
4740
|
-
children: [/* @__PURE__ */ s("span", { children: e.answerLabel }), /* @__PURE__ */ s(
|
|
4712
|
+
children: [/* @__PURE__ */ s("span", { children: e.answerLabel }), /* @__PURE__ */ s(Ci, {})]
|
|
4741
4713
|
})
|
|
4742
4714
|
]
|
|
4743
4715
|
}, e.id))
|
|
4744
4716
|
}) : e.type === "table" ? /* @__PURE__ */ s("div", {
|
|
4745
4717
|
className: "printable-word-problem-table",
|
|
4746
|
-
style:
|
|
4718
|
+
style: xi(e),
|
|
4747
4719
|
children: e.cells.map((t) => {
|
|
4748
4720
|
let n = e.hasHeaderRow && t.row === 0, r = !n && t.mode !== "static";
|
|
4749
4721
|
return /* @__PURE__ */ c("div", {
|
|
@@ -4766,50 +4738,49 @@ function vi({ part: e, partNumber: t }) {
|
|
|
4766
4738
|
className: "printable-inline-answer printable-inline-answer--sentence",
|
|
4767
4739
|
children: [
|
|
4768
4740
|
e.before ? /* @__PURE__ */ s("span", { children: e.before }) : null,
|
|
4769
|
-
/* @__PURE__ */ s(
|
|
4741
|
+
/* @__PURE__ */ s(Ci, {}),
|
|
4770
4742
|
e.after ? /* @__PURE__ */ s("span", { children: e.after }) : null
|
|
4771
4743
|
]
|
|
4772
4744
|
})]
|
|
4773
4745
|
});
|
|
4774
4746
|
}
|
|
4775
|
-
function
|
|
4776
|
-
return /* @__PURE__ */ s(
|
|
4747
|
+
function bi({ config: e }) {
|
|
4748
|
+
return /* @__PURE__ */ s(jn, {
|
|
4777
4749
|
className: "printable-problem-sheet",
|
|
4778
|
-
config: e
|
|
4779
|
-
height: Math.min(440, Math.max(160, Math.round((e.height ?? 460) * .52)))
|
|
4750
|
+
config: e
|
|
4780
4751
|
});
|
|
4781
4752
|
}
|
|
4782
|
-
function
|
|
4753
|
+
function xi(e) {
|
|
4783
4754
|
let t = Array.from({ length: e.columnCount }, (t, n) => Math.max(1, e.columnWidths[n] ?? 1)), n = Array.from({ length: e.rowCount }, (t, n) => Math.max(26, Math.round((e.rowHeights[n] ?? 64) * .58)));
|
|
4784
4755
|
return {
|
|
4785
4756
|
gridTemplateColumns: t.map((e) => `minmax(18mm, ${e}fr)`).join(" "),
|
|
4786
4757
|
gridTemplateRows: n.map((e) => `${e}px`).join(" ")
|
|
4787
4758
|
};
|
|
4788
4759
|
}
|
|
4789
|
-
function
|
|
4790
|
-
return t.answers?.length ? /* @__PURE__ */ c(o, { children: [t.answers.map((t) => /* @__PURE__ */ c(e, { children: [t.before ? /* @__PURE__ */ s("span", { children: t.before }) : null, /* @__PURE__ */ s(
|
|
4760
|
+
function Si({ item: t }) {
|
|
4761
|
+
return t.answers?.length ? /* @__PURE__ */ c(o, { children: [t.answers.map((t) => /* @__PURE__ */ c(e, { children: [t.before ? /* @__PURE__ */ s("span", { children: t.before }) : null, /* @__PURE__ */ s(wi, {})] }, t.id)), t.after ? /* @__PURE__ */ s("span", { children: t.after }) : null] }) : t.correctAnswer ? /* @__PURE__ */ c(o, { children: [
|
|
4791
4762
|
/* @__PURE__ */ s("span", { children: t.before }),
|
|
4792
|
-
/* @__PURE__ */ s(
|
|
4763
|
+
/* @__PURE__ */ s(wi, {}),
|
|
4793
4764
|
t.after ? /* @__PURE__ */ s("span", { children: t.after }) : null
|
|
4794
4765
|
] }) : /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("span", { children: t.before }), t.after ? /* @__PURE__ */ s("span", { children: t.after }) : null] });
|
|
4795
4766
|
}
|
|
4796
|
-
function
|
|
4767
|
+
function Ci() {
|
|
4797
4768
|
return /* @__PURE__ */ s("span", {
|
|
4798
4769
|
className: "printable-blank-line",
|
|
4799
4770
|
"aria-hidden": "true"
|
|
4800
4771
|
});
|
|
4801
4772
|
}
|
|
4802
|
-
function
|
|
4773
|
+
function wi() {
|
|
4803
4774
|
return /* @__PURE__ */ s("span", {
|
|
4804
4775
|
className: "printable-blank-box",
|
|
4805
4776
|
"aria-hidden": "true"
|
|
4806
4777
|
});
|
|
4807
4778
|
}
|
|
4808
|
-
function
|
|
4779
|
+
function Ti(e) {
|
|
4809
4780
|
return e.startsWith("ar");
|
|
4810
4781
|
}
|
|
4811
|
-
function
|
|
4812
|
-
return
|
|
4782
|
+
function Ei(e) {
|
|
4783
|
+
return Ti(e) ? {
|
|
4813
4784
|
answerArea: "مساحة الجواب",
|
|
4814
4785
|
countShort: "عدد",
|
|
4815
4786
|
dragArea: "اربط أو اكتب الجواب",
|
|
@@ -4846,7 +4817,7 @@ function Ti(e) {
|
|
|
4846
4817
|
}
|
|
4847
4818
|
//#endregion
|
|
4848
4819
|
//#region src/exam-session/interactions/DraftSheet.tsx
|
|
4849
|
-
function
|
|
4820
|
+
function Di({ disabled: e, onChange: t, value: n }) {
|
|
4850
4821
|
let [r, i] = a(!1);
|
|
4851
4822
|
return /* @__PURE__ */ s("aside", {
|
|
4852
4823
|
className: "draft-sheet",
|
|
@@ -4882,7 +4853,7 @@ function Ei({ disabled: e, onChange: t, value: n }) {
|
|
|
4882
4853
|
}
|
|
4883
4854
|
//#endregion
|
|
4884
4855
|
//#region src/exam-session/interactions/ProblemSheetComposer.tsx
|
|
4885
|
-
var
|
|
4856
|
+
var Oi = 460, ki = [
|
|
4886
4857
|
"#0f172a",
|
|
4887
4858
|
"#0b5ed7",
|
|
4888
4859
|
"#18c7c9",
|
|
@@ -4890,7 +4861,7 @@ var Di = 460, Oi = [
|
|
|
4890
4861
|
"#f59e0b",
|
|
4891
4862
|
"#ef4444",
|
|
4892
4863
|
"#7c3aed"
|
|
4893
|
-
],
|
|
4864
|
+
], Ai = {
|
|
4894
4865
|
delete: "Supprimer l’élément",
|
|
4895
4866
|
eraser: "Gomme",
|
|
4896
4867
|
fillColor: "Remplissage",
|
|
@@ -4916,11 +4887,11 @@ var Di = 460, Oi = [
|
|
|
4916
4887
|
textColor: "Couleur du texte",
|
|
4917
4888
|
textPlaceholder: "Écrivez le texte à placer sur la feuille"
|
|
4918
4889
|
};
|
|
4919
|
-
function
|
|
4890
|
+
function ji({ config: e, labels: t, onChange: l }) {
|
|
4920
4891
|
let u = r(() => ({
|
|
4921
|
-
...
|
|
4892
|
+
...Ai,
|
|
4922
4893
|
...t
|
|
4923
|
-
}), [t]), d = i(null), f = i(null), [p, m] = a(Q), [h, _] = a("select"), [v, y] = a(!1), [x, w] = a(null), [T, E] = a(""), [
|
|
4894
|
+
}), [t]), d = i(null), f = i(null), [p, m] = a(Q), [h, _] = a("select"), [v, y] = a(!1), [x, w] = a(null), [T, E] = a(""), [D, ee] = a(ki[0]), [k, A] = a(4), [M, te] = a(null), P = qi(e.height), F = e.elements ?? [], I = F.find((e) => e.id === x);
|
|
4924
4895
|
n(() => {
|
|
4925
4896
|
let e = d.current;
|
|
4926
4897
|
if (!e) return;
|
|
@@ -4929,24 +4900,24 @@ function Ai({ config: e, labels: t, onChange: l }) {
|
|
|
4929
4900
|
let n = new ResizeObserver(t);
|
|
4930
4901
|
return n.observe(e), () => n.disconnect();
|
|
4931
4902
|
}, []);
|
|
4932
|
-
let
|
|
4933
|
-
function
|
|
4903
|
+
let L = Math.min(Q, p), R = L / Q;
|
|
4904
|
+
function z(t) {
|
|
4934
4905
|
l({
|
|
4935
4906
|
...e,
|
|
4936
4907
|
elements: t
|
|
4937
4908
|
});
|
|
4938
4909
|
}
|
|
4939
|
-
function
|
|
4940
|
-
|
|
4910
|
+
function B(e, t) {
|
|
4911
|
+
z(F.map((n) => n.id === e ? {
|
|
4941
4912
|
...n,
|
|
4942
4913
|
...t
|
|
4943
4914
|
} : n));
|
|
4944
4915
|
}
|
|
4945
|
-
function
|
|
4946
|
-
let t =
|
|
4916
|
+
function re(e) {
|
|
4917
|
+
let t = Gi(e), n = {
|
|
4947
4918
|
fill: "#e8f1ff",
|
|
4948
4919
|
height: t.height,
|
|
4949
|
-
id:
|
|
4920
|
+
id: Ui(e),
|
|
4950
4921
|
rotation: 0,
|
|
4951
4922
|
shape: e,
|
|
4952
4923
|
stroke: "#0f172a",
|
|
@@ -4954,13 +4925,13 @@ function Ai({ config: e, labels: t, onChange: l }) {
|
|
|
4954
4925
|
type: "shape",
|
|
4955
4926
|
width: t.width,
|
|
4956
4927
|
x: 140,
|
|
4957
|
-
y:
|
|
4928
|
+
y: Wi(F.length, P)
|
|
4958
4929
|
};
|
|
4959
|
-
|
|
4930
|
+
z(F.concat(n)), w(n.id), _("select"), y(!1);
|
|
4960
4931
|
}
|
|
4961
|
-
async function
|
|
4932
|
+
async function ae(e) {
|
|
4962
4933
|
if (!e || !e.type.startsWith("image/")) return;
|
|
4963
|
-
let { height: t, source: n, width: r } = await
|
|
4934
|
+
let { height: t, source: n, width: r } = await Yi(e), i = Math.min(320, Math.max(140, r)), a = {
|
|
4964
4935
|
crop: {
|
|
4965
4936
|
height: 1,
|
|
4966
4937
|
width: 1,
|
|
@@ -4968,18 +4939,18 @@ function Ai({ config: e, labels: t, onChange: l }) {
|
|
|
4968
4939
|
y: 0
|
|
4969
4940
|
},
|
|
4970
4941
|
height: Math.min(300, Math.max(90, Math.round(t / r * i))),
|
|
4971
|
-
id:
|
|
4942
|
+
id: Ui("image"),
|
|
4972
4943
|
rotation: 0,
|
|
4973
4944
|
source: n,
|
|
4974
4945
|
type: "image",
|
|
4975
4946
|
width: i,
|
|
4976
4947
|
x: 140,
|
|
4977
|
-
y:
|
|
4948
|
+
y: Wi(F.length, P)
|
|
4978
4949
|
};
|
|
4979
|
-
|
|
4950
|
+
z(F.concat(a)), w(a.id), _("select");
|
|
4980
4951
|
}
|
|
4981
|
-
function
|
|
4982
|
-
let n =
|
|
4952
|
+
function H(e, t) {
|
|
4953
|
+
let n = Ji({
|
|
4983
4954
|
height: 1,
|
|
4984
4955
|
width: 1,
|
|
4985
4956
|
x: 0,
|
|
@@ -4987,91 +4958,91 @@ function Ai({ config: e, labels: t, onChange: l }) {
|
|
|
4987
4958
|
...e.crop,
|
|
4988
4959
|
...t
|
|
4989
4960
|
});
|
|
4990
|
-
|
|
4961
|
+
B(e.id, { crop: n });
|
|
4991
4962
|
}
|
|
4992
|
-
function
|
|
4963
|
+
function oe() {
|
|
4993
4964
|
_("text"), w(null), E("");
|
|
4994
4965
|
}
|
|
4995
|
-
function
|
|
4996
|
-
if (
|
|
4997
|
-
|
|
4966
|
+
function se(e) {
|
|
4967
|
+
if (I?.type === "text") {
|
|
4968
|
+
B(I.id, { text: e });
|
|
4998
4969
|
return;
|
|
4999
4970
|
}
|
|
5000
4971
|
if (E(e), h !== "text" || !e) return;
|
|
5001
4972
|
let t = {
|
|
5002
|
-
color:
|
|
4973
|
+
color: ki[0],
|
|
5003
4974
|
fontSize: 28,
|
|
5004
|
-
id:
|
|
4975
|
+
id: Ui("text"),
|
|
5005
4976
|
text: e,
|
|
5006
4977
|
type: "text",
|
|
5007
4978
|
x: 120,
|
|
5008
|
-
y:
|
|
4979
|
+
y: Wi(F.length, P)
|
|
5009
4980
|
};
|
|
5010
|
-
|
|
4981
|
+
z(F.concat(t)), w(t.id), _("select");
|
|
5011
4982
|
}
|
|
5012
|
-
function
|
|
5013
|
-
x && (
|
|
4983
|
+
function U() {
|
|
4984
|
+
x && (z(F.filter((e) => e.id !== x)), w(null));
|
|
5014
4985
|
}
|
|
5015
|
-
function
|
|
4986
|
+
function ce(e) {
|
|
5016
4987
|
let t = e.target.getStage()?.getPointerPosition();
|
|
5017
4988
|
return t ? {
|
|
5018
|
-
x:
|
|
5019
|
-
y:
|
|
4989
|
+
x: Ki(t.x / R, 0, Q),
|
|
4990
|
+
y: Ki(t.y / R, 0, P)
|
|
5020
4991
|
} : null;
|
|
5021
4992
|
}
|
|
5022
|
-
function
|
|
4993
|
+
function le(e) {
|
|
5023
4994
|
if (h === "eraser") {
|
|
5024
|
-
|
|
4995
|
+
G(e);
|
|
5025
4996
|
return;
|
|
5026
4997
|
}
|
|
5027
4998
|
if (h !== "pen") return;
|
|
5028
|
-
let t =
|
|
5029
|
-
t && (w(null),
|
|
5030
|
-
color:
|
|
5031
|
-
id:
|
|
4999
|
+
let t = ce(e);
|
|
5000
|
+
t && (w(null), te({
|
|
5001
|
+
color: D,
|
|
5002
|
+
id: Ui("drawing"),
|
|
5032
5003
|
points: [0, 0],
|
|
5033
|
-
strokeWidth:
|
|
5004
|
+
strokeWidth: k,
|
|
5034
5005
|
type: "drawing",
|
|
5035
5006
|
x: t.x,
|
|
5036
5007
|
y: t.y
|
|
5037
5008
|
}));
|
|
5038
5009
|
}
|
|
5039
|
-
function
|
|
5010
|
+
function ue(e) {
|
|
5040
5011
|
if (h === "eraser") {
|
|
5041
|
-
|
|
5012
|
+
G(e);
|
|
5042
5013
|
return;
|
|
5043
5014
|
}
|
|
5044
|
-
if (!
|
|
5045
|
-
let t =
|
|
5046
|
-
t &&
|
|
5047
|
-
...
|
|
5048
|
-
points:
|
|
5015
|
+
if (!M) return;
|
|
5016
|
+
let t = ce(e);
|
|
5017
|
+
t && te({
|
|
5018
|
+
...M,
|
|
5019
|
+
points: M.points.concat([t.x - M.x, t.y - M.y])
|
|
5049
5020
|
});
|
|
5050
5021
|
}
|
|
5051
|
-
function
|
|
5052
|
-
|
|
5022
|
+
function W() {
|
|
5023
|
+
M && (M.points.length >= 4 && (z(F.concat(M)), w(M.id)), te(null));
|
|
5053
5024
|
}
|
|
5054
|
-
function
|
|
5025
|
+
function de(e, t, n, r) {
|
|
5055
5026
|
if (t === "end") {
|
|
5056
|
-
|
|
5027
|
+
B(e.id, {
|
|
5057
5028
|
height: r,
|
|
5058
5029
|
width: n
|
|
5059
5030
|
});
|
|
5060
5031
|
return;
|
|
5061
5032
|
}
|
|
5062
5033
|
let i = e.x + e.width, a = e.y + e.height, o = e.x + n, s = e.y + r;
|
|
5063
|
-
|
|
5034
|
+
B(e.id, {
|
|
5064
5035
|
height: a - s,
|
|
5065
5036
|
width: i - o,
|
|
5066
5037
|
x: o,
|
|
5067
5038
|
y: s
|
|
5068
5039
|
});
|
|
5069
5040
|
}
|
|
5070
|
-
function
|
|
5071
|
-
let t =
|
|
5041
|
+
function G(e) {
|
|
5042
|
+
let t = ce(e);
|
|
5072
5043
|
if (t) {
|
|
5073
|
-
for (let e =
|
|
5074
|
-
|
|
5044
|
+
for (let e = F.length - 1; e >= 0; --e) if (Vi(F[e], t)) {
|
|
5045
|
+
z(F.filter((t, n) => n !== e)), w(null);
|
|
5075
5046
|
return;
|
|
5076
5047
|
}
|
|
5077
5048
|
}
|
|
@@ -5084,180 +5055,180 @@ function Ai({ config: e, labels: t, onChange: l }) {
|
|
|
5084
5055
|
className: "problem-sheet-composer__toolbar",
|
|
5085
5056
|
role: "toolbar",
|
|
5086
5057
|
children: [
|
|
5087
|
-
/* @__PURE__ */ s(
|
|
5058
|
+
/* @__PURE__ */ s(Mi, {
|
|
5088
5059
|
active: h === "select",
|
|
5089
5060
|
label: u.move,
|
|
5090
5061
|
onClick: () => _("select"),
|
|
5091
5062
|
children: /* @__PURE__ */ s(S, { "aria-hidden": "true" })
|
|
5092
5063
|
}),
|
|
5093
|
-
/* @__PURE__ */ s(
|
|
5064
|
+
/* @__PURE__ */ s(Mi, {
|
|
5094
5065
|
active: h === "text",
|
|
5095
5066
|
label: u.text,
|
|
5096
|
-
onClick:
|
|
5097
|
-
children: /* @__PURE__ */ s(
|
|
5067
|
+
onClick: oe,
|
|
5068
|
+
children: /* @__PURE__ */ s(N, { "aria-hidden": "true" })
|
|
5098
5069
|
}),
|
|
5099
5070
|
/* @__PURE__ */ c("div", {
|
|
5100
5071
|
className: "problem-sheet-composer__shape-menu",
|
|
5101
|
-
children: [/* @__PURE__ */ s(
|
|
5072
|
+
children: [/* @__PURE__ */ s(Mi, {
|
|
5102
5073
|
active: v,
|
|
5103
5074
|
label: u.shapeLibrary,
|
|
5104
5075
|
onClick: () => y((e) => !e),
|
|
5105
|
-
children: /* @__PURE__ */ s(
|
|
5076
|
+
children: /* @__PURE__ */ s(O, { "aria-hidden": "true" })
|
|
5106
5077
|
}), v ? /* @__PURE__ */ s("div", {
|
|
5107
5078
|
"aria-label": u.shapeLibrary,
|
|
5108
5079
|
className: "problem-sheet-composer__shape-picker",
|
|
5109
5080
|
role: "menu",
|
|
5110
|
-
children:
|
|
5081
|
+
children: mn.map((e) => /* @__PURE__ */ c("section", {
|
|
5111
5082
|
className: "problem-sheet-composer__shape-group",
|
|
5112
5083
|
children: [/* @__PURE__ */ s("span", { children: e.label }), /* @__PURE__ */ s("div", { children: e.shapes.map((e) => {
|
|
5113
|
-
let t = u.shapes[e] ??
|
|
5084
|
+
let t = u.shapes[e] ?? gn(e);
|
|
5114
5085
|
return /* @__PURE__ */ c("button", {
|
|
5115
5086
|
"aria-label": t,
|
|
5116
|
-
onClick: () =>
|
|
5087
|
+
onClick: () => re(e),
|
|
5117
5088
|
title: t,
|
|
5118
5089
|
type: "button",
|
|
5119
|
-
children: [/* @__PURE__ */ s(
|
|
5090
|
+
children: [/* @__PURE__ */ s(Ni, { shape: e }), /* @__PURE__ */ s("span", { children: t })]
|
|
5120
5091
|
}, e);
|
|
5121
5092
|
}) })]
|
|
5122
5093
|
}, e.id))
|
|
5123
5094
|
}) : null]
|
|
5124
5095
|
}),
|
|
5125
|
-
/* @__PURE__ */ s(
|
|
5096
|
+
/* @__PURE__ */ s(Mi, {
|
|
5126
5097
|
label: u.image,
|
|
5127
5098
|
onClick: () => f.current?.click(),
|
|
5128
5099
|
children: /* @__PURE__ */ s(b, { "aria-hidden": "true" })
|
|
5129
5100
|
}),
|
|
5130
|
-
/* @__PURE__ */ s(
|
|
5101
|
+
/* @__PURE__ */ s(Mi, {
|
|
5131
5102
|
active: h === "pen",
|
|
5132
5103
|
label: u.pen,
|
|
5133
5104
|
onClick: () => _((e) => e === "pen" ? "select" : "pen"),
|
|
5134
5105
|
children: /* @__PURE__ */ s(C, { "aria-hidden": "true" })
|
|
5135
5106
|
}),
|
|
5136
|
-
/* @__PURE__ */ s(
|
|
5107
|
+
/* @__PURE__ */ s(Mi, {
|
|
5137
5108
|
active: h === "eraser",
|
|
5138
5109
|
label: u.eraser,
|
|
5139
5110
|
onClick: () => _((e) => e === "eraser" ? "select" : "eraser"),
|
|
5140
5111
|
children: /* @__PURE__ */ s(g, { "aria-hidden": "true" })
|
|
5141
5112
|
}),
|
|
5142
5113
|
/* @__PURE__ */ s("span", { className: "problem-sheet-composer__toolbar-divider" }),
|
|
5143
|
-
/* @__PURE__ */ s(
|
|
5144
|
-
disabled: !
|
|
5114
|
+
/* @__PURE__ */ s(Mi, {
|
|
5115
|
+
disabled: !I,
|
|
5145
5116
|
label: u.delete,
|
|
5146
|
-
onClick:
|
|
5147
|
-
children: /* @__PURE__ */ s(
|
|
5117
|
+
onClick: U,
|
|
5118
|
+
children: /* @__PURE__ */ s(j, { "aria-hidden": "true" })
|
|
5148
5119
|
})
|
|
5149
5120
|
]
|
|
5150
5121
|
}),
|
|
5151
|
-
h === "text" ||
|
|
5122
|
+
h === "text" || I?.type === "text" ? /* @__PURE__ */ c("div", {
|
|
5152
5123
|
className: "problem-sheet-composer__inspector",
|
|
5153
5124
|
children: [/* @__PURE__ */ c("label", {
|
|
5154
5125
|
className: "problem-sheet-composer__selected-text",
|
|
5155
5126
|
children: [/* @__PURE__ */ s("span", { children: u.text }), /* @__PURE__ */ s("textarea", {
|
|
5156
5127
|
dir: "auto",
|
|
5157
|
-
onChange: (e) =>
|
|
5128
|
+
onChange: (e) => se(e.target.value),
|
|
5158
5129
|
placeholder: u.textPlaceholder,
|
|
5159
5130
|
rows: 3,
|
|
5160
|
-
value:
|
|
5131
|
+
value: I?.type === "text" ? I.text : T
|
|
5161
5132
|
})]
|
|
5162
|
-
}),
|
|
5133
|
+
}), I?.type === "text" ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(Pi, {
|
|
5163
5134
|
label: u.textColor,
|
|
5164
|
-
onSelect: (e) =>
|
|
5165
|
-
value:
|
|
5135
|
+
onSelect: (e) => B(I.id, { color: e }),
|
|
5136
|
+
value: I.color ?? ki[0]
|
|
5166
5137
|
}), /* @__PURE__ */ s($, {
|
|
5167
5138
|
label: u.fontSize,
|
|
5168
5139
|
max: 72,
|
|
5169
5140
|
min: 12,
|
|
5170
|
-
onChange: (e) =>
|
|
5171
|
-
value:
|
|
5141
|
+
onChange: (e) => B(I.id, { fontSize: e }),
|
|
5142
|
+
value: I.fontSize ?? 28
|
|
5172
5143
|
})] }) : null]
|
|
5173
5144
|
}) : null,
|
|
5174
|
-
|
|
5145
|
+
I?.type === "shape" ? /* @__PURE__ */ c("div", {
|
|
5175
5146
|
className: "problem-sheet-composer__inspector problem-sheet-composer__inspector--shape",
|
|
5176
5147
|
children: [
|
|
5177
|
-
/* @__PURE__ */ s(
|
|
5148
|
+
/* @__PURE__ */ s(Pi, {
|
|
5178
5149
|
label: u.fillColor,
|
|
5179
|
-
onSelect: (e) =>
|
|
5180
|
-
value:
|
|
5150
|
+
onSelect: (e) => B(I.id, { fill: e }),
|
|
5151
|
+
value: I.fill ?? "#e8f1ff"
|
|
5181
5152
|
}),
|
|
5182
|
-
/* @__PURE__ */ s(
|
|
5153
|
+
/* @__PURE__ */ s(Pi, {
|
|
5183
5154
|
label: u.strokeColor,
|
|
5184
|
-
onSelect: (e) =>
|
|
5185
|
-
value:
|
|
5155
|
+
onSelect: (e) => B(I.id, { stroke: e }),
|
|
5156
|
+
value: I.stroke ?? ki[0]
|
|
5186
5157
|
}),
|
|
5187
5158
|
/* @__PURE__ */ s($, {
|
|
5188
5159
|
label: u.strokeWidth,
|
|
5189
5160
|
max: 12,
|
|
5190
5161
|
min: 1,
|
|
5191
|
-
onChange: (e) =>
|
|
5192
|
-
value:
|
|
5162
|
+
onChange: (e) => B(I.id, { strokeWidth: e }),
|
|
5163
|
+
value: I.strokeWidth ?? 3
|
|
5193
5164
|
}),
|
|
5194
5165
|
/* @__PURE__ */ s($, {
|
|
5195
|
-
label:
|
|
5166
|
+
label: I.shape === "line" ? u.lineLength : u.shapeWidth,
|
|
5196
5167
|
max: 500,
|
|
5197
5168
|
min: 40,
|
|
5198
|
-
onChange: (e) =>
|
|
5169
|
+
onChange: (e) => B(I.id, _n(I.shape) ? {
|
|
5199
5170
|
height: e,
|
|
5200
5171
|
width: e
|
|
5201
5172
|
} : { width: e }),
|
|
5202
|
-
value:
|
|
5173
|
+
value: I.width
|
|
5203
5174
|
}),
|
|
5204
5175
|
/* @__PURE__ */ s($, {
|
|
5205
|
-
label:
|
|
5206
|
-
max:
|
|
5207
|
-
min:
|
|
5208
|
-
onChange: (e) =>
|
|
5176
|
+
label: I.shape === "line" ? u.lineSlope : u.shapeHeight,
|
|
5177
|
+
max: I.shape === "line" ? 300 : 500,
|
|
5178
|
+
min: I.shape === "line" ? -300 : 40,
|
|
5179
|
+
onChange: (e) => B(I.id, _n(I.shape) ? {
|
|
5209
5180
|
height: e,
|
|
5210
5181
|
width: e
|
|
5211
5182
|
} : { height: e }),
|
|
5212
|
-
value:
|
|
5183
|
+
value: I.height
|
|
5213
5184
|
})
|
|
5214
5185
|
]
|
|
5215
5186
|
}) : null,
|
|
5216
|
-
|
|
5187
|
+
I?.type === "image" ? /* @__PURE__ */ c("div", {
|
|
5217
5188
|
className: "problem-sheet-composer__inspector problem-sheet-composer__inspector--image",
|
|
5218
5189
|
children: [
|
|
5219
5190
|
/* @__PURE__ */ s($, {
|
|
5220
5191
|
label: u.cropX,
|
|
5221
5192
|
max: 100,
|
|
5222
5193
|
min: 0,
|
|
5223
|
-
onChange: (e) =>
|
|
5224
|
-
value: (
|
|
5194
|
+
onChange: (e) => H(I, { x: e / 100 }),
|
|
5195
|
+
value: (I.crop?.x ?? 0) * 100
|
|
5225
5196
|
}),
|
|
5226
5197
|
/* @__PURE__ */ s($, {
|
|
5227
5198
|
label: u.cropY,
|
|
5228
5199
|
max: 100,
|
|
5229
5200
|
min: 0,
|
|
5230
|
-
onChange: (e) =>
|
|
5231
|
-
value: (
|
|
5201
|
+
onChange: (e) => H(I, { y: e / 100 }),
|
|
5202
|
+
value: (I.crop?.y ?? 0) * 100
|
|
5232
5203
|
}),
|
|
5233
5204
|
/* @__PURE__ */ s($, {
|
|
5234
5205
|
label: u.cropWidth,
|
|
5235
5206
|
max: 100,
|
|
5236
5207
|
min: 5,
|
|
5237
|
-
onChange: (e) =>
|
|
5238
|
-
value: (
|
|
5208
|
+
onChange: (e) => H(I, { width: e / 100 }),
|
|
5209
|
+
value: (I.crop?.width ?? 1) * 100
|
|
5239
5210
|
}),
|
|
5240
5211
|
/* @__PURE__ */ s($, {
|
|
5241
5212
|
label: u.cropHeight,
|
|
5242
5213
|
max: 100,
|
|
5243
5214
|
min: 5,
|
|
5244
|
-
onChange: (e) =>
|
|
5245
|
-
value: (
|
|
5215
|
+
onChange: (e) => H(I, { height: e / 100 }),
|
|
5216
|
+
value: (I.crop?.height ?? 1) * 100
|
|
5246
5217
|
})
|
|
5247
5218
|
]
|
|
5248
5219
|
}) : null,
|
|
5249
5220
|
h === "pen" ? /* @__PURE__ */ c("div", {
|
|
5250
5221
|
className: "problem-sheet-composer__inspector problem-sheet-composer__inspector--pen",
|
|
5251
|
-
children: [/* @__PURE__ */ s(
|
|
5222
|
+
children: [/* @__PURE__ */ s(Pi, {
|
|
5252
5223
|
label: u.penColor,
|
|
5253
|
-
onSelect:
|
|
5254
|
-
value:
|
|
5224
|
+
onSelect: ee,
|
|
5225
|
+
value: D
|
|
5255
5226
|
}), /* @__PURE__ */ s($, {
|
|
5256
5227
|
label: u.penWidth,
|
|
5257
5228
|
max: 12,
|
|
5258
5229
|
min: 1,
|
|
5259
|
-
onChange:
|
|
5260
|
-
value:
|
|
5230
|
+
onChange: A,
|
|
5231
|
+
value: k
|
|
5261
5232
|
})]
|
|
5262
5233
|
}) : null,
|
|
5263
5234
|
/* @__PURE__ */ c("div", {
|
|
@@ -5267,47 +5238,47 @@ function Ai({ config: e, labels: t, onChange: l }) {
|
|
|
5267
5238
|
accept: "image/*",
|
|
5268
5239
|
className: "problem-sheet-composer__image-input",
|
|
5269
5240
|
onChange: (e) => {
|
|
5270
|
-
|
|
5241
|
+
ae(e.target.files?.[0]), e.target.value = "";
|
|
5271
5242
|
},
|
|
5272
5243
|
ref: f,
|
|
5273
5244
|
type: "file"
|
|
5274
|
-
}), /* @__PURE__ */ s(
|
|
5275
|
-
height:
|
|
5276
|
-
onMouseDown:
|
|
5277
|
-
onMouseLeave:
|
|
5278
|
-
onMouseMove:
|
|
5279
|
-
onMouseUp:
|
|
5280
|
-
onTouchEnd:
|
|
5281
|
-
onTouchMove:
|
|
5282
|
-
onTouchStart:
|
|
5283
|
-
width:
|
|
5284
|
-
children: /* @__PURE__ */ c(
|
|
5285
|
-
scaleX:
|
|
5286
|
-
scaleY:
|
|
5245
|
+
}), /* @__PURE__ */ s(ie, {
|
|
5246
|
+
height: P * R,
|
|
5247
|
+
onMouseDown: le,
|
|
5248
|
+
onMouseLeave: W,
|
|
5249
|
+
onMouseMove: ue,
|
|
5250
|
+
onMouseUp: W,
|
|
5251
|
+
onTouchEnd: W,
|
|
5252
|
+
onTouchMove: ue,
|
|
5253
|
+
onTouchStart: le,
|
|
5254
|
+
width: L,
|
|
5255
|
+
children: /* @__PURE__ */ c(ne, {
|
|
5256
|
+
scaleX: R,
|
|
5257
|
+
scaleY: R,
|
|
5287
5258
|
children: [
|
|
5288
|
-
/* @__PURE__ */ s(
|
|
5289
|
-
fill:
|
|
5290
|
-
height:
|
|
5259
|
+
/* @__PURE__ */ s(V, {
|
|
5260
|
+
fill: Sn(e.background),
|
|
5261
|
+
height: P,
|
|
5291
5262
|
width: Q
|
|
5292
5263
|
}),
|
|
5293
|
-
/* @__PURE__ */ s(
|
|
5294
|
-
height:
|
|
5264
|
+
/* @__PURE__ */ s(Cn, {
|
|
5265
|
+
height: P,
|
|
5295
5266
|
paper: e.paper ?? "squared"
|
|
5296
5267
|
}),
|
|
5297
|
-
|
|
5268
|
+
F.map((e) => /* @__PURE__ */ s(Fi, {
|
|
5298
5269
|
draggable: h === "select",
|
|
5299
5270
|
element: e,
|
|
5300
|
-
onDragEnd: (t) =>
|
|
5271
|
+
onDragEnd: (t) => B(e.id, {
|
|
5301
5272
|
x: t.target.x(),
|
|
5302
5273
|
y: t.target.y()
|
|
5303
5274
|
}),
|
|
5304
5275
|
onSelect: () => w(e.id),
|
|
5305
|
-
onLineEndpointChange:
|
|
5306
|
-
onImageTransform: (e, t) =>
|
|
5307
|
-
onShapeTransform: (e, t) =>
|
|
5276
|
+
onLineEndpointChange: de,
|
|
5277
|
+
onImageTransform: (e, t) => B(e.id, t),
|
|
5278
|
+
onShapeTransform: (e, t) => B(e.id, t),
|
|
5308
5279
|
selected: e.id === x
|
|
5309
5280
|
}, e.id)),
|
|
5310
|
-
|
|
5281
|
+
M ? /* @__PURE__ */ s(Ri, { element: M }) : null
|
|
5311
5282
|
]
|
|
5312
5283
|
})
|
|
5313
5284
|
})]
|
|
@@ -5315,7 +5286,7 @@ function Ai({ config: e, labels: t, onChange: l }) {
|
|
|
5315
5286
|
]
|
|
5316
5287
|
});
|
|
5317
5288
|
}
|
|
5318
|
-
function
|
|
5289
|
+
function Mi({ active: e = !1, children: t, disabled: n = !1, label: r, onClick: i }) {
|
|
5319
5290
|
return /* @__PURE__ */ s("button", {
|
|
5320
5291
|
"aria-label": r,
|
|
5321
5292
|
className: e ? "problem-sheet-composer__tool problem-sheet-composer__tool--active" : "problem-sheet-composer__tool",
|
|
@@ -5326,18 +5297,18 @@ function ji({ active: e = !1, children: t, disabled: n = !1, label: r, onClick:
|
|
|
5326
5297
|
children: t
|
|
5327
5298
|
});
|
|
5328
5299
|
}
|
|
5329
|
-
function
|
|
5300
|
+
function Ni({ shape: e }) {
|
|
5330
5301
|
return /* @__PURE__ */ s("span", {
|
|
5331
5302
|
"aria-hidden": "true",
|
|
5332
5303
|
className: `problem-sheet-composer__shape-preview problem-sheet-composer__shape-preview--${e}`
|
|
5333
5304
|
});
|
|
5334
5305
|
}
|
|
5335
|
-
function
|
|
5306
|
+
function Pi({ label: e, onSelect: t, value: n }) {
|
|
5336
5307
|
return /* @__PURE__ */ c("div", {
|
|
5337
5308
|
className: "problem-sheet-composer__color-control",
|
|
5338
5309
|
children: [/* @__PURE__ */ s("span", { children: e }), /* @__PURE__ */ c("div", {
|
|
5339
5310
|
className: "problem-sheet-composer__swatches",
|
|
5340
|
-
children: [
|
|
5311
|
+
children: [ki.map((r) => /* @__PURE__ */ s("button", {
|
|
5341
5312
|
"aria-label": `${e}: ${r}`,
|
|
5342
5313
|
className: n.toLowerCase() === r ? "is-selected" : "",
|
|
5343
5314
|
onClick: () => t(r),
|
|
@@ -5368,8 +5339,8 @@ function $({ label: e, max: t, min: n, onChange: r, value: i }) {
|
|
|
5368
5339
|
})]
|
|
5369
5340
|
});
|
|
5370
5341
|
}
|
|
5371
|
-
function
|
|
5372
|
-
let p =
|
|
5342
|
+
function Fi({ draggable: e, element: n, onDragEnd: r, onImageTransform: a, onLineEndpointChange: l, onShapeTransform: u, onSelect: d, selected: f }) {
|
|
5343
|
+
let p = Bi(n), m = i(null), h = i(null), g = n.type === "image" || n.type === "shape" && n.shape !== "line", _ = f && g;
|
|
5373
5344
|
t(() => {
|
|
5374
5345
|
!_ || !m.current || !h.current || (h.current.nodes([m.current]), h.current.getLayer()?.batchDraw());
|
|
5375
5346
|
}, [n.id, _]);
|
|
@@ -5394,7 +5365,7 @@ function Pi({ draggable: e, element: n, onDragEnd: r, onImageTransform: a, onLin
|
|
|
5394
5365
|
y: e.y()
|
|
5395
5366
|
});
|
|
5396
5367
|
}
|
|
5397
|
-
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c(
|
|
5368
|
+
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c(R, {
|
|
5398
5369
|
draggable: e,
|
|
5399
5370
|
onClick: d,
|
|
5400
5371
|
onDragEnd: r,
|
|
@@ -5404,22 +5375,22 @@ function Pi({ draggable: e, element: n, onDragEnd: r, onImageTransform: a, onLin
|
|
|
5404
5375
|
x: n.x,
|
|
5405
5376
|
y: n.y,
|
|
5406
5377
|
children: [
|
|
5407
|
-
n.type === "text" ? /* @__PURE__ */ s(
|
|
5408
|
-
fill: n.color ??
|
|
5378
|
+
n.type === "text" ? /* @__PURE__ */ s(H, {
|
|
5379
|
+
fill: n.color ?? ki[0],
|
|
5409
5380
|
fontFamily: "Arial, sans-serif",
|
|
5410
5381
|
fontSize: n.fontSize ?? 28,
|
|
5411
5382
|
text: n.text,
|
|
5412
5383
|
width: 320
|
|
5413
|
-
}) : n.type === "drawing" ? /* @__PURE__ */ s(
|
|
5384
|
+
}) : n.type === "drawing" ? /* @__PURE__ */ s(Ri, { element: {
|
|
5414
5385
|
...n,
|
|
5415
5386
|
x: 0,
|
|
5416
5387
|
y: 0
|
|
5417
|
-
} }) : n.type === "image" ? /* @__PURE__ */ s(
|
|
5388
|
+
} }) : n.type === "image" ? /* @__PURE__ */ s(Ii, { element: {
|
|
5418
5389
|
...n,
|
|
5419
5390
|
x: 0,
|
|
5420
5391
|
y: 0
|
|
5421
|
-
} }) : /* @__PURE__ */ s(
|
|
5422
|
-
f && n.type !== "image" && !g ? /* @__PURE__ */ s(
|
|
5392
|
+
} }) : /* @__PURE__ */ s(zi, { element: n }),
|
|
5393
|
+
f && n.type !== "image" && !g ? /* @__PURE__ */ s(V, {
|
|
5423
5394
|
dash: [8, 5],
|
|
5424
5395
|
height: p.height + 14,
|
|
5425
5396
|
listening: !1,
|
|
@@ -5429,12 +5400,12 @@ function Pi({ draggable: e, element: n, onDragEnd: r, onImageTransform: a, onLin
|
|
|
5429
5400
|
x: p.x - 7,
|
|
5430
5401
|
y: p.y - 7
|
|
5431
5402
|
}) : null,
|
|
5432
|
-
f && n.type === "shape" && n.shape === "line" ? /* @__PURE__ */ s(
|
|
5403
|
+
f && n.type === "shape" && n.shape === "line" ? /* @__PURE__ */ s(Li, {
|
|
5433
5404
|
element: n,
|
|
5434
5405
|
onChange: l
|
|
5435
5406
|
}) : null
|
|
5436
5407
|
]
|
|
5437
|
-
}), _ ? /* @__PURE__ */ s(
|
|
5408
|
+
}), _ ? /* @__PURE__ */ s(oe, {
|
|
5438
5409
|
anchorCornerRadius: 7,
|
|
5439
5410
|
anchorFill: "#ffffff",
|
|
5440
5411
|
anchorSize: 12,
|
|
@@ -5452,17 +5423,17 @@ function Pi({ draggable: e, element: n, onDragEnd: r, onImageTransform: a, onLin
|
|
|
5452
5423
|
"middle-left"
|
|
5453
5424
|
],
|
|
5454
5425
|
flipEnabled: !1,
|
|
5455
|
-
keepRatio: n.type === "shape" &&
|
|
5426
|
+
keepRatio: n.type === "shape" && _n(n.shape),
|
|
5456
5427
|
onTransformEnd: v,
|
|
5457
5428
|
ref: h,
|
|
5458
5429
|
rotateEnabled: !0,
|
|
5459
5430
|
rotateLineVisible: !0
|
|
5460
5431
|
}) : null] });
|
|
5461
5432
|
}
|
|
5462
|
-
function
|
|
5463
|
-
let t =
|
|
5464
|
-
return t ? /* @__PURE__ */ s(
|
|
5465
|
-
crop:
|
|
5433
|
+
function Ii({ element: e }) {
|
|
5434
|
+
let t = En(e.source);
|
|
5435
|
+
return t ? /* @__PURE__ */ s(z, {
|
|
5436
|
+
crop: Dn(t, e.crop),
|
|
5466
5437
|
height: e.height,
|
|
5467
5438
|
image: t,
|
|
5468
5439
|
width: e.width,
|
|
@@ -5470,14 +5441,14 @@ function Fi({ element: e }) {
|
|
|
5470
5441
|
y: e.y
|
|
5471
5442
|
}) : null;
|
|
5472
5443
|
}
|
|
5473
|
-
function
|
|
5444
|
+
function Li({ element: e, onChange: t }) {
|
|
5474
5445
|
function n(n, r) {
|
|
5475
5446
|
r.cancelBubble = !0, t(e, n, r.target.x(), r.target.y());
|
|
5476
5447
|
}
|
|
5477
5448
|
function r(e) {
|
|
5478
5449
|
e.cancelBubble = !0;
|
|
5479
5450
|
}
|
|
5480
|
-
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(
|
|
5451
|
+
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(I, {
|
|
5481
5452
|
draggable: !0,
|
|
5482
5453
|
fill: "#ffffff",
|
|
5483
5454
|
onDragEnd: r,
|
|
@@ -5488,7 +5459,7 @@ function Ii({ element: e, onChange: t }) {
|
|
|
5488
5459
|
strokeWidth: 3,
|
|
5489
5460
|
x: 0,
|
|
5490
5461
|
y: 0
|
|
5491
|
-
}), /* @__PURE__ */ s(
|
|
5462
|
+
}), /* @__PURE__ */ s(I, {
|
|
5492
5463
|
draggable: !0,
|
|
5493
5464
|
fill: "#0b5ed7",
|
|
5494
5465
|
onDragEnd: r,
|
|
@@ -5501,25 +5472,25 @@ function Ii({ element: e, onChange: t }) {
|
|
|
5501
5472
|
y: e.height
|
|
5502
5473
|
})] });
|
|
5503
5474
|
}
|
|
5504
|
-
function
|
|
5505
|
-
return /* @__PURE__ */ s(
|
|
5475
|
+
function Ri({ element: e }) {
|
|
5476
|
+
return /* @__PURE__ */ s(B, {
|
|
5506
5477
|
lineCap: "round",
|
|
5507
5478
|
lineJoin: "round",
|
|
5508
5479
|
points: e.points,
|
|
5509
|
-
stroke: e.color ??
|
|
5480
|
+
stroke: e.color ?? ki[0],
|
|
5510
5481
|
strokeWidth: e.strokeWidth ?? 4,
|
|
5511
5482
|
tension: .38,
|
|
5512
5483
|
x: e.x,
|
|
5513
5484
|
y: e.y
|
|
5514
5485
|
});
|
|
5515
5486
|
}
|
|
5516
|
-
function
|
|
5517
|
-
return /* @__PURE__ */ s(
|
|
5487
|
+
function zi({ element: e }) {
|
|
5488
|
+
return /* @__PURE__ */ s(vn, {
|
|
5518
5489
|
element: e,
|
|
5519
5490
|
hitStrokeWidth: 32
|
|
5520
5491
|
});
|
|
5521
5492
|
}
|
|
5522
|
-
function
|
|
5493
|
+
function Bi(e) {
|
|
5523
5494
|
if (e.type === "text") return {
|
|
5524
5495
|
height: (e.fontSize ?? 28) * 1.5,
|
|
5525
5496
|
width: 320,
|
|
@@ -5557,12 +5528,12 @@ function zi(e) {
|
|
|
5557
5528
|
y: a
|
|
5558
5529
|
};
|
|
5559
5530
|
}
|
|
5560
|
-
function
|
|
5531
|
+
function Vi(e, t) {
|
|
5561
5532
|
if (e.type === "text") {
|
|
5562
5533
|
let n = (e.fontSize ?? 28) * 1.5;
|
|
5563
5534
|
return t.x >= e.x - 12 && t.x <= e.x + 332 && t.y >= e.y - 12 && t.y <= e.y + n + 12;
|
|
5564
5535
|
}
|
|
5565
|
-
if (e.type === "shape") return e.shape === "line" ?
|
|
5536
|
+
if (e.type === "shape") return e.shape === "line" ? Hi(t, {
|
|
5566
5537
|
x: e.x,
|
|
5567
5538
|
y: e.y
|
|
5568
5539
|
}, {
|
|
@@ -5570,7 +5541,7 @@ function Bi(e, t) {
|
|
|
5570
5541
|
y: e.y + e.height
|
|
5571
5542
|
}) <= 16 : t.x >= e.x - 12 && t.x <= e.x + e.width + 12 && t.y >= e.y - 12 && t.y <= e.y + e.height + 12;
|
|
5572
5543
|
if (e.type === "image") return t.x >= e.x - 12 && t.x <= e.x + e.width + 12 && t.y >= e.y - 12 && t.y <= e.y + e.height + 12;
|
|
5573
|
-
for (let n = 0; n < e.points.length - 2; n += 2) if (
|
|
5544
|
+
for (let n = 0; n < e.points.length - 2; n += 2) if (Hi(t, {
|
|
5574
5545
|
x: e.x + e.points[n],
|
|
5575
5546
|
y: e.y + e.points[n + 1]
|
|
5576
5547
|
}, {
|
|
@@ -5579,19 +5550,19 @@ function Bi(e, t) {
|
|
|
5579
5550
|
}) <= 16) return !0;
|
|
5580
5551
|
return !1;
|
|
5581
5552
|
}
|
|
5582
|
-
function
|
|
5553
|
+
function Hi(e, t, n) {
|
|
5583
5554
|
let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
|
|
5584
5555
|
if (a === 0) return Math.hypot(e.x - t.x, e.y - t.y);
|
|
5585
|
-
let o =
|
|
5556
|
+
let o = Ki(((e.x - t.x) * r + (e.y - t.y) * i) / a, 0, 1), s = t.x + o * r, c = t.y + o * i;
|
|
5586
5557
|
return Math.hypot(e.x - s, e.y - c);
|
|
5587
5558
|
}
|
|
5588
|
-
function
|
|
5559
|
+
function Ui(e) {
|
|
5589
5560
|
return `${e}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
5590
5561
|
}
|
|
5591
|
-
function
|
|
5562
|
+
function Wi(e, t) {
|
|
5592
5563
|
return Math.min(t - 140, 80 + e % 5 * 70);
|
|
5593
5564
|
}
|
|
5594
|
-
function
|
|
5565
|
+
function Gi(e) {
|
|
5595
5566
|
return e === "line" ? {
|
|
5596
5567
|
height: 0,
|
|
5597
5568
|
width: 210
|
|
@@ -5609,22 +5580,22 @@ function Wi(e) {
|
|
|
5609
5580
|
width: 180
|
|
5610
5581
|
};
|
|
5611
5582
|
}
|
|
5612
|
-
function
|
|
5583
|
+
function Ki(e, t, n) {
|
|
5613
5584
|
return Math.min(n, Math.max(t, e));
|
|
5614
5585
|
}
|
|
5615
|
-
function Ki(e) {
|
|
5616
|
-
return Number.isFinite(e) ? Math.min(900, Math.max(220, Math.round(e ?? Di))) : Di;
|
|
5617
|
-
}
|
|
5618
5586
|
function qi(e) {
|
|
5619
|
-
|
|
5587
|
+
return Number.isFinite(e) ? Math.min(900, Math.max(220, Math.round(e ?? Oi))) : Oi;
|
|
5588
|
+
}
|
|
5589
|
+
function Ji(e) {
|
|
5590
|
+
let t = Ki(e.width, .05, 1), n = Ki(e.height, .05, 1);
|
|
5620
5591
|
return {
|
|
5621
5592
|
height: n,
|
|
5622
5593
|
width: t,
|
|
5623
|
-
x:
|
|
5624
|
-
y:
|
|
5594
|
+
x: Ki(e.x, 0, 1 - t),
|
|
5595
|
+
y: Ki(e.y, 0, 1 - n)
|
|
5625
5596
|
};
|
|
5626
5597
|
}
|
|
5627
|
-
async function
|
|
5598
|
+
async function Yi(e) {
|
|
5628
5599
|
let t = await new Promise((t, n) => {
|
|
5629
5600
|
let r = new FileReader();
|
|
5630
5601
|
r.onerror = () => n(/* @__PURE__ */ Error("Unable to read image file.")), r.onload = () => t(String(r.result)), r.readAsDataURL(e);
|
|
@@ -5642,7 +5613,7 @@ async function Ji(e) {
|
|
|
5642
5613
|
}
|
|
5643
5614
|
//#endregion
|
|
5644
5615
|
//#region src/exam-session/interactions/SingleChoice.tsx
|
|
5645
|
-
function
|
|
5616
|
+
function Xi({ answerId: e, choices: t, value: n, onChange: r }) {
|
|
5646
5617
|
return /* @__PURE__ */ s("div", {
|
|
5647
5618
|
className: "choice-group",
|
|
5648
5619
|
role: "radiogroup",
|
|
@@ -5667,4 +5638,4 @@ function Yi({ answerId: e, choices: t, value: n, onChange: r }) {
|
|
|
5667
5638
|
});
|
|
5668
5639
|
}
|
|
5669
5640
|
//#endregion
|
|
5670
|
-
export {
|
|
5641
|
+
export { Je as CoinTableResponse, ct as ColorPenPicker, lt as DEFAULT_GEOMETRY_COLORS, Nn as DEFAULT_NATIVE_VOICE_AI_CONFIG, Di as DraftSheet, et as DragMatch, hr as ExamSectionRenderer, wt as GeometryCanvas, ot as HandwrittenNumberAnswer, $t as KonvaDrawingGrid, en as LabelPlacement, rn as NumberLineAnswer, mn as OFFICE_SHAPE_GROUPS, ln as OperationWorkArea, Kr as PrintableExamDocument, Yr as PrintableQuestionRenderer, Jr as PrintableSectionRenderer, jn as ProblemSheet, ji as ProblemSheetComposer, vn as ProblemSheetShapeNode, Bn as PronunciationRecorder, Wr as QuestionPreviewPanel, mr as QuestionRenderer, $e as ShapeGlyph, Xi as SingleChoice, Yn as SortableAnswer, Zn as TextAnswer, or as VisualSceneGraphic, be as calculateExamResult, ir as createVisualSceneFromVariant, Pn as evaluateVoiceAiResult, Ze as examShapeOptions, ge as formatOperationDecimal, ue as formatScoreValue, ft as getColorValue, dt as getDefaultColorId, Qe as getExamShapeLabel, gn as getProblemSheetShapeLabel, W as getQuestionMaxScore, G as getSectionMaxScore, K as getSectionMaxScoreLabel, ar as getVisualSceneColorValue, _n as isProblemSheetSquareShape, pt as mapChoicesToGeometryColors, q as normalizeOperationDecimal, ur as normalizeQuestionContentDirection, Fn as normalizeVoiceText, he as parseOperationDecimal, le as parseScoreValue, dr as resolveQuestionContentDirection, de as sectionHasQuestionScores, nr as visualSceneColorOptions, tr as visualSceneIconOptions, rr as visualSceneStateOptions, fe as withDerivedSectionScore };
|