alexsys-exam-renderer 0.1.2 → 0.1.4
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/exam-session/examPoints.d.ts +9 -0
- package/dist/exam-session/examPoints.d.ts.map +1 -0
- package/dist/exam-session/examScoring.d.ts +2 -0
- package/dist/exam-session/examScoring.d.ts.map +1 -1
- package/dist/exam-session/examSessionTypes.d.ts +1 -0
- package/dist/exam-session/examSessionTypes.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +527 -501
- package/dist/renderer/PrintableExamDocument.d.ts.map +1 -1
- package/dist/renderer/QuestionRenderer.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +56 -56
package/dist/index.js
CHANGED
|
@@ -2,13 +2,48 @@ import { Fragment as e, useEffect as t, useMemo as n, useRef as r, useState as i
|
|
|
2
2
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
import { DragDropProvider as c, useDraggable as l, useDroppable as u } from "@dnd-kit/react";
|
|
4
4
|
import { Apple as d, CheckCircle2 as f, Circle as p, Diamond as m, Eraser as h, Flower2 as g, Heart as _, Hexagon as v, Mic as y, PencilRuler as b, Pentagon as x, RectangleHorizontal as S, RotateCcw as ee, Square as C, Star as w, Sun as T, Triangle as E, VolumeX as D, XCircle as O } from "lucide-react";
|
|
5
|
-
import { Arc as k, Circle as A, Group as j, Layer as te, Line as M, Rect as N, Stage as ne, Text as
|
|
6
|
-
import { move as
|
|
7
|
-
import { useSortable as
|
|
5
|
+
import { Arc as k, Circle as A, Group as j, Layer as te, Line as M, Rect as N, Stage as ne, Text as re } from "react-konva";
|
|
6
|
+
import { move as P } from "@dnd-kit/helpers";
|
|
7
|
+
import { useSortable as F } from "@dnd-kit/react/sortable";
|
|
8
|
+
//#region src/exam-session/examPoints.ts
|
|
9
|
+
function ie(e) {
|
|
10
|
+
if (!e) return 0;
|
|
11
|
+
let t = Number.parseFloat(e.replace(",", "."));
|
|
12
|
+
return Number.isFinite(t) ? t : 0;
|
|
13
|
+
}
|
|
14
|
+
function I(e) {
|
|
15
|
+
let t = Math.round(e * 100) / 100;
|
|
16
|
+
return String(t);
|
|
17
|
+
}
|
|
18
|
+
function ae(e) {
|
|
19
|
+
return ie(e.maxScore);
|
|
20
|
+
}
|
|
21
|
+
function oe(e) {
|
|
22
|
+
return e.questions.some((e) => se(e.maxScore));
|
|
23
|
+
}
|
|
24
|
+
function L(e) {
|
|
25
|
+
return oe(e) ? ce(e.questions.reduce((e, t) => e + ae(t), 0)) : ie(e.points);
|
|
26
|
+
}
|
|
27
|
+
function R(e) {
|
|
28
|
+
return I(L(e));
|
|
29
|
+
}
|
|
30
|
+
function z(e) {
|
|
31
|
+
return {
|
|
32
|
+
...e,
|
|
33
|
+
points: R(e)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function se(e) {
|
|
37
|
+
return typeof e == "string" && e.trim().length > 0;
|
|
38
|
+
}
|
|
39
|
+
function ce(e) {
|
|
40
|
+
return Math.round(e * 100) / 100;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
8
43
|
//#region src/exam-session/examScoring.ts
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let n = e.sections.filter((e) => e.isScored !== !1).map((e) =>
|
|
44
|
+
var le = 1e3, ue = 600, B = 70;
|
|
45
|
+
function de(e, t) {
|
|
46
|
+
let n = e.sections.filter((e) => e.isScored !== !1).map((e) => fe(e, t)), r = U(n, (e) => e.correctCount), i = U(n, (e) => e.incorrectCount), a = U(n, (e) => e.unansweredCount), o = i + a, s = U(n, (e) => e.totalUnits), c = W(U(n, (e) => e.maxScore)), l = W(U(n, (e) => e.score));
|
|
12
47
|
return {
|
|
13
48
|
attentionWarningCount: 0,
|
|
14
49
|
correctCount: r,
|
|
@@ -16,7 +51,7 @@ function ie(e, t) {
|
|
|
16
51
|
incorrectCount: i,
|
|
17
52
|
maxScore: c,
|
|
18
53
|
notCorrectCount: o,
|
|
19
|
-
percentage: c > 0 ?
|
|
54
|
+
percentage: c > 0 ? W(l / c * 100) : 0,
|
|
20
55
|
score: l,
|
|
21
56
|
sections: n,
|
|
22
57
|
subject: e.subject,
|
|
@@ -25,113 +60,121 @@ function ie(e, t) {
|
|
|
25
60
|
unansweredCount: a
|
|
26
61
|
};
|
|
27
62
|
}
|
|
28
|
-
function
|
|
29
|
-
let n =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})),
|
|
63
|
+
function fe(e, t) {
|
|
64
|
+
let n = oe(e), r = L(e), i = e.questions.map((e) => ({
|
|
65
|
+
maxScore: n ? ae(e) : 0,
|
|
66
|
+
units: pe(e, t)
|
|
67
|
+
})), a = !n && U(i, (e) => e.units.length) > 0 ? r / U(i, (e) => e.units.length) : 0, o = i.flatMap((t) => {
|
|
68
|
+
let r = n ? t.units.length > 0 ? t.maxScore / t.units.length : 0 : a;
|
|
69
|
+
return t.units.map((t) => ({
|
|
70
|
+
...t,
|
|
71
|
+
maxScore: W(r),
|
|
72
|
+
score: t.status === "correct" ? W(r) : 0,
|
|
73
|
+
sectionId: e.id
|
|
74
|
+
}));
|
|
75
|
+
}), s = Ae(o, "correct"), c = Ae(o, "incorrect"), l = Ae(o, "unanswered"), u = c + l;
|
|
33
76
|
return {
|
|
34
77
|
badge: e.badge,
|
|
35
|
-
correctCount:
|
|
78
|
+
correctCount: s,
|
|
36
79
|
id: e.id,
|
|
37
|
-
incorrectCount:
|
|
80
|
+
incorrectCount: c,
|
|
38
81
|
maxScore: r,
|
|
39
|
-
notCorrectCount:
|
|
40
|
-
score:
|
|
82
|
+
notCorrectCount: u,
|
|
83
|
+
score: W(U(o, (e) => e.score)),
|
|
41
84
|
title: e.title,
|
|
42
85
|
tone: e.tone,
|
|
43
|
-
totalUnits:
|
|
44
|
-
unansweredCount:
|
|
45
|
-
units:
|
|
86
|
+
totalUnits: o.length,
|
|
87
|
+
unansweredCount: l,
|
|
88
|
+
units: o
|
|
46
89
|
};
|
|
47
90
|
}
|
|
48
|
-
function
|
|
91
|
+
function pe(e, t) {
|
|
49
92
|
switch (e.type) {
|
|
50
93
|
case "inline-inputs":
|
|
51
94
|
case "equation-inputs": return e.items.flatMap((n) => {
|
|
52
95
|
if (n.answers?.length) return n.answers.flatMap((r) => {
|
|
53
96
|
if (!r.correctAnswer) return [];
|
|
54
97
|
let i = `${e.id}:${n.id}:${r.id}`;
|
|
55
|
-
return [
|
|
98
|
+
return [V(i, e.id, r.before, r.correctAnswer, t[i])];
|
|
56
99
|
});
|
|
57
100
|
if (!n.correctAnswer) return [];
|
|
58
101
|
let r = `${e.id}:${n.id}`;
|
|
59
|
-
return [
|
|
102
|
+
return [V(r, e.id, n.before, n.correctAnswer, t[r])];
|
|
60
103
|
});
|
|
61
|
-
case "number-line": return [
|
|
62
|
-
case "visual-choice": return
|
|
63
|
-
case "length-estimation": return
|
|
64
|
-
case "shape-choice": return
|
|
65
|
-
case "drag-match": return
|
|
66
|
-
case "drawing-grid": return [
|
|
67
|
-
case "table-response": return
|
|
68
|
-
case "text-input": return e.correctAnswer ? [
|
|
104
|
+
case "number-line": return [V(e.id, e.id, e.expression, e.correctAnswer, t[e.id])];
|
|
105
|
+
case "visual-choice": return he(e.id, e.id, e.grading.pairs, t[e.id]);
|
|
106
|
+
case "length-estimation": return ge(e, t);
|
|
107
|
+
case "shape-choice": return he(e.id, e.id, e.grading.pairs, t[e.id]);
|
|
108
|
+
case "drag-match": return he(e.id, e.id, e.grading?.pairs, t[e.id]);
|
|
109
|
+
case "drawing-grid": return [xe(e, t[e.id])];
|
|
110
|
+
case "table-response": return ve(e, t[e.id]);
|
|
111
|
+
case "text-input": return e.correctAnswer ? [V(e.id, e.id, e.prompt, e.correctAnswer, t[e.id])] : [];
|
|
69
112
|
case "word-problem": return e.parts.flatMap((n) => {
|
|
70
113
|
let r = `${e.id}:${n.id}`;
|
|
71
|
-
return n.type === "coin-table" ?
|
|
114
|
+
return n.type === "coin-table" ? ye(e.id, n, t[r]) : n.correctAnswer ? [V(r, e.id, n.prompt, n.correctAnswer, t[r])] : [];
|
|
72
115
|
});
|
|
73
116
|
case "sortable-answer": return [];
|
|
74
|
-
case "label-placement": return
|
|
75
|
-
case "audio-recording": return [
|
|
117
|
+
case "label-placement": return be(e.id, e.grading?.targetsByLabelId, t[e.id]);
|
|
118
|
+
case "audio-recording": return [me(e, t[e.id])];
|
|
76
119
|
}
|
|
77
120
|
}
|
|
78
|
-
function
|
|
79
|
-
return t?.kind === "audio-recording" ?
|
|
121
|
+
function me(e, t) {
|
|
122
|
+
return t?.kind === "audio-recording" ? H(e.id, e.id, e.expectedAnswer, t.evaluation.isCorrect ? "correct" : "incorrect") : H(e.id, e.id, e.expectedAnswer, "unanswered");
|
|
80
123
|
}
|
|
81
|
-
function
|
|
82
|
-
return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ?
|
|
124
|
+
function V(e, t, n, r, i) {
|
|
125
|
+
return r ? i?.kind === "handwritten-number" ? i.strokes.length === 0 ? H(e, t, n, "unanswered") : H(e, t, n, i.recognizedValue && Oe(i.recognizedValue, r) ? "correct" : "incorrect") : i?.kind !== "text" || ke(i.value) === "" ? H(e, t, n, "unanswered") : H(e, t, n, Oe(i.value, r) ? "correct" : "incorrect") : H(e, t, n, "incorrect");
|
|
83
126
|
}
|
|
84
|
-
function
|
|
127
|
+
function he(e, t, n, r) {
|
|
85
128
|
return n ? Object.entries(n).map(([n, i]) => {
|
|
86
129
|
let a = r?.kind === "matches" ? r.pairs[n] : void 0, o = a ? a === i ? "correct" : "incorrect" : "unanswered";
|
|
87
|
-
return
|
|
130
|
+
return H(`${e}:${n}`, t, n, o);
|
|
88
131
|
}) : [];
|
|
89
132
|
}
|
|
90
|
-
function
|
|
133
|
+
function ge(e, t) {
|
|
91
134
|
let n = e.items.map((n) => {
|
|
92
135
|
let r = `${e.id}:squares:${n.id}`;
|
|
93
|
-
return
|
|
136
|
+
return V(r, e.id, n.label, n.squareLength.toString(), t[r]);
|
|
94
137
|
}), r = e.items.flatMap((n) => {
|
|
95
138
|
if (!n.correctColorId) return [];
|
|
96
139
|
let r = `${e.id}:color:${n.id}`;
|
|
97
|
-
return [
|
|
140
|
+
return [_e(r, e.id, n.label, n.correctColorId, t[r])];
|
|
98
141
|
});
|
|
99
142
|
return n.concat(r);
|
|
100
143
|
}
|
|
101
|
-
function
|
|
102
|
-
return i?.kind !== "choice" || !i.choiceId ?
|
|
144
|
+
function _e(e, t, n, r, i) {
|
|
145
|
+
return i?.kind !== "choice" || !i.choiceId ? H(e, t, n, "unanswered") : H(e, t, n, i.choiceId === r ? "correct" : "incorrect");
|
|
103
146
|
}
|
|
104
|
-
function
|
|
147
|
+
function ve(e, t) {
|
|
105
148
|
return e.columns.flatMap((n) => {
|
|
106
149
|
if (typeof n.correctCount != "number") return [];
|
|
107
150
|
let r = t?.kind === "coin-table" ? t.counts[n.id] : void 0, i = r === void 0 ? "unanswered" : r === n.correctCount ? "correct" : "incorrect";
|
|
108
|
-
return
|
|
151
|
+
return H(`${e.id}:${n.id}`, e.id, n.title, i);
|
|
109
152
|
});
|
|
110
153
|
}
|
|
111
|
-
function
|
|
154
|
+
function ye(e, t, n) {
|
|
112
155
|
return t.columns.flatMap((r) => {
|
|
113
156
|
if (typeof r.correctCount != "number") return [];
|
|
114
157
|
let i = n?.kind === "coin-table" ? n.counts[r.id] : void 0, a = i === void 0 ? "unanswered" : i === r.correctCount ? "correct" : "incorrect";
|
|
115
|
-
return
|
|
158
|
+
return H(`${e}:${t.id}:${r.id}`, e, r.title, a);
|
|
116
159
|
});
|
|
117
160
|
}
|
|
118
|
-
function
|
|
161
|
+
function be(e, t, n) {
|
|
119
162
|
return t ? Object.entries(t).map(([t, r]) => {
|
|
120
163
|
let i = n?.kind === "placements" ? n.placements[t]?.targetId : void 0, a = i ? i === r ? "correct" : "incorrect" : "unanswered";
|
|
121
|
-
return
|
|
164
|
+
return H(`${e}:${t}`, e, t, a);
|
|
122
165
|
}) : [];
|
|
123
166
|
}
|
|
124
|
-
function
|
|
167
|
+
function xe(e, t) {
|
|
125
168
|
let n = e.grading.expectedSegments, r = t?.kind === "drawing" && ((t.elements?.length ?? 0) > 0 || (t.strokes?.length ?? 0) > 0);
|
|
126
|
-
if (t?.kind !== "drawing" || !r) return
|
|
127
|
-
let i = n.every((n) =>
|
|
128
|
-
return
|
|
169
|
+
if (t?.kind !== "drawing" || !r) return H(e.id, e.id, e.prompt, "unanswered");
|
|
170
|
+
let i = n.every((n) => Se(t, e, n));
|
|
171
|
+
return H(e.id, e.id, e.prompt, i ? "correct" : "incorrect");
|
|
129
172
|
}
|
|
130
|
-
function
|
|
131
|
-
let r =
|
|
132
|
-
return !r || !i ? !1 :
|
|
173
|
+
function Se(e, t, n) {
|
|
174
|
+
let r = Ee(t, n.from), i = Ee(t, n.to);
|
|
175
|
+
return !r || !i ? !1 : Ce(e).some((e) => we(e, r, i));
|
|
133
176
|
}
|
|
134
|
-
function
|
|
177
|
+
function Ce(e) {
|
|
135
178
|
let t = e.elements.flatMap((e) => e.type === "line" ? [{
|
|
136
179
|
end: {
|
|
137
180
|
x: e.points[2],
|
|
@@ -165,31 +208,31 @@ function he(e) {
|
|
|
165
208
|
}]) ?? [];
|
|
166
209
|
return t.concat(n);
|
|
167
210
|
}
|
|
168
|
-
function
|
|
169
|
-
let r =
|
|
170
|
-
return !r && !i ? !1 :
|
|
211
|
+
function we(e, t, n) {
|
|
212
|
+
let r = je(e.start, t) <= B && je(e.end, n) <= B, i = je(e.start, n) <= B && je(e.end, t) <= B;
|
|
213
|
+
return !r && !i ? !1 : Te(e.points, t, n, B);
|
|
171
214
|
}
|
|
172
|
-
function
|
|
173
|
-
for (let i = 0; i < e.length - 1; i += 4) if (
|
|
215
|
+
function Te(e, t, n, r) {
|
|
216
|
+
for (let i = 0; i < e.length - 1; i += 4) if (Me({
|
|
174
217
|
x: e[i],
|
|
175
218
|
y: e[i + 1]
|
|
176
219
|
}, t, n) > r) return !1;
|
|
177
220
|
return !0;
|
|
178
221
|
}
|
|
179
|
-
function
|
|
222
|
+
function Ee(e, t) {
|
|
180
223
|
if ("pointId" in t) {
|
|
181
224
|
let n = e.points.find((e) => e.id === t.pointId);
|
|
182
|
-
return n ?
|
|
225
|
+
return n ? De(n.x, n.y) : null;
|
|
183
226
|
}
|
|
184
|
-
return
|
|
227
|
+
return De(t.percentX, t.percentY);
|
|
185
228
|
}
|
|
186
|
-
function
|
|
229
|
+
function De(e, t) {
|
|
187
230
|
return {
|
|
188
|
-
x: e / 100 *
|
|
189
|
-
y: t / 100 *
|
|
231
|
+
x: e / 100 * le,
|
|
232
|
+
y: t / 100 * ue
|
|
190
233
|
};
|
|
191
234
|
}
|
|
192
|
-
function
|
|
235
|
+
function H(e, t, n, r) {
|
|
193
236
|
return {
|
|
194
237
|
id: e,
|
|
195
238
|
label: n,
|
|
@@ -197,41 +240,41 @@ function V(e, t, n, r) {
|
|
|
197
240
|
status: r
|
|
198
241
|
};
|
|
199
242
|
}
|
|
200
|
-
function
|
|
201
|
-
let n =
|
|
243
|
+
function Oe(e, t) {
|
|
244
|
+
let n = ke(e), r = ke(t), i = Number(n), a = Number(r);
|
|
202
245
|
return Number.isFinite(i) && Number.isFinite(a) ? i === a : n === r;
|
|
203
246
|
}
|
|
204
|
-
function
|
|
247
|
+
function ke(e) {
|
|
205
248
|
return e.trim().replace(/[٠-٩]/g, (e) => `${e.charCodeAt(0) - 1632}`).replace(/[۰-۹]/g, (e) => `${e.charCodeAt(0) - 1776}`);
|
|
206
249
|
}
|
|
207
|
-
function
|
|
250
|
+
function Ae(e, t) {
|
|
208
251
|
return e.filter((e) => e.status === t).length;
|
|
209
252
|
}
|
|
210
|
-
function
|
|
253
|
+
function U(e, t) {
|
|
211
254
|
return e.reduce((e, n) => e + t(n), 0);
|
|
212
255
|
}
|
|
213
|
-
function
|
|
256
|
+
function W(e) {
|
|
214
257
|
return Math.round(e * 100) / 100;
|
|
215
258
|
}
|
|
216
|
-
function
|
|
259
|
+
function je(e, t) {
|
|
217
260
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
218
261
|
}
|
|
219
|
-
function
|
|
262
|
+
function Me(e, t, n) {
|
|
220
263
|
let r = n.x - t.x, i = n.y - t.y, a = r * r + i * i;
|
|
221
|
-
if (a === 0) return
|
|
264
|
+
if (a === 0) return je(e, t);
|
|
222
265
|
let o = Math.max(0, Math.min(1, ((e.x - t.x) * r + (e.y - t.y) * i) / a));
|
|
223
|
-
return
|
|
266
|
+
return je(e, {
|
|
224
267
|
x: t.x + o * r,
|
|
225
268
|
y: t.y + o * i
|
|
226
269
|
});
|
|
227
270
|
}
|
|
228
271
|
//#endregion
|
|
229
272
|
//#region src/exam-session/interactions/CoinTableResponse.tsx
|
|
230
|
-
var
|
|
231
|
-
function
|
|
273
|
+
var Ne = 0, Pe = 12;
|
|
274
|
+
function Fe({ columns: e, value: t, onChange: n }) {
|
|
232
275
|
let r = t?.counts ?? {};
|
|
233
276
|
function i(e, t) {
|
|
234
|
-
let i = e.maxCoins ??
|
|
277
|
+
let i = e.maxCoins ?? Pe, a = Math.max(Ne, Math.min(i, t));
|
|
235
278
|
n({
|
|
236
279
|
kind: "coin-table",
|
|
237
280
|
counts: {
|
|
@@ -243,7 +286,7 @@ function De({ columns: e, value: t, onChange: n }) {
|
|
|
243
286
|
return /* @__PURE__ */ o("div", {
|
|
244
287
|
className: "response-table",
|
|
245
288
|
children: e.map((e) => {
|
|
246
|
-
let t = r[e.id] ?? 0, n = e.maxCoins ??
|
|
289
|
+
let t = r[e.id] ?? 0, n = e.maxCoins ?? Pe;
|
|
247
290
|
return /* @__PURE__ */ s("div", {
|
|
248
291
|
className: "response-column",
|
|
249
292
|
children: [
|
|
@@ -268,7 +311,7 @@ function De({ columns: e, value: t, onChange: n }) {
|
|
|
268
311
|
children: "إِضافَةٌ"
|
|
269
312
|
}), /* @__PURE__ */ o("button", {
|
|
270
313
|
className: "coin-action coin-action--secondary",
|
|
271
|
-
disabled: t <=
|
|
314
|
+
disabled: t <= Ne,
|
|
272
315
|
onClick: () => i(e, t - 1),
|
|
273
316
|
type: "button",
|
|
274
317
|
children: "حَذْفٌ"
|
|
@@ -295,7 +338,7 @@ function De({ columns: e, value: t, onChange: n }) {
|
|
|
295
338
|
}
|
|
296
339
|
//#endregion
|
|
297
340
|
//#region src/renderer/shapeCatalog.tsx
|
|
298
|
-
var
|
|
341
|
+
var Ie = {
|
|
299
342
|
circle: p,
|
|
300
343
|
diamond: m,
|
|
301
344
|
heart: _,
|
|
@@ -305,7 +348,7 @@ var Oe = {
|
|
|
305
348
|
square: C,
|
|
306
349
|
star: w,
|
|
307
350
|
triangle: E
|
|
308
|
-
},
|
|
351
|
+
}, Le = {
|
|
309
352
|
circle: "Cercle",
|
|
310
353
|
diamond: "Losange",
|
|
311
354
|
heart: "Coeur",
|
|
@@ -315,15 +358,15 @@ var Oe = {
|
|
|
315
358
|
square: "Carre",
|
|
316
359
|
star: "Etoile",
|
|
317
360
|
triangle: "Triangle"
|
|
318
|
-
},
|
|
319
|
-
label:
|
|
361
|
+
}, Re = Object.keys(Le).map((e) => ({
|
|
362
|
+
label: Le[e],
|
|
320
363
|
value: e
|
|
321
364
|
}));
|
|
322
|
-
function
|
|
323
|
-
return
|
|
365
|
+
function ze(e) {
|
|
366
|
+
return Le[e];
|
|
324
367
|
}
|
|
325
|
-
function
|
|
326
|
-
let n =
|
|
368
|
+
function Be({ shapeId: e, title: t }) {
|
|
369
|
+
let n = Ie[e];
|
|
327
370
|
return /* @__PURE__ */ o("span", {
|
|
328
371
|
"aria-label": t,
|
|
329
372
|
role: t ? "img" : void 0,
|
|
@@ -333,7 +376,7 @@ function Me({ shapeId: e, title: t }) {
|
|
|
333
376
|
}
|
|
334
377
|
//#endregion
|
|
335
378
|
//#region src/exam-session/interactions/DragMatch.tsx
|
|
336
|
-
function
|
|
379
|
+
function Ve({ items: e, targets: t, value: n, onChange: r }) {
|
|
337
380
|
let i = n?.pairs ?? {}, a = new Set(Object.values(i));
|
|
338
381
|
return /* @__PURE__ */ o(c, {
|
|
339
382
|
onDragEnd: (e) => {
|
|
@@ -351,10 +394,10 @@ function Ne({ items: e, targets: t, value: n, onChange: r }) {
|
|
|
351
394
|
className: "drag-match",
|
|
352
395
|
children: [/* @__PURE__ */ o("div", {
|
|
353
396
|
className: "drag-match__items",
|
|
354
|
-
children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(
|
|
397
|
+
children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(He, { item: e }, e.id))
|
|
355
398
|
}), /* @__PURE__ */ o("div", {
|
|
356
399
|
className: "drag-match__targets",
|
|
357
|
-
children: t.map((t) => /* @__PURE__ */ o(
|
|
400
|
+
children: t.map((t) => /* @__PURE__ */ o(Ue, {
|
|
358
401
|
assignedItem: e.find((e) => e.id === i[t.id]),
|
|
359
402
|
target: t
|
|
360
403
|
}, t.id))
|
|
@@ -362,7 +405,7 @@ function Ne({ items: e, targets: t, value: n, onChange: r }) {
|
|
|
362
405
|
})
|
|
363
406
|
});
|
|
364
407
|
}
|
|
365
|
-
function
|
|
408
|
+
function He({ item: e }) {
|
|
366
409
|
let { ref: t, isDragging: n } = l({ id: e.id });
|
|
367
410
|
return /* @__PURE__ */ o("button", {
|
|
368
411
|
className: n ? "drag-pill drag-pill--dragging" : "drag-pill",
|
|
@@ -371,23 +414,23 @@ function Pe({ item: e }) {
|
|
|
371
414
|
children: e.label
|
|
372
415
|
});
|
|
373
416
|
}
|
|
374
|
-
function
|
|
417
|
+
function Ue({ assignedItem: e, target: t }) {
|
|
375
418
|
let { ref: n, isDropTarget: r } = u({ id: t.id });
|
|
376
419
|
return /* @__PURE__ */ s("div", {
|
|
377
420
|
className: r ? "drop-slot drop-slot--active" : "drop-slot",
|
|
378
421
|
ref: n,
|
|
379
422
|
children: [/* @__PURE__ */ o("span", {
|
|
380
423
|
className: t.shapeId ? "drop-slot__visual drop-slot__visual--shape" : "drop-slot__visual",
|
|
381
|
-
children: t.shapeId ? /* @__PURE__ */ o(
|
|
424
|
+
children: t.shapeId ? /* @__PURE__ */ o(Be, {
|
|
382
425
|
shapeId: t.shapeId,
|
|
383
426
|
title: t.label
|
|
384
427
|
}) : t.label
|
|
385
|
-
}), e ? /* @__PURE__ */ o(
|
|
428
|
+
}), e ? /* @__PURE__ */ o(He, { item: e }) : /* @__PURE__ */ o("span", { children: "ضع الإجابة هنا" })]
|
|
386
429
|
});
|
|
387
430
|
}
|
|
388
431
|
//#endregion
|
|
389
432
|
//#region src/exam-session/interactions/HandwrittenNumberAnswer.tsx
|
|
390
|
-
var
|
|
433
|
+
var We = 132, Ge = 88, Ke = 650;
|
|
391
434
|
function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
|
|
392
435
|
let u = l?.strokes ?? [], d = u.length === 0, f = r(n), [p, m] = i(!1), [g, _] = i(!1), v = !!c?.isAvailable(), y = c?.getStatus?.() ?? (v ? "ready" : "unavailable"), b = y === "preparing" || y === "error", x = y === "preparing" ? "preparing-model" : y === "error" ? "model-error" : d || p ? "idle" : l?.recognizedValue === void 0 ? !v || y === "unavailable" ? "unavailable" : g ? "unrecognized" : "recognizing" : "recognized";
|
|
393
436
|
t(() => {
|
|
@@ -406,7 +449,7 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
|
|
|
406
449
|
}).catch(() => {
|
|
407
450
|
e || _(!0);
|
|
408
451
|
});
|
|
409
|
-
},
|
|
452
|
+
}, Ke);
|
|
410
453
|
return () => {
|
|
411
454
|
e = !0, window.clearTimeout(t);
|
|
412
455
|
};
|
|
@@ -420,8 +463,8 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
|
|
|
420
463
|
]);
|
|
421
464
|
function S(e) {
|
|
422
465
|
_(!1), n({
|
|
423
|
-
canvasHeight:
|
|
424
|
-
canvasWidth:
|
|
466
|
+
canvasHeight: Ge,
|
|
467
|
+
canvasWidth: We,
|
|
425
468
|
kind: "handwritten-number",
|
|
426
469
|
strokes: e
|
|
427
470
|
});
|
|
@@ -462,23 +505,23 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
|
|
|
462
505
|
children: [
|
|
463
506
|
/* @__PURE__ */ s(ne, {
|
|
464
507
|
className: "handwritten-number-stage",
|
|
465
|
-
height:
|
|
508
|
+
height: Ge,
|
|
466
509
|
onPointerCancel: w,
|
|
467
510
|
onPointerDown: ee,
|
|
468
511
|
onPointerMove: C,
|
|
469
512
|
onPointerUp: w,
|
|
470
513
|
role: "img",
|
|
471
|
-
width:
|
|
514
|
+
width: We,
|
|
472
515
|
children: [/* @__PURE__ */ s(te, {
|
|
473
516
|
listening: !1,
|
|
474
517
|
children: [
|
|
475
518
|
/* @__PURE__ */ o(N, {
|
|
476
519
|
cornerRadius: 14,
|
|
477
520
|
fill: "#fff",
|
|
478
|
-
height:
|
|
521
|
+
height: Ge,
|
|
479
522
|
stroke: "#cfe3d9",
|
|
480
523
|
strokeWidth: 2,
|
|
481
|
-
width:
|
|
524
|
+
width: We,
|
|
482
525
|
x: 0,
|
|
483
526
|
y: 0
|
|
484
527
|
}),
|
|
@@ -486,23 +529,23 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
|
|
|
486
529
|
dash: [6, 8],
|
|
487
530
|
points: [
|
|
488
531
|
16,
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
532
|
+
Ge - 18,
|
|
533
|
+
We - 16,
|
|
534
|
+
Ge - 18
|
|
492
535
|
],
|
|
493
536
|
stroke: "#dbe9e2",
|
|
494
537
|
strokeWidth: 2
|
|
495
538
|
}),
|
|
496
|
-
d ? /* @__PURE__ */ o(
|
|
539
|
+
d ? /* @__PURE__ */ o(re, {
|
|
497
540
|
align: "center",
|
|
498
541
|
fill: "#9aaca3",
|
|
499
542
|
fontFamily: "Arial, sans-serif",
|
|
500
543
|
fontSize: 15,
|
|
501
544
|
fontStyle: "bold",
|
|
502
|
-
height:
|
|
545
|
+
height: Ge,
|
|
503
546
|
text: "ارسم هنا",
|
|
504
547
|
verticalAlign: "middle",
|
|
505
|
-
width:
|
|
548
|
+
width: We,
|
|
506
549
|
x: 0,
|
|
507
550
|
y: 0
|
|
508
551
|
}) : null
|
|
@@ -529,12 +572,12 @@ function G({ ariaLabel: e, onChange: n, onClear: a, recognizer: c, value: l }) {
|
|
|
529
572
|
"aria-live": "polite",
|
|
530
573
|
className: "handwritten-number-status",
|
|
531
574
|
"data-state": x,
|
|
532
|
-
children:
|
|
575
|
+
children: qe(x, l?.recognizedValue)
|
|
533
576
|
}) : null
|
|
534
577
|
]
|
|
535
578
|
});
|
|
536
579
|
}
|
|
537
|
-
function
|
|
580
|
+
function qe(e, t) {
|
|
538
581
|
switch (e) {
|
|
539
582
|
case "recognizing": return "جارٍ التعرّف على الرقم…";
|
|
540
583
|
case "recognized": return `تمّ التعرّف: ${t ?? ""}`;
|
|
@@ -547,7 +590,7 @@ function Re(e, t) {
|
|
|
547
590
|
}
|
|
548
591
|
//#endregion
|
|
549
592
|
//#region src/exam-session/interactions/ColorPenPicker.tsx
|
|
550
|
-
function
|
|
593
|
+
function Je({ ariaLabel: e, className: t = "", colors: n, disabled: r = !1, onChange: i, selectedColorId: a }) {
|
|
551
594
|
return /* @__PURE__ */ o("div", {
|
|
552
595
|
"aria-label": e,
|
|
553
596
|
className: ["color-pen-picker", t].filter(Boolean).join(" "),
|
|
@@ -592,28 +635,28 @@ var K = [
|
|
|
592
635
|
label: "أَسْوَدُ",
|
|
593
636
|
value: "#17212b"
|
|
594
637
|
}
|
|
595
|
-
],
|
|
638
|
+
], Ye = {
|
|
596
639
|
black: "#17212b",
|
|
597
640
|
blue: "#256fd2",
|
|
598
641
|
green: "#0b7f45",
|
|
599
642
|
red: "#e34a58"
|
|
600
643
|
};
|
|
601
|
-
function
|
|
644
|
+
function Xe(e, t) {
|
|
602
645
|
return t ? e.find((e) => e.id === t || e.value === t)?.id ?? e[0]?.id ?? "green" : e[0]?.id ?? "green";
|
|
603
646
|
}
|
|
604
|
-
function
|
|
647
|
+
function Ze(e, t) {
|
|
605
648
|
return e.find((e) => e.id === t)?.value ?? e[0]?.value ?? K[0].value;
|
|
606
649
|
}
|
|
607
|
-
function
|
|
650
|
+
function Qe(e) {
|
|
608
651
|
return e.map((e) => ({
|
|
609
652
|
id: e.id,
|
|
610
653
|
label: e.label,
|
|
611
|
-
value:
|
|
654
|
+
value: Ye[e.id] ?? K[0].value
|
|
612
655
|
}));
|
|
613
656
|
}
|
|
614
657
|
//#endregion
|
|
615
658
|
//#region src/exam-session/interactions/GeometryCanvas.tsx
|
|
616
|
-
var
|
|
659
|
+
var $e = 1e3, et = 600, q = 30, tt = 240, nt = 12, rt = K[0].value, J = "#0a8f55", it = [
|
|
617
660
|
{
|
|
618
661
|
id: "pen",
|
|
619
662
|
icon: "✎",
|
|
@@ -644,39 +687,39 @@ var We = 1e3, Ge = 600, q = 30, Ke = 240, qe = 12, Je = K[0].value, J = "#0a8f55
|
|
|
644
687
|
icon: "⌖",
|
|
645
688
|
label: "بَرْكارٌ"
|
|
646
689
|
}
|
|
647
|
-
],
|
|
690
|
+
], at = /* @__PURE__ */ new Set([
|
|
648
691
|
"ruler",
|
|
649
692
|
"protractor",
|
|
650
693
|
"compass"
|
|
651
694
|
]);
|
|
652
|
-
function
|
|
653
|
-
let _ = c.length > 0 ? c : K, [v, y] = i(null), [b, x] = i([]), [S, ee] = i(() =>
|
|
695
|
+
function ot({ actionLabel: e, canvasHeight: t = et, canvasWidth: n = $e, className: a = "", colorOptions: c = K, defaultColor: l, disabled: u = !1, minStageWidth: d = tt, onChange: f, points: p = [], showColorPalette: m = !0, value: h, variant: g = "question" }) {
|
|
696
|
+
let _ = c.length > 0 ? c : K, [v, y] = i(null), [b, x] = i([]), [S, ee] = i(() => Xe(_, l ?? "black")), [C, w] = i(() => gt(h)), [T, E] = i(() => h?.guides ?? ht(n, t)), [D, O] = i(null), [k, A] = i({
|
|
654
697
|
height: t,
|
|
655
698
|
scale: 1,
|
|
656
699
|
width: n
|
|
657
700
|
}), [j, M] = i({
|
|
658
701
|
canRedo: !1,
|
|
659
702
|
canUndo: !1
|
|
660
|
-
}),
|
|
661
|
-
|
|
662
|
-
let
|
|
703
|
+
}), re = r(null), P = r([Y(C)]), F = r(0), ie = r(0), I = r(null);
|
|
704
|
+
st(re, n, t, d, A);
|
|
705
|
+
let ae = vt(p, n, t), oe = [
|
|
663
706
|
"geometry-canvas",
|
|
664
707
|
`geometry-canvas--${g}`,
|
|
665
708
|
a
|
|
666
|
-
].filter(Boolean).join(" "),
|
|
667
|
-
function B(e) {
|
|
668
|
-
return Xe.has(e) ? !z && b.includes(e) : v === e || b.includes(e);
|
|
669
|
-
}
|
|
709
|
+
].filter(Boolean).join(" "), L = _.some((e) => e.id === S) ? S : Xe(_, "black"), R = Ze(_, L), z = xt(v);
|
|
670
710
|
function se(e) {
|
|
671
|
-
|
|
711
|
+
return at.has(e) ? !z && b.includes(e) : v === e || b.includes(e);
|
|
672
712
|
}
|
|
673
713
|
function ce(e) {
|
|
714
|
+
x((t) => t.includes(e) ? t.filter((t) => t !== e) : t.concat(e));
|
|
715
|
+
}
|
|
716
|
+
function le(e) {
|
|
674
717
|
if (e === "ruler" || e === "protractor") {
|
|
675
718
|
if (z) {
|
|
676
719
|
y(null), x((t) => t.includes(e) ? t : t.concat(e));
|
|
677
720
|
return;
|
|
678
721
|
}
|
|
679
|
-
|
|
722
|
+
ce(e);
|
|
680
723
|
return;
|
|
681
724
|
}
|
|
682
725
|
if (e === "compass") {
|
|
@@ -689,65 +732,65 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
689
732
|
}
|
|
690
733
|
y(e);
|
|
691
734
|
}
|
|
692
|
-
function
|
|
693
|
-
return
|
|
735
|
+
function ue(e) {
|
|
736
|
+
return ie.current += 1, `${e}-${Date.now()}-${ie.current}`;
|
|
694
737
|
}
|
|
695
|
-
function
|
|
738
|
+
function B(e, t = T) {
|
|
696
739
|
f({
|
|
697
740
|
elements: Y(e),
|
|
698
741
|
guides: t,
|
|
699
742
|
kind: "drawing",
|
|
700
|
-
strokes:
|
|
743
|
+
strokes: _t(e)
|
|
701
744
|
});
|
|
702
745
|
}
|
|
703
746
|
function de() {
|
|
704
747
|
M({
|
|
705
|
-
canRedo:
|
|
706
|
-
canUndo:
|
|
748
|
+
canRedo: F.current < P.current.length - 1,
|
|
749
|
+
canUndo: F.current > 0
|
|
707
750
|
});
|
|
708
751
|
}
|
|
709
752
|
function fe(e, t = T) {
|
|
710
|
-
let n = Y(e), r =
|
|
711
|
-
r.push(n),
|
|
753
|
+
let n = Y(e), r = P.current.slice(0, F.current + 1);
|
|
754
|
+
r.push(n), P.current = r, F.current = r.length - 1, w(n), B(n, t), de();
|
|
712
755
|
}
|
|
713
756
|
function pe(e) {
|
|
714
|
-
E(e),
|
|
757
|
+
E(e), B(C, e);
|
|
715
758
|
}
|
|
716
759
|
function me() {
|
|
717
760
|
if (!j.canUndo || u) return;
|
|
718
|
-
--
|
|
719
|
-
let e = Y(
|
|
720
|
-
w(e),
|
|
761
|
+
--F.current;
|
|
762
|
+
let e = Y(P.current[F.current]);
|
|
763
|
+
w(e), B(e), de();
|
|
721
764
|
}
|
|
722
|
-
function
|
|
765
|
+
function V() {
|
|
723
766
|
if (!j.canRedo || u) return;
|
|
724
|
-
|
|
725
|
-
let e = Y(
|
|
726
|
-
w(e),
|
|
767
|
+
F.current += 1;
|
|
768
|
+
let e = Y(P.current[F.current]);
|
|
769
|
+
w(e), B(e), de();
|
|
727
770
|
}
|
|
728
|
-
function
|
|
771
|
+
function he() {
|
|
729
772
|
u || C.length === 0 || fe([]);
|
|
730
773
|
}
|
|
731
|
-
function
|
|
774
|
+
function ge(e) {
|
|
732
775
|
let r = e.target.getStage()?.getPointerPosition();
|
|
733
776
|
return r ? {
|
|
734
|
-
x:
|
|
735
|
-
y:
|
|
777
|
+
x: jt(r.x / k.scale, 0, n),
|
|
778
|
+
y: jt(r.y / k.scale, 0, t)
|
|
736
779
|
} : null;
|
|
737
780
|
}
|
|
738
|
-
function
|
|
739
|
-
if (u || !z &&
|
|
740
|
-
let t =
|
|
781
|
+
function _e(e) {
|
|
782
|
+
if (u || !z && bt(e.target)) return;
|
|
783
|
+
let t = ge(e);
|
|
741
784
|
if (!t || !v) return;
|
|
742
785
|
if (v === "eraser") {
|
|
743
786
|
be(t);
|
|
744
787
|
return;
|
|
745
788
|
}
|
|
746
|
-
let n =
|
|
789
|
+
let n = yt(t, ae);
|
|
747
790
|
if (v === "pen") {
|
|
748
|
-
|
|
749
|
-
color:
|
|
750
|
-
id:
|
|
791
|
+
I.current = n, O({
|
|
792
|
+
color: R,
|
|
793
|
+
id: ue("freehand"),
|
|
751
794
|
points: [n.x, n.y],
|
|
752
795
|
strokeWidth: 4,
|
|
753
796
|
type: "freehand"
|
|
@@ -755,9 +798,9 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
755
798
|
return;
|
|
756
799
|
}
|
|
757
800
|
if (v === "line") {
|
|
758
|
-
|
|
759
|
-
color:
|
|
760
|
-
id:
|
|
801
|
+
I.current = n, O({
|
|
802
|
+
color: R,
|
|
803
|
+
id: ue("line"),
|
|
761
804
|
points: [
|
|
762
805
|
n.x,
|
|
763
806
|
n.y,
|
|
@@ -769,23 +812,23 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
769
812
|
});
|
|
770
813
|
return;
|
|
771
814
|
}
|
|
772
|
-
v === "compass" && (
|
|
815
|
+
v === "compass" && (I.current = n, O({
|
|
773
816
|
center: n,
|
|
774
|
-
color:
|
|
775
|
-
id:
|
|
817
|
+
color: R,
|
|
818
|
+
id: ue("circle"),
|
|
776
819
|
radius: 1,
|
|
777
820
|
strokeWidth: 3,
|
|
778
821
|
type: "circle"
|
|
779
822
|
}));
|
|
780
823
|
}
|
|
781
|
-
function
|
|
782
|
-
let t =
|
|
824
|
+
function ve(e) {
|
|
825
|
+
let t = ge(e);
|
|
783
826
|
if (t) {
|
|
784
827
|
if (v === "eraser" && !u) {
|
|
785
828
|
be(t);
|
|
786
829
|
return;
|
|
787
830
|
}
|
|
788
|
-
if (!(!D || !
|
|
831
|
+
if (!(!D || !I.current || u)) {
|
|
789
832
|
if (D.type === "freehand") {
|
|
790
833
|
O({
|
|
791
834
|
...D,
|
|
@@ -794,12 +837,12 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
794
837
|
return;
|
|
795
838
|
}
|
|
796
839
|
if (D.type === "line") {
|
|
797
|
-
let e =
|
|
840
|
+
let e = yt(t, ae);
|
|
798
841
|
O({
|
|
799
842
|
...D,
|
|
800
843
|
points: [
|
|
801
|
-
|
|
802
|
-
|
|
844
|
+
I.current.x,
|
|
845
|
+
I.current.y,
|
|
803
846
|
e.x,
|
|
804
847
|
e.y
|
|
805
848
|
]
|
|
@@ -813,13 +856,13 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
813
856
|
}
|
|
814
857
|
}
|
|
815
858
|
}
|
|
816
|
-
function
|
|
859
|
+
function ye() {
|
|
817
860
|
if (!D || u) {
|
|
818
|
-
|
|
861
|
+
I.current = null, O(null);
|
|
819
862
|
return;
|
|
820
863
|
}
|
|
821
864
|
let e = D;
|
|
822
|
-
if (
|
|
865
|
+
if (I.current = null, O(null), Ct(e)) {
|
|
823
866
|
if (e.type === "circle") {
|
|
824
867
|
let t = {
|
|
825
868
|
...T,
|
|
@@ -836,26 +879,26 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
836
879
|
}
|
|
837
880
|
function be(e) {
|
|
838
881
|
if (C.length === 0) return;
|
|
839
|
-
let t =
|
|
882
|
+
let t = wt(C, e);
|
|
840
883
|
t < 0 || fe(C.filter((e, n) => n !== t));
|
|
841
884
|
}
|
|
842
885
|
return /* @__PURE__ */ s("div", {
|
|
843
|
-
className:
|
|
886
|
+
className: oe,
|
|
844
887
|
"data-disabled": u ? "true" : "false",
|
|
845
888
|
dir: "rtl",
|
|
846
889
|
children: [
|
|
847
890
|
/* @__PURE__ */ o("div", {
|
|
848
891
|
className: "geometry-toolbar",
|
|
849
892
|
"aria-label": "أَدَواتُ الوَرَقَةِ المُسَوَّدَةِ",
|
|
850
|
-
children:
|
|
851
|
-
"aria-pressed":
|
|
893
|
+
children: it.map((e) => /* @__PURE__ */ s("button", {
|
|
894
|
+
"aria-pressed": se(e.id),
|
|
852
895
|
className: [
|
|
853
896
|
"geometry-tool-button",
|
|
854
|
-
|
|
855
|
-
|
|
897
|
+
se(e.id) ? "geometry-tool-button--active" : "",
|
|
898
|
+
at.has(e.id) ? "geometry-tool-button--guide" : ""
|
|
856
899
|
].filter(Boolean).join(" "),
|
|
857
900
|
disabled: u,
|
|
858
|
-
onClick: () =>
|
|
901
|
+
onClick: () => le(e.id),
|
|
859
902
|
type: "button",
|
|
860
903
|
children: [/* @__PURE__ */ o("span", {
|
|
861
904
|
"aria-hidden": "true",
|
|
@@ -863,26 +906,26 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
863
906
|
}), /* @__PURE__ */ o("span", { children: e.label })]
|
|
864
907
|
}, e.id))
|
|
865
908
|
}),
|
|
866
|
-
m ? /* @__PURE__ */ o(
|
|
909
|
+
m ? /* @__PURE__ */ o(Je, {
|
|
867
910
|
ariaLabel: "أَلْوانُ الأَقْلامِ",
|
|
868
911
|
className: "geometry-color-picker",
|
|
869
912
|
colors: _,
|
|
870
913
|
disabled: u,
|
|
871
914
|
onChange: ee,
|
|
872
|
-
selectedColorId:
|
|
915
|
+
selectedColorId: L
|
|
873
916
|
}) : null,
|
|
874
917
|
/* @__PURE__ */ o("div", {
|
|
875
918
|
className: "geometry-stage-shell",
|
|
876
|
-
ref:
|
|
919
|
+
ref: re,
|
|
877
920
|
children: /* @__PURE__ */ o(ne, {
|
|
878
921
|
height: k.height,
|
|
879
|
-
onMouseDown:
|
|
880
|
-
onMouseLeave:
|
|
881
|
-
onMouseMove:
|
|
882
|
-
onMouseUp:
|
|
883
|
-
onTouchEnd:
|
|
884
|
-
onTouchMove:
|
|
885
|
-
onTouchStart:
|
|
922
|
+
onMouseDown: _e,
|
|
923
|
+
onMouseLeave: ye,
|
|
924
|
+
onMouseMove: ve,
|
|
925
|
+
onMouseUp: ye,
|
|
926
|
+
onTouchEnd: ye,
|
|
927
|
+
onTouchMove: ve,
|
|
928
|
+
onTouchStart: _e,
|
|
886
929
|
width: k.width,
|
|
887
930
|
children: /* @__PURE__ */ s(te, {
|
|
888
931
|
scaleX: k.scale,
|
|
@@ -895,18 +938,18 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
895
938
|
strokeWidth: 1,
|
|
896
939
|
width: n
|
|
897
940
|
}),
|
|
898
|
-
/* @__PURE__ */ o(
|
|
941
|
+
/* @__PURE__ */ o(ct, {
|
|
899
942
|
canvasHeight: t,
|
|
900
943
|
canvasWidth: n
|
|
901
944
|
}),
|
|
902
|
-
p.map((e, r) => e.hidden ? null : /* @__PURE__ */ o(
|
|
903
|
-
label:
|
|
945
|
+
p.map((e, r) => e.hidden ? null : /* @__PURE__ */ o(lt, {
|
|
946
|
+
label: ut(e, r),
|
|
904
947
|
x: e.x / 100 * n,
|
|
905
948
|
y: e.y / 100 * t
|
|
906
949
|
}, e.id)),
|
|
907
|
-
C.map((e) =>
|
|
908
|
-
D ?
|
|
909
|
-
b.includes("ruler") ? /* @__PURE__ */ o(
|
|
950
|
+
C.map((e) => mt(e)),
|
|
951
|
+
D ? mt(D, !0) : null,
|
|
952
|
+
b.includes("ruler") ? /* @__PURE__ */ o(dt, {
|
|
910
953
|
disabled: u,
|
|
911
954
|
guide: T.ruler,
|
|
912
955
|
locked: z,
|
|
@@ -915,7 +958,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
915
958
|
ruler: e
|
|
916
959
|
})
|
|
917
960
|
}, `${T.ruler.x}:${T.ruler.y}:${T.ruler.length}:${T.ruler.rotation}`) : null,
|
|
918
|
-
b.includes("protractor") ? /* @__PURE__ */ o(
|
|
961
|
+
b.includes("protractor") ? /* @__PURE__ */ o(ft, {
|
|
919
962
|
disabled: u,
|
|
920
963
|
guide: T.protractor,
|
|
921
964
|
locked: z,
|
|
@@ -924,7 +967,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
924
967
|
protractor: e
|
|
925
968
|
})
|
|
926
969
|
}) : null,
|
|
927
|
-
b.includes("compass") ? /* @__PURE__ */ o(
|
|
970
|
+
b.includes("compass") ? /* @__PURE__ */ o(pt, {
|
|
928
971
|
disabled: u,
|
|
929
972
|
guide: T.compass,
|
|
930
973
|
locked: z,
|
|
@@ -949,13 +992,13 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
949
992
|
}),
|
|
950
993
|
/* @__PURE__ */ o("button", {
|
|
951
994
|
disabled: !j.canRedo || u,
|
|
952
|
-
onClick:
|
|
995
|
+
onClick: V,
|
|
953
996
|
type: "button",
|
|
954
997
|
children: "إِعادَةٌ"
|
|
955
998
|
}),
|
|
956
999
|
/* @__PURE__ */ o("button", {
|
|
957
1000
|
disabled: C.length === 0 || u,
|
|
958
|
-
onClick:
|
|
1001
|
+
onClick: he,
|
|
959
1002
|
type: "button",
|
|
960
1003
|
children: "مَسْحٌ"
|
|
961
1004
|
})
|
|
@@ -964,7 +1007,7 @@ function Ze({ actionLabel: e, canvasHeight: t = Ge, canvasWidth: n = We, classNa
|
|
|
964
1007
|
]
|
|
965
1008
|
});
|
|
966
1009
|
}
|
|
967
|
-
function
|
|
1010
|
+
function st(e, n, r, i, a) {
|
|
968
1011
|
t(() => {
|
|
969
1012
|
let t = e.current;
|
|
970
1013
|
if (!t) return;
|
|
@@ -990,7 +1033,7 @@ function Qe(e, n, r, i, a) {
|
|
|
990
1033
|
a
|
|
991
1034
|
]);
|
|
992
1035
|
}
|
|
993
|
-
function
|
|
1036
|
+
function ct({ canvasHeight: e, canvasWidth: t }) {
|
|
994
1037
|
let n = Math.floor(t / q), r = Math.floor(e / q);
|
|
995
1038
|
return /* @__PURE__ */ s(a, { children: [Array.from({ length: n + 1 }, (t, n) => /* @__PURE__ */ o(M, {
|
|
996
1039
|
points: [
|
|
@@ -1012,7 +1055,7 @@ function $e({ canvasHeight: e, canvasWidth: t }) {
|
|
|
1012
1055
|
strokeWidth: 1
|
|
1013
1056
|
}, `horizontal-${n}`))] });
|
|
1014
1057
|
}
|
|
1015
|
-
function
|
|
1058
|
+
function lt({ label: e, x: t, y: n }) {
|
|
1016
1059
|
return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(A, {
|
|
1017
1060
|
fill: "#e63542",
|
|
1018
1061
|
radius: 4.75,
|
|
@@ -1022,7 +1065,7 @@ function et({ label: e, x: t, y: n }) {
|
|
|
1022
1065
|
strokeWidth: 1.7,
|
|
1023
1066
|
x: t,
|
|
1024
1067
|
y: n
|
|
1025
|
-
}), /* @__PURE__ */ o(
|
|
1068
|
+
}), /* @__PURE__ */ o(re, {
|
|
1026
1069
|
fill: "#111",
|
|
1027
1070
|
fontSize: 14,
|
|
1028
1071
|
fontStyle: "bold",
|
|
@@ -1031,18 +1074,18 @@ function et({ label: e, x: t, y: n }) {
|
|
|
1031
1074
|
y: n - 18
|
|
1032
1075
|
})] });
|
|
1033
1076
|
}
|
|
1034
|
-
function
|
|
1077
|
+
function ut(e, t) {
|
|
1035
1078
|
let n = e.label?.trim();
|
|
1036
1079
|
return n && n.length > 0 ? n : String(t + 1);
|
|
1037
1080
|
}
|
|
1038
|
-
function
|
|
1081
|
+
function dt({ disabled: e, guide: t, locked: n, onCommit: c }) {
|
|
1039
1082
|
let [l, u] = i(t), d = r(t), f = l.length / 2, p = f + 44, m = -f - 44, h = f + 8, g = -f - 8, _ = !e && !n;
|
|
1040
1083
|
function v(e) {
|
|
1041
1084
|
d.current = e, u(e);
|
|
1042
1085
|
}
|
|
1043
1086
|
function y(e) {
|
|
1044
1087
|
e.cancelBubble = !0;
|
|
1045
|
-
let t =
|
|
1088
|
+
let t = St(e);
|
|
1046
1089
|
t && (v({
|
|
1047
1090
|
...d.current,
|
|
1048
1091
|
x: t.x,
|
|
@@ -1060,8 +1103,8 @@ function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
|
|
|
1060
1103
|
}
|
|
1061
1104
|
function x(e, t) {
|
|
1062
1105
|
e.cancelBubble = !0;
|
|
1063
|
-
let n =
|
|
1064
|
-
n && (v(
|
|
1106
|
+
let n = St(e);
|
|
1107
|
+
n && (v(kt(d.current, n, t)), e.currentTarget.position({
|
|
1065
1108
|
x: 0,
|
|
1066
1109
|
y: 0
|
|
1067
1110
|
}));
|
|
@@ -1069,7 +1112,7 @@ function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
|
|
|
1069
1112
|
function S() {
|
|
1070
1113
|
let e = {
|
|
1071
1114
|
...d.current,
|
|
1072
|
-
rotation:
|
|
1115
|
+
rotation: Mt(d.current.rotation + 90)
|
|
1073
1116
|
};
|
|
1074
1117
|
v(e), c(e);
|
|
1075
1118
|
}
|
|
@@ -1231,8 +1274,8 @@ function nt({ disabled: e, guide: t, locked: n, onCommit: c }) {
|
|
|
1231
1274
|
]
|
|
1232
1275
|
}) });
|
|
1233
1276
|
}
|
|
1234
|
-
function
|
|
1235
|
-
let i = !e && !n, c =
|
|
1277
|
+
function ft({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
1278
|
+
let i = !e && !n, c = Dt({
|
|
1236
1279
|
x: 136,
|
|
1237
1280
|
y: 0
|
|
1238
1281
|
}, t.rotation, {
|
|
@@ -1296,7 +1339,7 @@ function rt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1296
1339
|
180
|
|
1297
1340
|
].map((e) => {
|
|
1298
1341
|
let t = (180 - e) * Math.PI / 180;
|
|
1299
|
-
return /* @__PURE__ */ o(
|
|
1342
|
+
return /* @__PURE__ */ o(re, {
|
|
1300
1343
|
fill: J,
|
|
1301
1344
|
fontSize: 12,
|
|
1302
1345
|
fontStyle: "bold",
|
|
@@ -1325,7 +1368,7 @@ function rt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1325
1368
|
y: c.y
|
|
1326
1369
|
})] });
|
|
1327
1370
|
}
|
|
1328
|
-
function
|
|
1371
|
+
function pt({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
1329
1372
|
let i = !e && !n, c = {
|
|
1330
1373
|
x: t.center.x + t.radius,
|
|
1331
1374
|
y: t.center.y
|
|
@@ -1410,7 +1453,7 @@ function it({ disabled: e, guide: t, locked: n, onChange: r }) {
|
|
|
1410
1453
|
})
|
|
1411
1454
|
] });
|
|
1412
1455
|
}
|
|
1413
|
-
function
|
|
1456
|
+
function mt(e, t = !1) {
|
|
1414
1457
|
let n = t ? .58 : 1;
|
|
1415
1458
|
return e.type === "freehand" ? /* @__PURE__ */ o(M, {
|
|
1416
1459
|
lineCap: "round",
|
|
@@ -1435,7 +1478,7 @@ function at(e, t = !1) {
|
|
|
1435
1478
|
y: e.center.y
|
|
1436
1479
|
}, e.id);
|
|
1437
1480
|
}
|
|
1438
|
-
function
|
|
1481
|
+
function ht(e, t) {
|
|
1439
1482
|
return {
|
|
1440
1483
|
compass: {
|
|
1441
1484
|
center: {
|
|
@@ -1457,16 +1500,16 @@ function ot(e, t) {
|
|
|
1457
1500
|
}
|
|
1458
1501
|
};
|
|
1459
1502
|
}
|
|
1460
|
-
function
|
|
1503
|
+
function gt(e) {
|
|
1461
1504
|
return e?.elements?.length ? Y(e.elements) : (e?.strokes ?? []).filter((e) => e.tool === "pen" && e.points.length >= 4).map((e) => ({
|
|
1462
|
-
color:
|
|
1505
|
+
color: rt,
|
|
1463
1506
|
id: e.id,
|
|
1464
1507
|
points: e.points.slice(),
|
|
1465
1508
|
strokeWidth: 4,
|
|
1466
1509
|
type: "freehand"
|
|
1467
1510
|
}));
|
|
1468
1511
|
}
|
|
1469
|
-
function
|
|
1512
|
+
function _t(e) {
|
|
1470
1513
|
return e.flatMap((e) => e.type === "freehand" ? [{
|
|
1471
1514
|
id: e.id,
|
|
1472
1515
|
points: e.points.slice(),
|
|
@@ -1494,7 +1537,7 @@ function Y(e) {
|
|
|
1494
1537
|
center: { ...e.center }
|
|
1495
1538
|
});
|
|
1496
1539
|
}
|
|
1497
|
-
function
|
|
1540
|
+
function vt(e, t, n) {
|
|
1498
1541
|
let r = e.map((e) => ({
|
|
1499
1542
|
x: e.x / 100 * t,
|
|
1500
1543
|
y: e.y / 100 * n
|
|
@@ -1505,14 +1548,14 @@ function lt(e, t, n) {
|
|
|
1505
1548
|
});
|
|
1506
1549
|
return r.concat(i);
|
|
1507
1550
|
}
|
|
1508
|
-
function
|
|
1509
|
-
let n = e, r =
|
|
1551
|
+
function yt(e, t) {
|
|
1552
|
+
let n = e, r = nt;
|
|
1510
1553
|
return t.forEach((t) => {
|
|
1511
1554
|
let i = X(e, t);
|
|
1512
1555
|
i < r && (n = t, r = i);
|
|
1513
1556
|
}), n;
|
|
1514
1557
|
}
|
|
1515
|
-
function
|
|
1558
|
+
function bt(e) {
|
|
1516
1559
|
let t = e;
|
|
1517
1560
|
for (; t;) {
|
|
1518
1561
|
if (t.name().split(" ").includes("geometry-guide")) return !0;
|
|
@@ -1520,10 +1563,10 @@ function dt(e) {
|
|
|
1520
1563
|
}
|
|
1521
1564
|
return !1;
|
|
1522
1565
|
}
|
|
1523
|
-
function
|
|
1566
|
+
function xt(e) {
|
|
1524
1567
|
return e === "pen" || e === "line" || e === "eraser";
|
|
1525
1568
|
}
|
|
1526
|
-
function
|
|
1569
|
+
function St(e) {
|
|
1527
1570
|
let t = e.target.getStage()?.getPointerPosition();
|
|
1528
1571
|
if (!t) return null;
|
|
1529
1572
|
let n = e.target.getLayer(), r = n?.scaleX() || 1, i = n?.scaleY() || r;
|
|
@@ -1532,16 +1575,16 @@ function pt(e) {
|
|
|
1532
1575
|
y: t.y / i
|
|
1533
1576
|
};
|
|
1534
1577
|
}
|
|
1535
|
-
function
|
|
1536
|
-
return e.type === "freehand" ? e.points.length >= 4 : e.type === "line" ?
|
|
1578
|
+
function Ct(e) {
|
|
1579
|
+
return e.type === "freehand" ? e.points.length >= 4 : e.type === "line" ? At(e.points) > 6 : e.radius > 6;
|
|
1537
1580
|
}
|
|
1538
|
-
function
|
|
1539
|
-
for (let n = e.length - 1; n >= 0; --n) if (
|
|
1581
|
+
function wt(e, t) {
|
|
1582
|
+
for (let n = e.length - 1; n >= 0; --n) if (Tt(e[n], t)) return n;
|
|
1540
1583
|
return -1;
|
|
1541
1584
|
}
|
|
1542
|
-
function
|
|
1585
|
+
function Tt(e, t) {
|
|
1543
1586
|
if (e.type === "circle") return Math.abs(X(e.center, t) - e.radius) <= 14;
|
|
1544
|
-
for (let n = 0; n < e.points.length - 2; n += 2) if (
|
|
1587
|
+
for (let n = 0; n < e.points.length - 2; n += 2) if (Et(t, {
|
|
1545
1588
|
x1: e.points[n],
|
|
1546
1589
|
x2: e.points[n + 2],
|
|
1547
1590
|
y1: e.points[n + 1],
|
|
@@ -1549,27 +1592,27 @@ function gt(e, t) {
|
|
|
1549
1592
|
}) <= 14) return !0;
|
|
1550
1593
|
return !1;
|
|
1551
1594
|
}
|
|
1552
|
-
function
|
|
1595
|
+
function Et(e, t) {
|
|
1553
1596
|
let n = t.x2 - t.x1, r = t.y2 - t.y1, i = n * n + r * r;
|
|
1554
1597
|
if (i === 0) return X(e, {
|
|
1555
1598
|
x: t.x1,
|
|
1556
1599
|
y: t.y1
|
|
1557
1600
|
});
|
|
1558
|
-
let a =
|
|
1601
|
+
let a = jt(((e.x - t.x1) * n + (e.y - t.y1) * r) / i, 0, 1);
|
|
1559
1602
|
return X(e, {
|
|
1560
1603
|
x: t.x1 + a * n,
|
|
1561
1604
|
y: t.y1 + a * r
|
|
1562
1605
|
});
|
|
1563
1606
|
}
|
|
1564
|
-
function
|
|
1607
|
+
function Dt(e, t, n) {
|
|
1565
1608
|
let r = t * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
|
|
1566
1609
|
return {
|
|
1567
1610
|
x: n.x + e.x * i - e.y * a,
|
|
1568
1611
|
y: n.y + e.x * a + e.y * i
|
|
1569
1612
|
};
|
|
1570
1613
|
}
|
|
1571
|
-
function
|
|
1572
|
-
return
|
|
1614
|
+
function Ot(e, t) {
|
|
1615
|
+
return Dt({
|
|
1573
1616
|
x: t === "left" ? -e.length / 2 : e.length / 2,
|
|
1574
1617
|
y: 0
|
|
1575
1618
|
}, e.rotation, {
|
|
@@ -1577,8 +1620,8 @@ function yt(e, t) {
|
|
|
1577
1620
|
y: e.y
|
|
1578
1621
|
});
|
|
1579
1622
|
}
|
|
1580
|
-
function
|
|
1581
|
-
let r = n === "right" ? "left" : "right", i =
|
|
1623
|
+
function kt(e, t, n) {
|
|
1624
|
+
let r = n === "right" ? "left" : "right", i = Ot(e, r), a = Math.atan2(t.y - i.y, t.x - i.x) * 180 / Math.PI, o = Mt(n === "right" ? a : a + 180), s = o * Math.PI / 180, c = e.length / 2, l = r === "left" ? 1 : -1;
|
|
1582
1625
|
return {
|
|
1583
1626
|
...e,
|
|
1584
1627
|
rotation: o,
|
|
@@ -1586,7 +1629,7 @@ function bt(e, t, n) {
|
|
|
1586
1629
|
y: i.y + Math.sin(s) * c * l
|
|
1587
1630
|
};
|
|
1588
1631
|
}
|
|
1589
|
-
function
|
|
1632
|
+
function At(e) {
|
|
1590
1633
|
return X({
|
|
1591
1634
|
x: e[0],
|
|
1592
1635
|
y: e[1]
|
|
@@ -1598,16 +1641,16 @@ function xt(e) {
|
|
|
1598
1641
|
function X(e, t) {
|
|
1599
1642
|
return Math.hypot(e.x - t.x, e.y - t.y);
|
|
1600
1643
|
}
|
|
1601
|
-
function
|
|
1644
|
+
function jt(e, t, n) {
|
|
1602
1645
|
return Math.min(Math.max(e, t), n);
|
|
1603
1646
|
}
|
|
1604
|
-
function
|
|
1647
|
+
function Mt(e) {
|
|
1605
1648
|
return (e % 360 + 360) % 360;
|
|
1606
1649
|
}
|
|
1607
1650
|
//#endregion
|
|
1608
1651
|
//#region src/exam-session/interactions/KonvaDrawingGrid.tsx
|
|
1609
|
-
function
|
|
1610
|
-
return /* @__PURE__ */ o(
|
|
1652
|
+
function Nt({ points: e, value: t, onChange: n }) {
|
|
1653
|
+
return /* @__PURE__ */ o(ot, {
|
|
1611
1654
|
onChange: n,
|
|
1612
1655
|
points: e,
|
|
1613
1656
|
value: t,
|
|
@@ -1616,7 +1659,7 @@ function wt({ points: e, value: t, onChange: n }) {
|
|
|
1616
1659
|
}
|
|
1617
1660
|
//#endregion
|
|
1618
1661
|
//#region src/exam-session/interactions/LabelPlacement.tsx
|
|
1619
|
-
function
|
|
1662
|
+
function Pt({ labels: e, targets: t, value: n, onChange: r }) {
|
|
1620
1663
|
let i = n?.placements ?? {}, a = new Set(Object.keys(i));
|
|
1621
1664
|
return /* @__PURE__ */ o(c, {
|
|
1622
1665
|
onDragEnd: (e) => {
|
|
@@ -1639,10 +1682,10 @@ function Tt({ labels: e, targets: t, value: n, onChange: r }) {
|
|
|
1639
1682
|
className: "label-placement",
|
|
1640
1683
|
children: [/* @__PURE__ */ o("div", {
|
|
1641
1684
|
className: "label-placement__bank",
|
|
1642
|
-
children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(
|
|
1685
|
+
children: e.filter((e) => !a.has(e.id)).map((e) => /* @__PURE__ */ o(Ft, { label: e }, e.id))
|
|
1643
1686
|
}), /* @__PURE__ */ o("div", {
|
|
1644
1687
|
className: "label-placement__diagram",
|
|
1645
|
-
children: t.map((t) => /* @__PURE__ */ o(
|
|
1688
|
+
children: t.map((t) => /* @__PURE__ */ o(It, {
|
|
1646
1689
|
label: e.find((e) => i[e.id]?.targetId === t.id),
|
|
1647
1690
|
target: t
|
|
1648
1691
|
}, t.id))
|
|
@@ -1650,7 +1693,7 @@ function Tt({ labels: e, targets: t, value: n, onChange: r }) {
|
|
|
1650
1693
|
})
|
|
1651
1694
|
});
|
|
1652
1695
|
}
|
|
1653
|
-
function
|
|
1696
|
+
function Ft({ label: e }) {
|
|
1654
1697
|
let { ref: t, isDragging: n } = l({ id: e.id });
|
|
1655
1698
|
return /* @__PURE__ */ o("button", {
|
|
1656
1699
|
className: n ? "placement-label placement-label--dragging" : "placement-label",
|
|
@@ -1659,7 +1702,7 @@ function Et({ label: e }) {
|
|
|
1659
1702
|
children: e.label
|
|
1660
1703
|
});
|
|
1661
1704
|
}
|
|
1662
|
-
function
|
|
1705
|
+
function It({ label: e, target: t }) {
|
|
1663
1706
|
let { ref: n, isDropTarget: r } = u({ id: t.id });
|
|
1664
1707
|
return /* @__PURE__ */ s("div", {
|
|
1665
1708
|
className: r ? "placement-target placement-target--active" : "placement-target",
|
|
@@ -1671,15 +1714,15 @@ function Dt({ label: e, target: t }) {
|
|
|
1671
1714
|
children: [/* @__PURE__ */ o("span", {
|
|
1672
1715
|
"aria-hidden": "true",
|
|
1673
1716
|
children: t.label
|
|
1674
|
-
}), e ? /* @__PURE__ */ o(
|
|
1717
|
+
}), e ? /* @__PURE__ */ o(Ft, { label: e }) : null]
|
|
1675
1718
|
});
|
|
1676
1719
|
}
|
|
1677
1720
|
//#endregion
|
|
1678
1721
|
//#region src/exam-session/interactions/NumberLineAnswer.tsx
|
|
1679
|
-
function
|
|
1722
|
+
function Lt({ answerId: e, expression: t, value: n, onChange: r, onClear: i, recognizer: a }) {
|
|
1680
1723
|
return /* @__PURE__ */ s("div", {
|
|
1681
1724
|
className: "number-line-layout",
|
|
1682
|
-
children: [/* @__PURE__ */ o(
|
|
1725
|
+
children: [/* @__PURE__ */ o(Rt, {}), /* @__PURE__ */ s("div", {
|
|
1683
1726
|
className: "compact-answer",
|
|
1684
1727
|
children: [/* @__PURE__ */ o("span", { children: t }), /* @__PURE__ */ o(G, {
|
|
1685
1728
|
ariaLabel: t,
|
|
@@ -1691,7 +1734,7 @@ function Ot({ answerId: e, expression: t, value: n, onChange: r, onClear: i, rec
|
|
|
1691
1734
|
})]
|
|
1692
1735
|
});
|
|
1693
1736
|
}
|
|
1694
|
-
function
|
|
1737
|
+
function Rt() {
|
|
1695
1738
|
return /* @__PURE__ */ s("svg", {
|
|
1696
1739
|
className: "number-line",
|
|
1697
1740
|
viewBox: "0 0 520 86",
|
|
@@ -1719,7 +1762,7 @@ function kt() {
|
|
|
1719
1762
|
}
|
|
1720
1763
|
//#endregion
|
|
1721
1764
|
//#region src/voice/evaluateVoiceAiResult.ts
|
|
1722
|
-
var
|
|
1765
|
+
var zt = {
|
|
1723
1766
|
audioConfig: {
|
|
1724
1767
|
bitDepth: 16,
|
|
1725
1768
|
channels: 1,
|
|
@@ -1729,18 +1772,18 @@ var At = {
|
|
|
1729
1772
|
lang: "fr",
|
|
1730
1773
|
useModelAi: !0
|
|
1731
1774
|
};
|
|
1732
|
-
function
|
|
1733
|
-
let r =
|
|
1775
|
+
function Bt(e, t, n) {
|
|
1776
|
+
let r = Wt([t, ...n.acceptedPronunciations ?? []]), i = r.map(Vt), a = Vt(e.transcript), o = i.map((e, t) => ({
|
|
1734
1777
|
index: t,
|
|
1735
|
-
similarity:
|
|
1778
|
+
similarity: Ut(a, e)
|
|
1736
1779
|
})).reduce((e, t) => t.similarity > e.similarity ? t : e, {
|
|
1737
1780
|
index: -1,
|
|
1738
1781
|
similarity: 0
|
|
1739
|
-
}), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l =
|
|
1782
|
+
}), s = o.index >= 0 ? r[o.index] : null, c = o.similarity === 1, l = Gt(n.minimumSimilarity ?? Ht(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";
|
|
1740
1783
|
return {
|
|
1741
1784
|
acceptedPronunciations: r,
|
|
1742
1785
|
confidence: e.confidence,
|
|
1743
|
-
confidencePercent: Math.round(
|
|
1786
|
+
confidencePercent: Math.round(Gt(e.confidence, 0, 1) * 100),
|
|
1744
1787
|
detectedPronunciation: e.transcript,
|
|
1745
1788
|
expectedLanguage: n.expectedLanguage,
|
|
1746
1789
|
expectedText: t,
|
|
@@ -1759,13 +1802,13 @@ function jt(e, t, n) {
|
|
|
1759
1802
|
timestamps: e.timestamps ?? []
|
|
1760
1803
|
};
|
|
1761
1804
|
}
|
|
1762
|
-
function
|
|
1805
|
+
function Vt(e) {
|
|
1763
1806
|
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();
|
|
1764
1807
|
}
|
|
1765
|
-
function
|
|
1766
|
-
return (e ?
|
|
1808
|
+
function Ht(e) {
|
|
1809
|
+
return (e ? Vt(e).length : 0) <= 4 ? 1 : .85;
|
|
1767
1810
|
}
|
|
1768
|
-
function
|
|
1811
|
+
function Ut(e, t) {
|
|
1769
1812
|
let n = Array.from(e), r = Array.from(t), i = Math.max(n.length, r.length);
|
|
1770
1813
|
if (i === 0) return 0;
|
|
1771
1814
|
let a = Array.from({ length: r.length + 1 }, (e, t) => t);
|
|
@@ -1777,22 +1820,22 @@ function Pt(e, t) {
|
|
|
1777
1820
|
}
|
|
1778
1821
|
a.splice(0, a.length, ...t);
|
|
1779
1822
|
}
|
|
1780
|
-
return
|
|
1823
|
+
return Gt(1 - a[r.length] / i, 0, 1);
|
|
1781
1824
|
}
|
|
1782
|
-
function
|
|
1825
|
+
function Wt(e) {
|
|
1783
1826
|
let t = /* @__PURE__ */ new Set();
|
|
1784
1827
|
return e.filter((e) => {
|
|
1785
|
-
let n =
|
|
1828
|
+
let n = Vt(e);
|
|
1786
1829
|
return !n || t.has(n) ? !1 : (t.add(n), !0);
|
|
1787
1830
|
});
|
|
1788
1831
|
}
|
|
1789
|
-
function
|
|
1832
|
+
function Gt(e, t, n) {
|
|
1790
1833
|
return Math.min(n, Math.max(t, e));
|
|
1791
1834
|
}
|
|
1792
1835
|
//#endregion
|
|
1793
1836
|
//#region src/exam-session/interactions/PronunciationRecorder.tsx
|
|
1794
|
-
function
|
|
1795
|
-
let [_, v] = i("idle"), [b, x] = i(null), [S, w] = i(0), T = r(null), E = r(!1), D = n(() => g ?
|
|
1837
|
+
function Kt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc: l, instruction: u, language: d, minimumSimilarity: f, onChange: p, onReset: m, recorder: h, value: g }) {
|
|
1838
|
+
let [_, v] = i("idle"), [b, x] = i(null), [S, w] = i(0), T = r(null), E = r(!1), D = n(() => g ? Bt(g.result.modelAiResult, a, {
|
|
1796
1839
|
acceptedPronunciations: e,
|
|
1797
1840
|
expectedLanguage: d,
|
|
1798
1841
|
minimumSimilarity: f
|
|
@@ -1819,14 +1862,14 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
|
|
|
1819
1862
|
try {
|
|
1820
1863
|
if (!h) throw Error("Ù…ÙØ³Ø¬Ù‘ÙÙ„ الصَّوت غَير Ù…ÙØªØ§ØÙ ÙÙÙŠ هذا التَّطبÙيق.");
|
|
1821
1864
|
let e = {
|
|
1822
|
-
...
|
|
1865
|
+
...zt,
|
|
1823
1866
|
lang: d,
|
|
1824
1867
|
maxDuration: 10
|
|
1825
1868
|
};
|
|
1826
1869
|
if (!(await h.startRecording(e)).started) throw Error("تعذّر بدء التسجيل الصوتي.");
|
|
1827
1870
|
E.current = !0, T.current = Date.now(), w(0), v("recording");
|
|
1828
1871
|
} catch (e) {
|
|
1829
|
-
E.current = !1, T.current = null, x(
|
|
1872
|
+
E.current = !1, T.current = null, x(Xt(e)), v("error");
|
|
1830
1873
|
}
|
|
1831
1874
|
}
|
|
1832
1875
|
}
|
|
@@ -1835,7 +1878,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
|
|
|
1835
1878
|
v("processing"), x(null);
|
|
1836
1879
|
try {
|
|
1837
1880
|
if (!h) throw Error("Ù…ÙØ³Ø¬Ù‘ÙÙ„ الصَّوت غَير Ù…ÙØªØ§ØÙ ÙÙÙŠ هذا التَّطبÙيق.");
|
|
1838
|
-
let t = await h.stopRecording(), n =
|
|
1881
|
+
let t = await h.stopRecording(), n = Bt(t.modelAiResult, a, {
|
|
1839
1882
|
acceptedPronunciations: e,
|
|
1840
1883
|
expectedLanguage: d,
|
|
1841
1884
|
minimumSimilarity: f
|
|
@@ -1846,7 +1889,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
|
|
|
1846
1889
|
result: t
|
|
1847
1890
|
}), v("idle");
|
|
1848
1891
|
} catch (e) {
|
|
1849
|
-
E.current = !1, T.current = null, x(
|
|
1892
|
+
E.current = !1, T.current = null, x(Xt(e)), v("error");
|
|
1850
1893
|
}
|
|
1851
1894
|
}
|
|
1852
1895
|
}
|
|
@@ -1871,7 +1914,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
|
|
|
1871
1914
|
children: [
|
|
1872
1915
|
/* @__PURE__ */ s("span", { children: [
|
|
1873
1916
|
"اُنْطِقِ الكَلِمَةَ بِـ",
|
|
1874
|
-
|
|
1917
|
+
Yt(d),
|
|
1875
1918
|
":"
|
|
1876
1919
|
] }),
|
|
1877
1920
|
/* @__PURE__ */ o("strong", {
|
|
@@ -1889,7 +1932,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
|
|
|
1889
1932
|
className: "audio-debug-card__icon",
|
|
1890
1933
|
"aria-hidden": "true",
|
|
1891
1934
|
children: /* @__PURE__ */ o(y, {})
|
|
1892
|
-
}), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children:
|
|
1935
|
+
}), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Zt(_, !!g) }), /* @__PURE__ */ o("span", { children: Jt(te) })] })]
|
|
1893
1936
|
}),
|
|
1894
1937
|
/* @__PURE__ */ s("div", {
|
|
1895
1938
|
className: "audio-debug-actions",
|
|
@@ -1929,7 +1972,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
|
|
|
1929
1972
|
role: "status",
|
|
1930
1973
|
children: [/* @__PURE__ */ s("div", {
|
|
1931
1974
|
className: "audio-pronunciation-feedback__headline",
|
|
1932
|
-
children: [/* @__PURE__ */ o(
|
|
1975
|
+
children: [/* @__PURE__ */ o(qt, { status: D.status }), /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("strong", { children: Qt(D.status) }), /* @__PURE__ */ o("span", { children: $t(D.status, a) })] })]
|
|
1933
1976
|
}), /* @__PURE__ */ s("div", {
|
|
1934
1977
|
className: "audio-debug-metadata",
|
|
1935
1978
|
children: [
|
|
@@ -1963,7 +2006,7 @@ function Lt({ acceptedPronunciations: e, expectedText: a, imageAlt: c, imageSrc:
|
|
|
1963
2006
|
]
|
|
1964
2007
|
});
|
|
1965
2008
|
}
|
|
1966
|
-
function
|
|
2009
|
+
function qt({ status: e }) {
|
|
1967
2010
|
return o(e === "correct" ? f : e === "no-speech" ? D : O, { "aria-hidden": "true" });
|
|
1968
2011
|
}
|
|
1969
2012
|
function Z({ label: e, value: t }) {
|
|
@@ -1975,42 +2018,42 @@ function Z({ label: e, value: t }) {
|
|
|
1975
2018
|
})]
|
|
1976
2019
|
});
|
|
1977
2020
|
}
|
|
1978
|
-
function
|
|
2021
|
+
function Jt(e) {
|
|
1979
2022
|
let t = Math.max(0, Math.round(e / 1e3)), n = Math.floor(t / 60), r = t % 60;
|
|
1980
2023
|
return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
|
|
1981
2024
|
}
|
|
1982
|
-
function
|
|
2025
|
+
function Yt(e) {
|
|
1983
2026
|
return e === "fr" ? "الفَرَنْسِيَّةِ" : "العَرَبِيَّةِ";
|
|
1984
2027
|
}
|
|
1985
|
-
function
|
|
2028
|
+
function Xt(e) {
|
|
1986
2029
|
let t = e;
|
|
1987
2030
|
return t.code === "MISSING_PERMISSION" ? "يَجِبُ السَّماحُ بِاسْتِعْمالِ المِيكْرُوفُونِ لِتَسْجِيلِ الإِجابَةِ." : t.code === "MODEL_VOCAB_MISMATCH" ? "مَلَفُّ نَمُوذَجِ اللُّغَةِ لا يُطابِقُ قامُوسَهُ. يُرْجى تَصْحِيحُ مَلَفِّ النَّمُوذَجِ." : t.message ? t.message : typeof e == "string" ? e : "حَدَثَ خَطَأٌ أَثْناءَ تَسْجِيلِ الإِجابَةِ الصَّوْتِيَّةِ.";
|
|
1988
2031
|
}
|
|
1989
|
-
function
|
|
2032
|
+
function Zt(e, t) {
|
|
1990
2033
|
return e === "checking" ? "جارِي تَجْهِيزُ المِيكْرُوفُونِ" : e === "recording" ? "جارِي التَّسْجِيلُ... تَكَلَّمِ الآنَ" : e === "processing" ? "جارِي تَحْلِيلُ النُّطْقِ" : e === "error" ? "تَعَذَّرَ تَحْلِيلُ التَّسْجِيلِ" : t ? "اِكْتَمَلَ تَحْلِيلُ الإِجابَةِ" : "المِيكْرُوفُونُ جاهِزٌ";
|
|
1991
2034
|
}
|
|
1992
|
-
function
|
|
2035
|
+
function Qt(e) {
|
|
1993
2036
|
return e === "correct" ? "أَحْسَنْتَ! إِجابَةٌ صَحِيحَةٌ" : e === "no-speech" ? "لَمْ نَسْمَعْ كَلِمَةً واضِحَةً" : e === "language-mismatch" ? "اُسْتُعْمِلَ نَمُوذَجُ لُغَةٍ مُخْتَلِفَةٍ" : "حاوِلْ مَرَّةً أُخْرى";
|
|
1994
2037
|
}
|
|
1995
|
-
function
|
|
2038
|
+
function $t(e, t) {
|
|
1996
2039
|
return e === "correct" ? `نَطَقْتَ «${t}» بِشَكْلٍ صَحِيحٍ.` : e === "no-speech" ? `قَرِّبْ فَمَكَ مِنَ المِيكْرُوفُونِ وَقُلْ «${t}».` : `اِسْتَمِعْ إِلى نُطْقِ «${t}» ثُمَّ أَعِدِ المُحاوَلَةَ.`;
|
|
1997
2040
|
}
|
|
1998
2041
|
//#endregion
|
|
1999
2042
|
//#region src/exam-session/interactions/SortableAnswer.tsx
|
|
2000
|
-
function
|
|
2043
|
+
function en({ answerId: e, items: t, value: n, onChange: r }) {
|
|
2001
2044
|
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);
|
|
2002
2045
|
return /* @__PURE__ */ o(c, {
|
|
2003
2046
|
onDragEnd: (e) => {
|
|
2004
2047
|
e.canceled || r({
|
|
2005
2048
|
kind: "order",
|
|
2006
|
-
itemIds:
|
|
2049
|
+
itemIds: P(a, e).map((e) => e.toString())
|
|
2007
2050
|
});
|
|
2008
2051
|
},
|
|
2009
2052
|
children: /* @__PURE__ */ o("div", {
|
|
2010
2053
|
className: "sortable-answer",
|
|
2011
2054
|
children: a.map((t, n) => {
|
|
2012
2055
|
let r = i.get(t);
|
|
2013
|
-
return r ? /* @__PURE__ */ o(
|
|
2056
|
+
return r ? /* @__PURE__ */ o(tn, {
|
|
2014
2057
|
group: e,
|
|
2015
2058
|
index: n,
|
|
2016
2059
|
item: r
|
|
@@ -2019,8 +2062,8 @@ function Gt({ answerId: e, items: t, value: n, onChange: r }) {
|
|
|
2019
2062
|
})
|
|
2020
2063
|
});
|
|
2021
2064
|
}
|
|
2022
|
-
function
|
|
2023
|
-
let { ref: r, isDragging: i, isDropTarget: a } =
|
|
2065
|
+
function tn({ group: e, index: t, item: n }) {
|
|
2066
|
+
let { ref: r, isDragging: i, isDropTarget: a } = F({
|
|
2024
2067
|
id: n.id,
|
|
2025
2068
|
index: t,
|
|
2026
2069
|
group: e,
|
|
@@ -2039,7 +2082,7 @@ function Kt({ group: e, index: t, item: n }) {
|
|
|
2039
2082
|
}
|
|
2040
2083
|
//#endregion
|
|
2041
2084
|
//#region src/exam-session/interactions/TextAnswer.tsx
|
|
2042
|
-
function
|
|
2085
|
+
function nn({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onChange: i }) {
|
|
2043
2086
|
return /* @__PURE__ */ o("input", {
|
|
2044
2087
|
"aria-label": e,
|
|
2045
2088
|
className: t,
|
|
@@ -2053,7 +2096,7 @@ function qt({ ariaLabel: e, className: t, inputMode: n = "text", value: r, onCha
|
|
|
2053
2096
|
}
|
|
2054
2097
|
//#endregion
|
|
2055
2098
|
//#region src/renderer/visualScene.tsx
|
|
2056
|
-
var
|
|
2099
|
+
var rn = {
|
|
2057
2100
|
apple: d,
|
|
2058
2101
|
circle: p,
|
|
2059
2102
|
flower: g,
|
|
@@ -2063,7 +2106,7 @@ var Jt = {
|
|
|
2063
2106
|
star: w,
|
|
2064
2107
|
sun: T,
|
|
2065
2108
|
triangle: E
|
|
2066
|
-
},
|
|
2109
|
+
}, an = {
|
|
2067
2110
|
blue: "#4d89d9",
|
|
2068
2111
|
gray: "#8c97a0",
|
|
2069
2112
|
green: "#1f9d63",
|
|
@@ -2071,7 +2114,7 @@ var Jt = {
|
|
|
2071
2114
|
purple: "#8a63d2",
|
|
2072
2115
|
red: "#eb5b5b",
|
|
2073
2116
|
yellow: "#f2c641"
|
|
2074
|
-
},
|
|
2117
|
+
}, on = {
|
|
2075
2118
|
"counter-rows": { rows: [{
|
|
2076
2119
|
color: "yellow",
|
|
2077
2120
|
count: 5,
|
|
@@ -2098,7 +2141,7 @@ var Jt = {
|
|
|
2098
2141
|
id: "star-row",
|
|
2099
2142
|
state: "plain"
|
|
2100
2143
|
}] }
|
|
2101
|
-
},
|
|
2144
|
+
}, sn = [
|
|
2102
2145
|
{
|
|
2103
2146
|
label: "Cercle",
|
|
2104
2147
|
value: "circle"
|
|
@@ -2135,7 +2178,7 @@ var Jt = {
|
|
|
2135
2178
|
label: "Hexagone",
|
|
2136
2179
|
value: "hexagon"
|
|
2137
2180
|
}
|
|
2138
|
-
],
|
|
2181
|
+
], cn = [
|
|
2139
2182
|
{
|
|
2140
2183
|
label: "Jaune",
|
|
2141
2184
|
value: "yellow"
|
|
@@ -2164,20 +2207,20 @@ var Jt = {
|
|
|
2164
2207
|
label: "Gris",
|
|
2165
2208
|
value: "gray"
|
|
2166
2209
|
}
|
|
2167
|
-
],
|
|
2210
|
+
], ln = [{
|
|
2168
2211
|
label: "Normal",
|
|
2169
2212
|
value: "plain"
|
|
2170
2213
|
}, {
|
|
2171
2214
|
label: "Barre",
|
|
2172
2215
|
value: "crossed"
|
|
2173
2216
|
}];
|
|
2174
|
-
function
|
|
2175
|
-
return { rows:
|
|
2217
|
+
function un(e) {
|
|
2218
|
+
return { rows: on[e].rows.map((e) => ({ ...e })) };
|
|
2176
2219
|
}
|
|
2177
|
-
function
|
|
2178
|
-
return
|
|
2220
|
+
function dn(e) {
|
|
2221
|
+
return an[e];
|
|
2179
2222
|
}
|
|
2180
|
-
function
|
|
2223
|
+
function fn({ scene: e }) {
|
|
2181
2224
|
return /* @__PURE__ */ o("div", {
|
|
2182
2225
|
className: "visual-panel visual-panel--custom",
|
|
2183
2226
|
"aria-hidden": "true",
|
|
@@ -2185,7 +2228,7 @@ function nn({ scene: e }) {
|
|
|
2185
2228
|
className: "visual-scene",
|
|
2186
2229
|
children: e.rows.map((e) => /* @__PURE__ */ o("div", {
|
|
2187
2230
|
className: "visual-scene-row",
|
|
2188
|
-
children: Array.from({ length: Math.max(1, Math.floor(e.count) || 1) }, (t, n) => /* @__PURE__ */ o(
|
|
2231
|
+
children: Array.from({ length: Math.max(1, Math.floor(e.count) || 1) }, (t, n) => /* @__PURE__ */ o(pn, {
|
|
2189
2232
|
color: e.color,
|
|
2190
2233
|
icon: e.icon,
|
|
2191
2234
|
state: e.state
|
|
@@ -2194,26 +2237,26 @@ function nn({ scene: e }) {
|
|
|
2194
2237
|
})
|
|
2195
2238
|
});
|
|
2196
2239
|
}
|
|
2197
|
-
function
|
|
2198
|
-
let r =
|
|
2240
|
+
function pn({ color: e, icon: t, state: n }) {
|
|
2241
|
+
let r = rn[t];
|
|
2199
2242
|
return /* @__PURE__ */ o("span", {
|
|
2200
2243
|
className: n === "crossed" ? "visual-scene-icon visual-scene-icon--crossed" : "visual-scene-icon",
|
|
2201
|
-
style: { color:
|
|
2244
|
+
style: { color: dn(e) },
|
|
2202
2245
|
children: /* @__PURE__ */ o(r, { "aria-hidden": "true" })
|
|
2203
2246
|
});
|
|
2204
2247
|
}
|
|
2205
2248
|
//#endregion
|
|
2206
2249
|
//#region src/renderer/QuestionRenderer.tsx
|
|
2207
|
-
function
|
|
2250
|
+
function mn({ adapters: e, clearAnswer: t, question: n, getAnswer: r, updateAnswer: i }) {
|
|
2208
2251
|
return /* @__PURE__ */ s("article", {
|
|
2209
2252
|
className: `question-block question-block--${n.type}`,
|
|
2210
|
-
children: [/* @__PURE__ */ o(
|
|
2253
|
+
children: [/* @__PURE__ */ o(gn, {
|
|
2211
2254
|
number: n.number,
|
|
2212
2255
|
prompt: n.prompt
|
|
2213
|
-
}),
|
|
2256
|
+
}), _n(n, r, i, t, e)]
|
|
2214
2257
|
});
|
|
2215
2258
|
}
|
|
2216
|
-
function
|
|
2259
|
+
function hn({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswer: i }) {
|
|
2217
2260
|
return /* @__PURE__ */ s("section", {
|
|
2218
2261
|
className: `question-section question-section--${n.tone}`,
|
|
2219
2262
|
children: [/* @__PURE__ */ s("header", {
|
|
@@ -2221,7 +2264,7 @@ function on({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
|
|
|
2221
2264
|
children: [
|
|
2222
2265
|
/* @__PURE__ */ s("span", {
|
|
2223
2266
|
className: "section-points",
|
|
2224
|
-
children: [/* @__PURE__ */ o("small", { children: "ن" }), n
|
|
2267
|
+
children: [/* @__PURE__ */ o("small", { children: "ن" }), R(n)]
|
|
2225
2268
|
}),
|
|
2226
2269
|
/* @__PURE__ */ o("h3", { children: n.title }),
|
|
2227
2270
|
/* @__PURE__ */ o("span", {
|
|
@@ -2231,7 +2274,7 @@ function on({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
|
|
|
2231
2274
|
]
|
|
2232
2275
|
}), /* @__PURE__ */ o("div", {
|
|
2233
2276
|
className: "section-body",
|
|
2234
|
-
children: n.questions.map((n) => /* @__PURE__ */ o(
|
|
2277
|
+
children: n.questions.map((n) => /* @__PURE__ */ o(mn, {
|
|
2235
2278
|
adapters: e,
|
|
2236
2279
|
clearAnswer: t,
|
|
2237
2280
|
getAnswer: r,
|
|
@@ -2241,17 +2284,17 @@ function on({ adapters: e, clearAnswer: t, section: n, getAnswer: r, updateAnswe
|
|
|
2241
2284
|
})]
|
|
2242
2285
|
});
|
|
2243
2286
|
}
|
|
2244
|
-
function
|
|
2287
|
+
function gn({ number: e, prompt: t }) {
|
|
2245
2288
|
return /* @__PURE__ */ s("div", {
|
|
2246
2289
|
className: "question-prompt",
|
|
2247
2290
|
children: [e > 0 ? /* @__PURE__ */ o("span", { children: e }) : null, /* @__PURE__ */ o("strong", { children: t })]
|
|
2248
2291
|
});
|
|
2249
2292
|
}
|
|
2250
|
-
function
|
|
2293
|
+
function _n(e, t, n, r, i) {
|
|
2251
2294
|
switch (e.type) {
|
|
2252
2295
|
case "inline-inputs": return /* @__PURE__ */ o("div", {
|
|
2253
2296
|
className: "inline-equation-grid",
|
|
2254
|
-
children: e.items.map((a) =>
|
|
2297
|
+
children: e.items.map((a) => vn({
|
|
2255
2298
|
adapters: i,
|
|
2256
2299
|
className: "equation-card",
|
|
2257
2300
|
clearAnswer: r,
|
|
@@ -2261,11 +2304,11 @@ function cn(e, t, n, r, i) {
|
|
|
2261
2304
|
updateAnswer: n
|
|
2262
2305
|
}))
|
|
2263
2306
|
});
|
|
2264
|
-
case "visual-choice": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(
|
|
2307
|
+
case "visual-choice": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(An, {
|
|
2265
2308
|
choices: e.choices,
|
|
2266
2309
|
onChange: (t) => n(e.id, t),
|
|
2267
2310
|
scene: e.scene,
|
|
2268
|
-
value:
|
|
2311
|
+
value: xn(t(e.id)),
|
|
2269
2312
|
visual: e.visual
|
|
2270
2313
|
}), e.inputLabel ? /* @__PURE__ */ s("div", {
|
|
2271
2314
|
className: "compact-answer",
|
|
@@ -2277,7 +2320,7 @@ function cn(e, t, n, r, i) {
|
|
|
2277
2320
|
value: Q(t(`${e.id}:input`))
|
|
2278
2321
|
})]
|
|
2279
2322
|
}) : null] });
|
|
2280
|
-
case "number-line": return /* @__PURE__ */ o(
|
|
2323
|
+
case "number-line": return /* @__PURE__ */ o(Lt, {
|
|
2281
2324
|
answerId: e.id,
|
|
2282
2325
|
expression: e.expression,
|
|
2283
2326
|
onClear: r,
|
|
@@ -2287,7 +2330,7 @@ function cn(e, t, n, r, i) {
|
|
|
2287
2330
|
});
|
|
2288
2331
|
case "equation-inputs": return /* @__PURE__ */ o("div", {
|
|
2289
2332
|
className: "stacked-equations",
|
|
2290
|
-
children: e.items.map((a) =>
|
|
2333
|
+
children: e.items.map((a) => vn({
|
|
2291
2334
|
adapters: i,
|
|
2292
2335
|
ariaPrefix: e.prompt,
|
|
2293
2336
|
className: "wide-equation-card",
|
|
@@ -2298,7 +2341,7 @@ function cn(e, t, n, r, i) {
|
|
|
2298
2341
|
updateAnswer: n
|
|
2299
2342
|
}))
|
|
2300
2343
|
});
|
|
2301
|
-
case "length-estimation": return /* @__PURE__ */ o(
|
|
2344
|
+
case "length-estimation": return /* @__PURE__ */ o(jn, {
|
|
2302
2345
|
answerId: e.id,
|
|
2303
2346
|
choices: e.choices,
|
|
2304
2347
|
getAnswer: t,
|
|
@@ -2307,7 +2350,7 @@ function cn(e, t, n, r, i) {
|
|
|
2307
2350
|
});
|
|
2308
2351
|
case "shape-choice": return /* @__PURE__ */ s("div", {
|
|
2309
2352
|
className: "shape-choice-layout",
|
|
2310
|
-
children: [/* @__PURE__ */ o(
|
|
2353
|
+
children: [/* @__PURE__ */ o(Ve, {
|
|
2311
2354
|
items: e.choices.map((e) => ({
|
|
2312
2355
|
id: `${e.id}-label`,
|
|
2313
2356
|
label: e.label
|
|
@@ -2315,24 +2358,24 @@ function cn(e, t, n, r, i) {
|
|
|
2315
2358
|
onChange: (t) => n(e.id, t),
|
|
2316
2359
|
targets: e.choices.map((e) => ({
|
|
2317
2360
|
id: `${e.id}-target`,
|
|
2318
|
-
label:
|
|
2361
|
+
label: On(e.id)
|
|
2319
2362
|
})),
|
|
2320
|
-
value:
|
|
2363
|
+
value: xn(t(e.id))
|
|
2321
2364
|
}), /* @__PURE__ */ o("div", {
|
|
2322
2365
|
className: "shape-row",
|
|
2323
2366
|
"aria-hidden": "true",
|
|
2324
2367
|
children: e.choices.map((e) => /* @__PURE__ */ o("span", { className: `shape-drawing shape-drawing--${e.id}` }, e.id))
|
|
2325
2368
|
})]
|
|
2326
2369
|
});
|
|
2327
|
-
case "drawing-grid": return /* @__PURE__ */ o(
|
|
2370
|
+
case "drawing-grid": return /* @__PURE__ */ o(Nt, {
|
|
2328
2371
|
onChange: (t) => n(e.id, t),
|
|
2329
2372
|
points: e.points,
|
|
2330
|
-
value:
|
|
2373
|
+
value: wn(t(e.id))
|
|
2331
2374
|
});
|
|
2332
|
-
case "table-response": return /* @__PURE__ */ o(
|
|
2375
|
+
case "table-response": return /* @__PURE__ */ o(Fe, {
|
|
2333
2376
|
columns: e.columns,
|
|
2334
2377
|
onChange: (t) => n(e.id, t),
|
|
2335
|
-
value:
|
|
2378
|
+
value: Tn(t(e.id))
|
|
2336
2379
|
});
|
|
2337
2380
|
case "text-input": return e.before && !e.after && e.number === 0 ? /* @__PURE__ */ o("p", {
|
|
2338
2381
|
className: "problem-statement",
|
|
@@ -2358,7 +2401,7 @@ function cn(e, t, n, r, i) {
|
|
|
2358
2401
|
children: e.situation
|
|
2359
2402
|
}), /* @__PURE__ */ o("div", {
|
|
2360
2403
|
className: "word-problem__parts",
|
|
2361
|
-
children: e.parts.map((a, s) => /* @__PURE__ */ o(
|
|
2404
|
+
children: e.parts.map((a, s) => /* @__PURE__ */ o(Dn, {
|
|
2362
2405
|
adapters: i,
|
|
2363
2406
|
clearAnswer: r,
|
|
2364
2407
|
getAnswer: t,
|
|
@@ -2369,25 +2412,25 @@ function cn(e, t, n, r, i) {
|
|
|
2369
2412
|
}, a.id))
|
|
2370
2413
|
})]
|
|
2371
2414
|
});
|
|
2372
|
-
case "drag-match": return /* @__PURE__ */ o(
|
|
2415
|
+
case "drag-match": return /* @__PURE__ */ o(Ve, {
|
|
2373
2416
|
items: e.items,
|
|
2374
2417
|
onChange: (t) => n(e.id, t),
|
|
2375
2418
|
targets: e.targets,
|
|
2376
|
-
value:
|
|
2419
|
+
value: xn(t(e.id))
|
|
2377
2420
|
});
|
|
2378
|
-
case "sortable-answer": return /* @__PURE__ */ o(
|
|
2421
|
+
case "sortable-answer": return /* @__PURE__ */ o(en, {
|
|
2379
2422
|
answerId: e.id,
|
|
2380
2423
|
items: e.items,
|
|
2381
2424
|
onChange: (t) => n(e.id, t),
|
|
2382
|
-
value:
|
|
2425
|
+
value: Sn(t(e.id))
|
|
2383
2426
|
});
|
|
2384
|
-
case "label-placement": return /* @__PURE__ */ o(
|
|
2427
|
+
case "label-placement": return /* @__PURE__ */ o(Pt, {
|
|
2385
2428
|
labels: e.labels,
|
|
2386
2429
|
onChange: (t) => n(e.id, t),
|
|
2387
2430
|
targets: e.targets,
|
|
2388
|
-
value:
|
|
2431
|
+
value: Cn(t(e.id))
|
|
2389
2432
|
});
|
|
2390
|
-
case "audio-recording": return /* @__PURE__ */ o(
|
|
2433
|
+
case "audio-recording": return /* @__PURE__ */ o(Kt, {
|
|
2391
2434
|
acceptedPronunciations: e.acceptedPronunciations,
|
|
2392
2435
|
expectedText: e.expectedAnswer,
|
|
2393
2436
|
imageAlt: e.imageAlt,
|
|
@@ -2398,11 +2441,11 @@ function cn(e, t, n, r, i) {
|
|
|
2398
2441
|
onChange: (t) => n(e.id, t),
|
|
2399
2442
|
onReset: () => r(e.id),
|
|
2400
2443
|
recorder: i?.audioRecorder,
|
|
2401
|
-
value:
|
|
2444
|
+
value: En(t(e.id))
|
|
2402
2445
|
});
|
|
2403
2446
|
}
|
|
2404
2447
|
}
|
|
2405
|
-
function
|
|
2448
|
+
function vn({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswer: a, item: c, questionId: l, updateAnswer: u }) {
|
|
2406
2449
|
if (c.answers?.length) return /* @__PURE__ */ s("div", {
|
|
2407
2450
|
className: r,
|
|
2408
2451
|
children: [c.answers.map((r) => {
|
|
@@ -2436,44 +2479,44 @@ function ln({ adapters: t, ariaPrefix: n, className: r, clearAnswer: i, getAnswe
|
|
|
2436
2479
|
]
|
|
2437
2480
|
}, c.id);
|
|
2438
2481
|
}
|
|
2439
|
-
function
|
|
2482
|
+
function yn(e) {
|
|
2440
2483
|
return e?.kind === "text" ? e : void 0;
|
|
2441
2484
|
}
|
|
2442
2485
|
function Q(e) {
|
|
2443
2486
|
return e?.kind === "handwritten-number" ? e : void 0;
|
|
2444
2487
|
}
|
|
2445
|
-
function
|
|
2488
|
+
function bn(e) {
|
|
2446
2489
|
return e?.kind === "choice" ? e : void 0;
|
|
2447
2490
|
}
|
|
2448
|
-
function
|
|
2491
|
+
function xn(e) {
|
|
2449
2492
|
return e?.kind === "matches" ? e : void 0;
|
|
2450
2493
|
}
|
|
2451
|
-
function
|
|
2494
|
+
function Sn(e) {
|
|
2452
2495
|
return e?.kind === "order" ? e : void 0;
|
|
2453
2496
|
}
|
|
2454
|
-
function
|
|
2497
|
+
function Cn(e) {
|
|
2455
2498
|
return e?.kind === "placements" ? e : void 0;
|
|
2456
2499
|
}
|
|
2457
|
-
function
|
|
2500
|
+
function wn(e) {
|
|
2458
2501
|
return e?.kind === "drawing" ? e : void 0;
|
|
2459
2502
|
}
|
|
2460
|
-
function
|
|
2503
|
+
function Tn(e) {
|
|
2461
2504
|
return e?.kind === "coin-table" ? e : void 0;
|
|
2462
2505
|
}
|
|
2463
|
-
function
|
|
2506
|
+
function En(e) {
|
|
2464
2507
|
return e?.kind === "audio-recording" ? e : void 0;
|
|
2465
2508
|
}
|
|
2466
|
-
function
|
|
2509
|
+
function Dn({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, part: i, partNumber: a, updateAnswer: c }) {
|
|
2467
2510
|
let l = `${r}:${i.id}`;
|
|
2468
2511
|
return /* @__PURE__ */ s("section", {
|
|
2469
2512
|
className: "word-problem-part",
|
|
2470
2513
|
children: [/* @__PURE__ */ s("div", {
|
|
2471
2514
|
className: "word-problem-part__prompt",
|
|
2472
2515
|
children: [/* @__PURE__ */ o("span", { children: a }), /* @__PURE__ */ o("strong", { children: i.prompt })]
|
|
2473
|
-
}), i.type === "coin-table" ? /* @__PURE__ */ o(
|
|
2516
|
+
}), i.type === "coin-table" ? /* @__PURE__ */ o(Fe, {
|
|
2474
2517
|
columns: i.columns,
|
|
2475
2518
|
onChange: (e) => c(l, e),
|
|
2476
|
-
value:
|
|
2519
|
+
value: Tn(n(l))
|
|
2477
2520
|
}) : /* @__PURE__ */ s("div", {
|
|
2478
2521
|
className: "sentence-answer word-problem-part__sentence",
|
|
2479
2522
|
children: [
|
|
@@ -2490,12 +2533,12 @@ function vn({ adapters: e, clearAnswer: t, getAnswer: n, parentQuestionId: r, pa
|
|
|
2490
2533
|
})]
|
|
2491
2534
|
});
|
|
2492
2535
|
}
|
|
2493
|
-
function
|
|
2536
|
+
function On(e) {
|
|
2494
2537
|
return e === "triangle" ? "△" : e === "square" ? "□" : e === "rectangle" ? "▭" : e;
|
|
2495
2538
|
}
|
|
2496
|
-
var
|
|
2497
|
-
function
|
|
2498
|
-
let u = r(null), d = r(null), f = r(null), p = r({}), m = r(null), h = c?.pairs[
|
|
2539
|
+
var kn = "picture";
|
|
2540
|
+
function An({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
|
|
2541
|
+
let u = r(null), d = r(null), f = r(null), p = r({}), m = r(null), h = c?.pairs[kn], [g, _] = i(null), [v, y] = i(null);
|
|
2499
2542
|
function b(e, t) {
|
|
2500
2543
|
let n = d.current;
|
|
2501
2544
|
if (n) {
|
|
@@ -2570,7 +2613,7 @@ function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
|
|
|
2570
2613
|
let r = T(e.clientX, e.clientY);
|
|
2571
2614
|
r && n({
|
|
2572
2615
|
kind: "matches",
|
|
2573
|
-
pairs: { [
|
|
2616
|
+
pairs: { [kn]: r }
|
|
2574
2617
|
}), m.current = null, y(null);
|
|
2575
2618
|
}
|
|
2576
2619
|
function w(e, t, n) {
|
|
@@ -2605,7 +2648,7 @@ function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
|
|
|
2605
2648
|
}),
|
|
2606
2649
|
/* @__PURE__ */ s("div", {
|
|
2607
2650
|
className: "visual-match-picture",
|
|
2608
|
-
children: [/* @__PURE__ */ o(
|
|
2651
|
+
children: [/* @__PURE__ */ o(fn, { scene: a ?? un(l) }), /* @__PURE__ */ o("button", {
|
|
2609
2652
|
"aria-label": "اربط الصورة بالإجابة",
|
|
2610
2653
|
className: h ? "visual-match-point visual-match-point--target visual-match-point--target-active" : "visual-match-point visual-match-point--target",
|
|
2611
2654
|
onPointerCancel: C,
|
|
@@ -2637,8 +2680,8 @@ function xn({ choices: e, onChange: n, scene: a, value: c, visual: l }) {
|
|
|
2637
2680
|
]
|
|
2638
2681
|
});
|
|
2639
2682
|
}
|
|
2640
|
-
function
|
|
2641
|
-
let l = Math.max(...a.map((e) => e.squareLength)) + 2, u =
|
|
2683
|
+
function jn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }) {
|
|
2684
|
+
let l = Math.max(...a.map((e) => e.squareLength)) + 2, u = Qe(t), [d, f] = i(null), [p, m] = i(!1), [h, g] = i({}), _ = r(null);
|
|
2642
2685
|
function v(e, t, n) {
|
|
2643
2686
|
let r = d;
|
|
2644
2687
|
r && g((i) => {
|
|
@@ -2680,7 +2723,7 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
|
|
|
2680
2723
|
"data-coloring": p ? "true" : "false",
|
|
2681
2724
|
onPointerCancel: () => x(),
|
|
2682
2725
|
onPointerUp: () => x(),
|
|
2683
|
-
children: [/* @__PURE__ */ o(
|
|
2726
|
+
children: [/* @__PURE__ */ o(Je, {
|
|
2684
2727
|
ariaLabel: "ألوان الأقلام",
|
|
2685
2728
|
className: "length-color-picker",
|
|
2686
2729
|
colors: u,
|
|
@@ -2689,7 +2732,7 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
|
|
|
2689
2732
|
}), /* @__PURE__ */ o("div", {
|
|
2690
2733
|
className: "length-card-row",
|
|
2691
2734
|
children: a.map((t) => {
|
|
2692
|
-
let r = `${e}:squares:${t.id}`, i = `${e}:color:${t.id}`, a =
|
|
2735
|
+
let r = `${e}:squares:${t.id}`, i = `${e}:color:${t.id}`, a = bn(n(i)), d = h[t.id], f = d?.colorId ?? a?.choiceId, p = d?.fill ?? +!!a?.choiceId, m = f ? Ze(u, f) : "#9aa3a8", g = `${16 + Math.min(p, 1) * 68}%`;
|
|
2693
2736
|
return /* @__PURE__ */ s("div", {
|
|
2694
2737
|
className: "length-card",
|
|
2695
2738
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -2724,11 +2767,11 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
|
|
|
2724
2767
|
className: "length-value-row",
|
|
2725
2768
|
children: [
|
|
2726
2769
|
/* @__PURE__ */ o("span", { children: t.label }),
|
|
2727
|
-
/* @__PURE__ */ o(
|
|
2770
|
+
/* @__PURE__ */ o(nn, {
|
|
2728
2771
|
ariaLabel: `طول ${t.label} بالمربعات`,
|
|
2729
2772
|
inputMode: "numeric",
|
|
2730
2773
|
onChange: (e) => c(r, e),
|
|
2731
|
-
value:
|
|
2774
|
+
value: yn(n(r))
|
|
2732
2775
|
}),
|
|
2733
2776
|
/* @__PURE__ */ o("span", { children: "مربعات" })
|
|
2734
2777
|
]
|
|
@@ -2740,7 +2783,7 @@ function Sn({ answerId: e, choices: t, getAnswer: n, items: a, updateAnswer: c }
|
|
|
2740
2783
|
}
|
|
2741
2784
|
//#endregion
|
|
2742
2785
|
//#region src/renderer/QuestionPreviewPanel.tsx
|
|
2743
|
-
function
|
|
2786
|
+
function Mn({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
|
|
2744
2787
|
let [a, s] = i({}), c = t ?? a;
|
|
2745
2788
|
function l(e) {
|
|
2746
2789
|
if (t !== void 0) {
|
|
@@ -2763,7 +2806,7 @@ function Cn({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
|
|
|
2763
2806
|
}
|
|
2764
2807
|
return /* @__PURE__ */ o("div", {
|
|
2765
2808
|
className: "exam-renderer-preview",
|
|
2766
|
-
children: /* @__PURE__ */ o(
|
|
2809
|
+
children: /* @__PURE__ */ o(mn, {
|
|
2767
2810
|
adapters: e,
|
|
2768
2811
|
clearAnswer: d,
|
|
2769
2812
|
getAnswer: (e) => c[e],
|
|
@@ -2774,7 +2817,7 @@ function Cn({ adapters: e, answers: t, onAnswersChange: n, question: r }) {
|
|
|
2774
2817
|
}
|
|
2775
2818
|
//#endregion
|
|
2776
2819
|
//#region src/renderer/PrintableExamDocument.tsx
|
|
2777
|
-
var
|
|
2820
|
+
var Nn = {
|
|
2778
2821
|
ariaLabel: "معلومات المؤسسة",
|
|
2779
2822
|
logoAlt: "شعار المملكة المغربية",
|
|
2780
2823
|
logoSrc: "/logo/morocco-logo.png",
|
|
@@ -2785,45 +2828,39 @@ var wn = {
|
|
|
2785
2828
|
"المديرية الإقليمية"
|
|
2786
2829
|
]
|
|
2787
2830
|
};
|
|
2788
|
-
function
|
|
2789
|
-
let r =
|
|
2831
|
+
function Pn({ exam: e, locale: t = "fr", variant: n }) {
|
|
2832
|
+
let r = nr(t), i = Vn(e);
|
|
2790
2833
|
return /* @__PURE__ */ s("article", {
|
|
2791
2834
|
className: `printable-exam printable-exam--${n}`,
|
|
2792
|
-
dir:
|
|
2835
|
+
dir: tr(t) ? "rtl" : "ltr",
|
|
2793
2836
|
children: [/* @__PURE__ */ s("div", {
|
|
2794
2837
|
className: "printable-exam__top",
|
|
2795
|
-
children: [/* @__PURE__ */
|
|
2838
|
+
children: [/* @__PURE__ */ s("header", {
|
|
2796
2839
|
className: "printable-exam__header",
|
|
2797
2840
|
children: [/* @__PURE__ */ s("div", {
|
|
2798
2841
|
className: "printable-exam__title-row",
|
|
2799
|
-
children: [/* @__PURE__ */
|
|
2800
|
-
className: "printable-exam__eyebrow",
|
|
2801
|
-
children: e.subject
|
|
2802
|
-
}), /* @__PURE__ */ o("h1", { children: e.title })] }), /* @__PURE__ */ o(jn, {
|
|
2803
|
-
noteLabel: r.obtainedNote,
|
|
2804
|
-
totalPoints: i
|
|
2805
|
-
})]
|
|
2842
|
+
children: [/* @__PURE__ */ o(Bn, { totalPoints: i }), /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o("h1", { children: e.title }) })]
|
|
2806
2843
|
}), /* @__PURE__ */ s("div", {
|
|
2807
2844
|
className: "printable-exam__meta",
|
|
2808
2845
|
children: [
|
|
2809
|
-
/* @__PURE__ */ o(
|
|
2846
|
+
/* @__PURE__ */ o(zn, {
|
|
2810
2847
|
label: r.duration,
|
|
2811
2848
|
value: e.timer
|
|
2812
2849
|
}),
|
|
2813
|
-
/* @__PURE__ */ o(
|
|
2850
|
+
/* @__PURE__ */ o(zn, {
|
|
2814
2851
|
label: r.level,
|
|
2815
2852
|
value: e.level
|
|
2816
2853
|
}),
|
|
2817
|
-
/* @__PURE__ */ o(
|
|
2818
|
-
label:
|
|
2854
|
+
/* @__PURE__ */ o(zn, {
|
|
2855
|
+
label: tr(t) ? "المادة" : r.subject ?? "Matiere",
|
|
2819
2856
|
value: e.subject
|
|
2820
2857
|
})
|
|
2821
2858
|
]
|
|
2822
2859
|
})]
|
|
2823
|
-
})]
|
|
2860
|
+
}), /* @__PURE__ */ o(Fn, {})]
|
|
2824
2861
|
}), /* @__PURE__ */ o("div", {
|
|
2825
2862
|
className: "printable-exam__sections",
|
|
2826
|
-
children: e.sections.map((e) => /* @__PURE__ */ o(
|
|
2863
|
+
children: e.sections.map((e) => /* @__PURE__ */ o(In, {
|
|
2827
2864
|
locale: t,
|
|
2828
2865
|
section: e,
|
|
2829
2866
|
variant: n
|
|
@@ -2831,39 +2868,36 @@ function Tn({ exam: e, locale: t = "fr", variant: n }) {
|
|
|
2831
2868
|
})]
|
|
2832
2869
|
});
|
|
2833
2870
|
}
|
|
2834
|
-
function
|
|
2871
|
+
function Fn() {
|
|
2835
2872
|
return /* @__PURE__ */ s("section", {
|
|
2836
|
-
"aria-label":
|
|
2873
|
+
"aria-label": Nn.ariaLabel,
|
|
2837
2874
|
className: "printable-institution-header",
|
|
2838
2875
|
dir: "rtl",
|
|
2839
2876
|
children: [
|
|
2840
2877
|
/* @__PURE__ */ o("img", {
|
|
2841
|
-
alt:
|
|
2878
|
+
alt: Nn.logoAlt,
|
|
2842
2879
|
className: "printable-institution-header__logo",
|
|
2843
|
-
src:
|
|
2880
|
+
src: Nn.logoSrc
|
|
2844
2881
|
}),
|
|
2845
|
-
/* @__PURE__ */ o("h1", { children:
|
|
2846
|
-
|
|
2882
|
+
/* @__PURE__ */ o("h1", { children: Nn.title }),
|
|
2883
|
+
Nn.lines.map((e) => /* @__PURE__ */ o("p", { children: e }, e))
|
|
2847
2884
|
]
|
|
2848
2885
|
});
|
|
2849
2886
|
}
|
|
2850
|
-
function
|
|
2851
|
-
let r =
|
|
2887
|
+
function In({ locale: e = "fr", section: t, variant: n }) {
|
|
2888
|
+
let r = nr(e);
|
|
2852
2889
|
return /* @__PURE__ */ s("section", {
|
|
2853
2890
|
className: `printable-section printable-section--${t.tone}`,
|
|
2854
2891
|
"data-variant": n,
|
|
2855
2892
|
children: [/* @__PURE__ */ s("header", {
|
|
2856
2893
|
className: "printable-section__header",
|
|
2857
2894
|
children: [
|
|
2858
|
-
/* @__PURE__ */
|
|
2895
|
+
/* @__PURE__ */ o("div", {
|
|
2859
2896
|
className: "printable-section__score",
|
|
2860
|
-
children:
|
|
2861
|
-
className: "printable-section__points",
|
|
2862
|
-
children: t.points
|
|
2863
|
-
}), /* @__PURE__ */ s("span", {
|
|
2897
|
+
children: /* @__PURE__ */ s("span", {
|
|
2864
2898
|
className: "printable-section__obtained",
|
|
2865
|
-
children: [/* @__PURE__ */
|
|
2866
|
-
})
|
|
2899
|
+
children: [/* @__PURE__ */ s("strong", { children: [/* @__PURE__ */ o("i", { "aria-hidden": "true" }), /* @__PURE__ */ s("b", { children: ["/ ", R(t)] })] }), /* @__PURE__ */ o("small", { children: r.obtainedNote })]
|
|
2900
|
+
})
|
|
2867
2901
|
}),
|
|
2868
2902
|
/* @__PURE__ */ o("h2", { children: t.title }),
|
|
2869
2903
|
/* @__PURE__ */ o("span", {
|
|
@@ -2873,7 +2907,7 @@ function Dn({ locale: e = "fr", section: t, variant: n }) {
|
|
|
2873
2907
|
]
|
|
2874
2908
|
}), /* @__PURE__ */ o("div", {
|
|
2875
2909
|
className: "printable-section__body",
|
|
2876
|
-
children: t.questions.map((t) => /* @__PURE__ */ o(
|
|
2910
|
+
children: t.questions.map((t) => /* @__PURE__ */ o(Ln, {
|
|
2877
2911
|
locale: e,
|
|
2878
2912
|
question: t,
|
|
2879
2913
|
variant: n
|
|
@@ -2881,41 +2915,55 @@ function Dn({ locale: e = "fr", section: t, variant: n }) {
|
|
|
2881
2915
|
})]
|
|
2882
2916
|
});
|
|
2883
2917
|
}
|
|
2884
|
-
function
|
|
2885
|
-
let r =
|
|
2918
|
+
function Ln({ locale: e = "fr", question: t, variant: n }) {
|
|
2919
|
+
let r = nr(e), i = ae(t), a = i > 0 ? I(i) : "";
|
|
2886
2920
|
return /* @__PURE__ */ s("article", {
|
|
2887
2921
|
className: `printable-question printable-question--${t.type}`,
|
|
2888
|
-
children: [/* @__PURE__ */
|
|
2922
|
+
children: [/* @__PURE__ */ o("div", {
|
|
2889
2923
|
className: "printable-question__prompt",
|
|
2890
|
-
children:
|
|
2891
|
-
className: "printable-
|
|
2892
|
-
children:
|
|
2893
|
-
|
|
2894
|
-
|
|
2924
|
+
children: /* @__PURE__ */ s("div", {
|
|
2925
|
+
className: "printable-question__prompt-text",
|
|
2926
|
+
children: [
|
|
2927
|
+
t.number > 0 ? /* @__PURE__ */ o("span", {
|
|
2928
|
+
className: "printable-question__number",
|
|
2929
|
+
children: t.number
|
|
2930
|
+
}) : null,
|
|
2931
|
+
/* @__PURE__ */ o("strong", { children: t.prompt }),
|
|
2932
|
+
a ? /* @__PURE__ */ s("span", {
|
|
2933
|
+
className: "printable-question__score-inline",
|
|
2934
|
+
children: [
|
|
2935
|
+
"(",
|
|
2936
|
+
a,
|
|
2937
|
+
"pts)"
|
|
2938
|
+
]
|
|
2939
|
+
}) : null
|
|
2940
|
+
]
|
|
2941
|
+
})
|
|
2942
|
+
}), Rn(t, n, r, e)]
|
|
2895
2943
|
});
|
|
2896
2944
|
}
|
|
2897
|
-
function
|
|
2945
|
+
function Rn(e, t, n, r) {
|
|
2898
2946
|
switch (e.type) {
|
|
2899
2947
|
case "inline-inputs":
|
|
2900
2948
|
case "equation-inputs": return /* @__PURE__ */ o("div", {
|
|
2901
2949
|
className: "printable-equation-grid",
|
|
2902
2950
|
children: e.items.map((e) => /* @__PURE__ */ o("div", {
|
|
2903
2951
|
className: "printable-equation-card",
|
|
2904
|
-
children: /* @__PURE__ */ o(
|
|
2952
|
+
children: /* @__PURE__ */ o($n, { item: e })
|
|
2905
2953
|
}, e.id))
|
|
2906
2954
|
});
|
|
2907
2955
|
case "number-line": return /* @__PURE__ */ s("div", {
|
|
2908
2956
|
className: "printable-number-line-layout",
|
|
2909
2957
|
children: [/* @__PURE__ */ s("div", {
|
|
2910
2958
|
className: "printable-number-line-expression",
|
|
2911
|
-
children: [/* @__PURE__ */ o("span", { children: e.expression }), /* @__PURE__ */ o(
|
|
2912
|
-
}), /* @__PURE__ */ o(
|
|
2959
|
+
children: [/* @__PURE__ */ o("span", { children: e.expression }), /* @__PURE__ */ o(er, {})]
|
|
2960
|
+
}), /* @__PURE__ */ o(Xn, {})]
|
|
2913
2961
|
});
|
|
2914
2962
|
case "visual-choice": return /* @__PURE__ */ s("div", {
|
|
2915
2963
|
className: "printable-visual-match",
|
|
2916
|
-
children: [/* @__PURE__ */ o(
|
|
2964
|
+
children: [/* @__PURE__ */ o(Un, {
|
|
2917
2965
|
choices: e.choices,
|
|
2918
|
-
scene: e.scene ??
|
|
2966
|
+
scene: e.scene ?? un(e.visual)
|
|
2919
2967
|
}), e.inputLabel ? /* @__PURE__ */ s("div", {
|
|
2920
2968
|
className: "printable-inline-answer",
|
|
2921
2969
|
children: [/* @__PURE__ */ o("span", { children: e.inputLabel }), /* @__PURE__ */ o($, {})]
|
|
@@ -2925,9 +2973,9 @@ function kn(e, t, n, r) {
|
|
|
2925
2973
|
className: "printable-length-task",
|
|
2926
2974
|
children: /* @__PURE__ */ o("div", {
|
|
2927
2975
|
className: "printable-length-list",
|
|
2928
|
-
children: e.items.map((e) => /* @__PURE__ */ o(
|
|
2976
|
+
children: e.items.map((e) => /* @__PURE__ */ o(Zn, {
|
|
2929
2977
|
item: e,
|
|
2930
|
-
squareUnit:
|
|
2978
|
+
squareUnit: tr(r) ? "مربعات" : "carres",
|
|
2931
2979
|
variant: t
|
|
2932
2980
|
}, e.id))
|
|
2933
2981
|
})
|
|
@@ -2939,7 +2987,7 @@ function kn(e, t, n, r) {
|
|
|
2939
2987
|
className: "printable-shape-bank",
|
|
2940
2988
|
children: e.choices.map((e) => /* @__PURE__ */ o("div", {
|
|
2941
2989
|
className: "printable-shape-card",
|
|
2942
|
-
children: /* @__PURE__ */ o(
|
|
2990
|
+
children: /* @__PURE__ */ o(Be, { shapeId: e.id })
|
|
2943
2991
|
}, e.id))
|
|
2944
2992
|
}),
|
|
2945
2993
|
/* @__PURE__ */ o("div", {
|
|
@@ -2949,12 +2997,12 @@ function kn(e, t, n, r) {
|
|
|
2949
2997
|
children: [/* @__PURE__ */ s("span", { children: [t + 1, "."] }), /* @__PURE__ */ o("strong", { children: e.label })]
|
|
2950
2998
|
}, e.id))
|
|
2951
2999
|
}),
|
|
2952
|
-
/* @__PURE__ */ o(
|
|
3000
|
+
/* @__PURE__ */ o(Hn, { label: n.dragArea })
|
|
2953
3001
|
]
|
|
2954
3002
|
});
|
|
2955
3003
|
case "drawing-grid": return /* @__PURE__ */ o("div", {
|
|
2956
3004
|
className: "printable-drawing-block",
|
|
2957
|
-
children: /* @__PURE__ */ o(
|
|
3005
|
+
children: /* @__PURE__ */ o(Yn, { points: e.points })
|
|
2958
3006
|
});
|
|
2959
3007
|
case "table-response": return /* @__PURE__ */ o("div", {
|
|
2960
3008
|
className: "printable-table-response",
|
|
@@ -2988,13 +3036,13 @@ function kn(e, t, n, r) {
|
|
|
2988
3036
|
children: e.situation
|
|
2989
3037
|
}), /* @__PURE__ */ o("div", {
|
|
2990
3038
|
className: "printable-word-problem__parts",
|
|
2991
|
-
children: e.parts.map((e, t) => /* @__PURE__ */ o(
|
|
3039
|
+
children: e.parts.map((e, t) => /* @__PURE__ */ o(Qn, {
|
|
2992
3040
|
part: e,
|
|
2993
3041
|
partNumber: t + 1
|
|
2994
3042
|
}, e.id))
|
|
2995
3043
|
})]
|
|
2996
3044
|
});
|
|
2997
|
-
case "drag-match": return /* @__PURE__ */ o(
|
|
3045
|
+
case "drag-match": return /* @__PURE__ */ o(Gn, {
|
|
2998
3046
|
items: e.items,
|
|
2999
3047
|
targets: e.targets
|
|
3000
3048
|
});
|
|
@@ -3017,7 +3065,7 @@ function kn(e, t, n, r) {
|
|
|
3017
3065
|
case "label-placement": return /* @__PURE__ */ s("div", {
|
|
3018
3066
|
className: "printable-label-placement",
|
|
3019
3067
|
children: [
|
|
3020
|
-
/* @__PURE__ */ o(
|
|
3068
|
+
/* @__PURE__ */ o(Jn, { targets: e.targets }),
|
|
3021
3069
|
/* @__PURE__ */ o("div", {
|
|
3022
3070
|
className: "printable-placement-labels",
|
|
3023
3071
|
children: e.labels.map((e) => /* @__PURE__ */ o("span", {
|
|
@@ -3025,7 +3073,7 @@ function kn(e, t, n, r) {
|
|
|
3025
3073
|
children: /* @__PURE__ */ o("strong", { children: e.label })
|
|
3026
3074
|
}, e.id))
|
|
3027
3075
|
}),
|
|
3028
|
-
/* @__PURE__ */ o(
|
|
3076
|
+
/* @__PURE__ */ o(Hn, { label: n.placeLabels })
|
|
3029
3077
|
]
|
|
3030
3078
|
});
|
|
3031
3079
|
case "audio-recording": return /* @__PURE__ */ s("div", {
|
|
@@ -3050,49 +3098,49 @@ function kn(e, t, n, r) {
|
|
|
3050
3098
|
});
|
|
3051
3099
|
}
|
|
3052
3100
|
}
|
|
3053
|
-
function
|
|
3101
|
+
function zn({ label: e, value: t }) {
|
|
3054
3102
|
return /* @__PURE__ */ s("div", {
|
|
3055
3103
|
className: "printable-meta-pill",
|
|
3056
3104
|
children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ o("strong", { children: t })]
|
|
3057
3105
|
});
|
|
3058
3106
|
}
|
|
3059
|
-
function
|
|
3060
|
-
return /* @__PURE__ */
|
|
3107
|
+
function Bn({ totalPoints: e }) {
|
|
3108
|
+
return /* @__PURE__ */ o("div", {
|
|
3061
3109
|
className: "printable-note-box",
|
|
3062
|
-
children:
|
|
3110
|
+
children: /* @__PURE__ */ s("strong", { children: [/* @__PURE__ */ o("i", { "aria-hidden": "true" }), /* @__PURE__ */ s("b", { children: ["/ ", e] })] })
|
|
3063
3111
|
});
|
|
3064
3112
|
}
|
|
3065
|
-
function
|
|
3066
|
-
let t = e.sections.filter((e) => e.isScored !== !1).map((e) =>
|
|
3113
|
+
function Vn(e) {
|
|
3114
|
+
let t = e.sections.filter((e) => e.isScored !== !1).map((e) => L(e)).filter((e) => Number.isFinite(e));
|
|
3067
3115
|
if (t.length === 0) return "";
|
|
3068
3116
|
let n = t.reduce((e, t) => e + t, 0);
|
|
3069
3117
|
return String(Number.isInteger(n) ? n : Number(n.toFixed(2)));
|
|
3070
3118
|
}
|
|
3071
|
-
function
|
|
3119
|
+
function Hn({ label: e }) {
|
|
3072
3120
|
return /* @__PURE__ */ s("div", {
|
|
3073
3121
|
className: "printable-hint-line",
|
|
3074
3122
|
children: [/* @__PURE__ */ o("span", { children: e }), /* @__PURE__ */ o($, {})]
|
|
3075
3123
|
});
|
|
3076
3124
|
}
|
|
3077
|
-
function
|
|
3125
|
+
function Un({ choices: e, scene: t }) {
|
|
3078
3126
|
return /* @__PURE__ */ o("div", {
|
|
3079
3127
|
className: "printable-visual-match__preview",
|
|
3080
3128
|
children: /* @__PURE__ */ s("div", {
|
|
3081
3129
|
className: "visual-line-match printable-visual-line-match",
|
|
3082
3130
|
children: [/* @__PURE__ */ s("div", {
|
|
3083
3131
|
className: "visual-match-picture printable-visual-match-picture",
|
|
3084
|
-
children: [/* @__PURE__ */ o(
|
|
3132
|
+
children: [/* @__PURE__ */ o(fn, { scene: t }), /* @__PURE__ */ o("span", {
|
|
3085
3133
|
"aria-hidden": "true",
|
|
3086
3134
|
className: "visual-match-point visual-match-point--target printable-match-point printable-match-point--target"
|
|
3087
3135
|
})]
|
|
3088
3136
|
}), /* @__PURE__ */ o("div", {
|
|
3089
3137
|
className: "visual-line-match__answers printable-visual-line-match__answers",
|
|
3090
|
-
children: e.map((e) => /* @__PURE__ */ o(
|
|
3138
|
+
children: e.map((e) => /* @__PURE__ */ o(Wn, { choice: e }, e.id))
|
|
3091
3139
|
})]
|
|
3092
3140
|
})
|
|
3093
3141
|
});
|
|
3094
3142
|
}
|
|
3095
|
-
function
|
|
3143
|
+
function Wn({ choice: e }) {
|
|
3096
3144
|
return /* @__PURE__ */ s("div", {
|
|
3097
3145
|
className: "visual-match-answer printable-visual-match-answer",
|
|
3098
3146
|
children: [/* @__PURE__ */ o("span", {
|
|
@@ -3104,71 +3152,49 @@ function Fn({ choice: e }) {
|
|
|
3104
3152
|
})]
|
|
3105
3153
|
});
|
|
3106
3154
|
}
|
|
3107
|
-
function
|
|
3155
|
+
function Gn({ items: e, targets: t }) {
|
|
3108
3156
|
return /* @__PURE__ */ s("div", {
|
|
3109
3157
|
className: "printable-drag-match-board",
|
|
3110
|
-
children: [
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
/* @__PURE__ */ o(
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
/* @__PURE__ */ o("div", {
|
|
3124
|
-
className: "printable-drag-match-column printable-drag-match-column--answers",
|
|
3125
|
-
children: e.map((e, t) => /* @__PURE__ */ o(Rn, {
|
|
3126
|
-
index: t,
|
|
3127
|
-
item: e
|
|
3128
|
-
}, e.id))
|
|
3129
|
-
})
|
|
3130
|
-
]
|
|
3158
|
+
children: [/* @__PURE__ */ o("div", {
|
|
3159
|
+
className: "printable-drag-match-row printable-drag-match-row--answers",
|
|
3160
|
+
children: e.map((e, t) => /* @__PURE__ */ o(qn, {
|
|
3161
|
+
index: t,
|
|
3162
|
+
item: e
|
|
3163
|
+
}, e.id))
|
|
3164
|
+
}), /* @__PURE__ */ o("div", {
|
|
3165
|
+
className: "printable-drag-match-row printable-drag-match-row--targets",
|
|
3166
|
+
children: t.map((e, t) => /* @__PURE__ */ o(Kn, {
|
|
3167
|
+
index: t,
|
|
3168
|
+
target: e
|
|
3169
|
+
}, e.id))
|
|
3170
|
+
})]
|
|
3131
3171
|
});
|
|
3132
3172
|
}
|
|
3133
|
-
function
|
|
3173
|
+
function Kn({ index: e, target: t }) {
|
|
3134
3174
|
return /* @__PURE__ */ s("div", {
|
|
3135
3175
|
className: "printable-drag-match-card printable-drag-match-card--target",
|
|
3136
|
-
children: [
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
/* @__PURE__ */ o("
|
|
3142
|
-
|
|
3143
|
-
children: t.shapeId ? /* @__PURE__ */ o(Me, { shapeId: t.shapeId }) : /* @__PURE__ */ o("strong", { children: t.label })
|
|
3144
|
-
}),
|
|
3145
|
-
/* @__PURE__ */ o("span", {
|
|
3146
|
-
"aria-hidden": "true",
|
|
3147
|
-
className: "printable-match-point printable-drag-match-dot printable-drag-match-dot--target"
|
|
3148
|
-
})
|
|
3149
|
-
]
|
|
3176
|
+
children: [/* @__PURE__ */ o("span", {
|
|
3177
|
+
className: "printable-drag-match-index",
|
|
3178
|
+
children: String.fromCharCode(65 + e)
|
|
3179
|
+
}), /* @__PURE__ */ o("div", {
|
|
3180
|
+
className: "printable-drag-match-content",
|
|
3181
|
+
children: t.shapeId ? /* @__PURE__ */ o(Be, { shapeId: t.shapeId }) : /* @__PURE__ */ o("strong", { children: t.label })
|
|
3182
|
+
})]
|
|
3150
3183
|
});
|
|
3151
3184
|
}
|
|
3152
|
-
function
|
|
3185
|
+
function qn({ index: e, item: t }) {
|
|
3153
3186
|
return /* @__PURE__ */ s("div", {
|
|
3154
3187
|
className: "printable-drag-match-card printable-drag-match-card--answer",
|
|
3155
|
-
children: [
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
children: /* @__PURE__ */ o("strong", { children: t.label })
|
|
3163
|
-
}),
|
|
3164
|
-
/* @__PURE__ */ o("span", {
|
|
3165
|
-
className: "printable-drag-match-index",
|
|
3166
|
-
children: e + 1
|
|
3167
|
-
})
|
|
3168
|
-
]
|
|
3188
|
+
children: [/* @__PURE__ */ o("div", {
|
|
3189
|
+
className: "printable-drag-match-content",
|
|
3190
|
+
children: /* @__PURE__ */ o("strong", { children: t.label })
|
|
3191
|
+
}), /* @__PURE__ */ o("span", {
|
|
3192
|
+
className: "printable-drag-match-index",
|
|
3193
|
+
children: e + 1
|
|
3194
|
+
})]
|
|
3169
3195
|
});
|
|
3170
3196
|
}
|
|
3171
|
-
function
|
|
3197
|
+
function Jn({ targets: e }) {
|
|
3172
3198
|
return /* @__PURE__ */ o("div", {
|
|
3173
3199
|
className: "printable-placement-board",
|
|
3174
3200
|
children: e.map((e, t) => /* @__PURE__ */ o("div", {
|
|
@@ -3181,7 +3207,7 @@ function zn({ targets: e }) {
|
|
|
3181
3207
|
}, e.id))
|
|
3182
3208
|
});
|
|
3183
3209
|
}
|
|
3184
|
-
function
|
|
3210
|
+
function Yn({ points: e }) {
|
|
3185
3211
|
return /* @__PURE__ */ s("svg", {
|
|
3186
3212
|
className: "printable-drawing-grid",
|
|
3187
3213
|
viewBox: "0 0 1000 420",
|
|
@@ -3212,7 +3238,7 @@ function Bn({ points: e }) {
|
|
|
3212
3238
|
]
|
|
3213
3239
|
});
|
|
3214
3240
|
}
|
|
3215
|
-
function
|
|
3241
|
+
function Xn() {
|
|
3216
3242
|
return /* @__PURE__ */ s("svg", {
|
|
3217
3243
|
className: "printable-number-line",
|
|
3218
3244
|
viewBox: "0 0 420 90",
|
|
@@ -3236,7 +3262,7 @@ function Vn() {
|
|
|
3236
3262
|
}, t))]
|
|
3237
3263
|
});
|
|
3238
3264
|
}
|
|
3239
|
-
function
|
|
3265
|
+
function Zn({ item: e, squareUnit: t, variant: n }) {
|
|
3240
3266
|
return /* @__PURE__ */ s("div", {
|
|
3241
3267
|
className: "length-card printable-length-card",
|
|
3242
3268
|
children: [/* @__PURE__ */ o("div", {
|
|
@@ -3265,13 +3291,13 @@ function Hn({ item: e, squareUnit: t, variant: n }) {
|
|
|
3265
3291
|
className: "length-value-row printable-length-value-row",
|
|
3266
3292
|
children: [
|
|
3267
3293
|
/* @__PURE__ */ o("span", { children: e.label }),
|
|
3268
|
-
/* @__PURE__ */ o(
|
|
3294
|
+
/* @__PURE__ */ o(er, {}),
|
|
3269
3295
|
/* @__PURE__ */ o("span", { children: t })
|
|
3270
3296
|
]
|
|
3271
3297
|
})]
|
|
3272
3298
|
});
|
|
3273
3299
|
}
|
|
3274
|
-
function
|
|
3300
|
+
function Qn({ part: e, partNumber: t }) {
|
|
3275
3301
|
return /* @__PURE__ */ s("section", {
|
|
3276
3302
|
className: "printable-word-problem__part",
|
|
3277
3303
|
children: [/* @__PURE__ */ s("div", {
|
|
@@ -3300,10 +3326,10 @@ function Un({ part: e, partNumber: t }) {
|
|
|
3300
3326
|
})]
|
|
3301
3327
|
});
|
|
3302
3328
|
}
|
|
3303
|
-
function
|
|
3304
|
-
return t.answers?.length ? /* @__PURE__ */ s(a, { children: [t.answers.map((t) => /* @__PURE__ */ s(e, { children: [t.before ? /* @__PURE__ */ o("span", { children: t.before }) : null, /* @__PURE__ */ o(
|
|
3329
|
+
function $n({ item: t }) {
|
|
3330
|
+
return t.answers?.length ? /* @__PURE__ */ s(a, { children: [t.answers.map((t) => /* @__PURE__ */ s(e, { children: [t.before ? /* @__PURE__ */ o("span", { children: t.before }) : null, /* @__PURE__ */ o(er, {})] }, t.id)), t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null] }) : t.correctAnswer ? /* @__PURE__ */ s(a, { children: [
|
|
3305
3331
|
/* @__PURE__ */ o("span", { children: t.before }),
|
|
3306
|
-
/* @__PURE__ */ o(
|
|
3332
|
+
/* @__PURE__ */ o(er, {}),
|
|
3307
3333
|
t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null
|
|
3308
3334
|
] }) : /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o("span", { children: t.before }), t.after ? /* @__PURE__ */ o("span", { children: t.after }) : null] });
|
|
3309
3335
|
}
|
|
@@ -3313,17 +3339,17 @@ function $() {
|
|
|
3313
3339
|
"aria-hidden": "true"
|
|
3314
3340
|
});
|
|
3315
3341
|
}
|
|
3316
|
-
function
|
|
3342
|
+
function er() {
|
|
3317
3343
|
return /* @__PURE__ */ o("span", {
|
|
3318
3344
|
className: "printable-blank-box",
|
|
3319
3345
|
"aria-hidden": "true"
|
|
3320
3346
|
});
|
|
3321
3347
|
}
|
|
3322
|
-
function
|
|
3348
|
+
function tr(e) {
|
|
3323
3349
|
return e.startsWith("ar");
|
|
3324
3350
|
}
|
|
3325
|
-
function
|
|
3326
|
-
return
|
|
3351
|
+
function nr(e) {
|
|
3352
|
+
return tr(e) ? {
|
|
3327
3353
|
answerArea: "مساحة الجواب",
|
|
3328
3354
|
countShort: "عدد",
|
|
3329
3355
|
dragArea: "اربط أو اكتب الجواب",
|
|
@@ -3346,7 +3372,7 @@ function qn(e) {
|
|
|
3346
3372
|
duration: "Duree",
|
|
3347
3373
|
level: "Niveau",
|
|
3348
3374
|
model: "Modele",
|
|
3349
|
-
obtainedNote: "
|
|
3375
|
+
obtainedNote: "التحكم",
|
|
3350
3376
|
oralAnswer: "Reponse orale",
|
|
3351
3377
|
phase: "Phase",
|
|
3352
3378
|
placeLabels: "Placer les etiquettes",
|
|
@@ -3360,7 +3386,7 @@ function qn(e) {
|
|
|
3360
3386
|
}
|
|
3361
3387
|
//#endregion
|
|
3362
3388
|
//#region src/exam-session/interactions/DraftSheet.tsx
|
|
3363
|
-
function
|
|
3389
|
+
function rr({ disabled: e, onChange: t, value: n }) {
|
|
3364
3390
|
let [r, a] = i(!1);
|
|
3365
3391
|
return /* @__PURE__ */ o("aside", {
|
|
3366
3392
|
className: "draft-sheet",
|
|
@@ -3377,7 +3403,7 @@ function Jn({ disabled: e, onChange: t, value: n }) {
|
|
|
3377
3403
|
type: "button",
|
|
3378
3404
|
children: "إِغْلاقٌ"
|
|
3379
3405
|
})]
|
|
3380
|
-
}), /* @__PURE__ */ o(
|
|
3406
|
+
}), /* @__PURE__ */ o(ot, {
|
|
3381
3407
|
actionLabel: "مساحة ورقة وساخ",
|
|
3382
3408
|
canvasHeight: 430,
|
|
3383
3409
|
disabled: e,
|
|
@@ -3396,7 +3422,7 @@ function Jn({ disabled: e, onChange: t, value: n }) {
|
|
|
3396
3422
|
}
|
|
3397
3423
|
//#endregion
|
|
3398
3424
|
//#region src/exam-session/interactions/SingleChoice.tsx
|
|
3399
|
-
function
|
|
3425
|
+
function ir({ answerId: e, choices: t, value: n, onChange: r }) {
|
|
3400
3426
|
return /* @__PURE__ */ o("div", {
|
|
3401
3427
|
className: "choice-group",
|
|
3402
3428
|
role: "radiogroup",
|
|
@@ -3421,4 +3447,4 @@ function Yn({ answerId: e, choices: t, value: n, onChange: r }) {
|
|
|
3421
3447
|
});
|
|
3422
3448
|
}
|
|
3423
3449
|
//#endregion
|
|
3424
|
-
export {
|
|
3450
|
+
export { Fe as CoinTableResponse, Je as ColorPenPicker, K as DEFAULT_GEOMETRY_COLORS, zt as DEFAULT_NATIVE_VOICE_AI_CONFIG, rr as DraftSheet, Ve as DragMatch, hn as ExamSectionRenderer, ot as GeometryCanvas, G as HandwrittenNumberAnswer, Nt as KonvaDrawingGrid, Pt as LabelPlacement, Lt as NumberLineAnswer, Pn as PrintableExamDocument, Ln as PrintableQuestionRenderer, In as PrintableSectionRenderer, Kt as PronunciationRecorder, Mn as QuestionPreviewPanel, mn as QuestionRenderer, Be as ShapeGlyph, ir as SingleChoice, en as SortableAnswer, nn as TextAnswer, fn as VisualSceneGraphic, de as calculateExamResult, un as createVisualSceneFromVariant, Bt as evaluateVoiceAiResult, Re as examShapeOptions, I as formatScoreValue, Ze as getColorValue, Xe as getDefaultColorId, ze as getExamShapeLabel, ae as getQuestionMaxScore, L as getSectionMaxScore, R as getSectionMaxScoreLabel, dn as getVisualSceneColorValue, Qe as mapChoicesToGeometryColors, Vt as normalizeVoiceText, ie as parseScoreValue, oe as sectionHasQuestionScores, cn as visualSceneColorOptions, sn as visualSceneIconOptions, ln as visualSceneStateOptions, z as withDerivedSectionScore };
|