@enspiredigital/xlms-headless 0.0.25 → 0.0.26
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/hooks/useSpeaking.d.ts +4 -2
- package/dist/hooks/useSpeaking.d.ts.map +1 -1
- package/dist/index.js +289 -284
- package/package.json +1 -1
|
@@ -16,19 +16,21 @@ export declare function useSpeaking(question: SpeakingQuestionType, uploadHandle
|
|
|
16
16
|
submitted: boolean | null;
|
|
17
17
|
attempts: number;
|
|
18
18
|
audioUrl: string | undefined;
|
|
19
|
-
setAudioUrl: import('react').Dispatch<import('react').SetStateAction<string | undefined>>;
|
|
20
19
|
recordingState: RecordingState;
|
|
21
20
|
recordingTime: number;
|
|
22
21
|
isUploading: boolean;
|
|
23
22
|
uploadError: string | undefined;
|
|
23
|
+
isRecording: boolean;
|
|
24
|
+
payload: SpeakingSubmitPayload;
|
|
25
|
+
setAudioUrl: import('react').Dispatch<import('react').SetStateAction<string | undefined>>;
|
|
24
26
|
startRecording: () => Promise<void>;
|
|
25
27
|
pauseRecording: () => void;
|
|
26
28
|
resumeRecording: () => void;
|
|
27
29
|
stopRecording: () => void;
|
|
30
|
+
toggleRecording: () => void | Promise<void>;
|
|
28
31
|
uploadAudio: () => Promise<void>;
|
|
29
32
|
uploadFile: (file: File) => Promise<void>;
|
|
30
33
|
submit: () => SpeakingSubmitPayload;
|
|
31
34
|
reset: () => void;
|
|
32
|
-
payload: SpeakingSubmitPayload;
|
|
33
35
|
};
|
|
34
36
|
//# sourceMappingURL=useSpeaking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSpeaking.d.ts","sourceRoot":"","sources":["../../src/hooks/useSpeaking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSpeaking.d.ts","sourceRoot":"","sources":["../../src/hooks/useSpeaking.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,MAAM,MAAM,qBAAqB,GAAG,CAClC,SAAS,EAAE,IAAI,EACf,QAAQ,CAAC,EAAE,MAAM,KACd,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEjE,wBAAgB,WAAW,CACzB,QAAQ,EAAE,oBAAoB,EAC9B,aAAa,CAAC,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;uBAiItB,IAAI;;;EAmFpB"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { jsx as
|
|
3
|
-
function
|
|
4
|
-
const [t, n] =
|
|
5
|
-
function S(
|
|
6
|
-
n(!0),
|
|
1
|
+
import { useState as A, useRef as _, useEffect as V, useMemo as T, useCallback as R } from "react";
|
|
2
|
+
import { jsx as W, Fragment as $ } from "react/jsx-runtime";
|
|
3
|
+
function E() {
|
|
4
|
+
const [t, n] = A(null), [u, f] = A(null), [b, C] = A(0);
|
|
5
|
+
function S(d) {
|
|
6
|
+
n(!0), d !== void 0 && f(d), C((h) => h + 1);
|
|
7
7
|
}
|
|
8
8
|
function o() {
|
|
9
9
|
n(!1), f(null);
|
|
@@ -20,7 +20,7 @@ function M() {
|
|
|
20
20
|
resetQuestion: o
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function J(t, n) {
|
|
24
24
|
if (t.length !== n.length) return !1;
|
|
25
25
|
const u = new Set(t), f = new Set(n);
|
|
26
26
|
if (u.size !== f.size) return !1;
|
|
@@ -28,7 +28,7 @@ function z(t, n) {
|
|
|
28
28
|
if (!f.has(b)) return !1;
|
|
29
29
|
return !0;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function z(t) {
|
|
32
32
|
const n = [...t];
|
|
33
33
|
for (let u = n.length - 1; u > 0; u--) {
|
|
34
34
|
const f = Math.floor(Math.random() * (u + 1));
|
|
@@ -36,7 +36,7 @@ function W(t) {
|
|
|
36
36
|
}
|
|
37
37
|
return n;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function X(t) {
|
|
40
40
|
const {
|
|
41
41
|
canAnswer: n,
|
|
42
42
|
submitted: u,
|
|
@@ -44,20 +44,20 @@ function G(t) {
|
|
|
44
44
|
attempts: b,
|
|
45
45
|
resetQuestion: C,
|
|
46
46
|
submitQuestion: S
|
|
47
|
-
} =
|
|
47
|
+
} = E(), [o, d] = A([]);
|
|
48
48
|
function h(w) {
|
|
49
|
-
|
|
49
|
+
d((m) => t.options.allowMultipleAnswers ? m.includes(w) ? m.filter((p) => p !== w) : [...m, w] : [w]);
|
|
50
50
|
}
|
|
51
51
|
function I() {
|
|
52
52
|
if (o.length === 0) return;
|
|
53
53
|
const w = t.options.answers.reduce(
|
|
54
|
-
(p,
|
|
54
|
+
(p, x) => (x.is_correct && p.push(x.id), p),
|
|
55
55
|
[]
|
|
56
|
-
), m =
|
|
56
|
+
), m = J(o, w);
|
|
57
57
|
S(m);
|
|
58
58
|
}
|
|
59
59
|
function v() {
|
|
60
|
-
|
|
60
|
+
d([]), C();
|
|
61
61
|
}
|
|
62
62
|
return {
|
|
63
63
|
// data
|
|
@@ -74,7 +74,7 @@ function G(t) {
|
|
|
74
74
|
canAnswer: n
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function Y(t) {
|
|
78
78
|
const {
|
|
79
79
|
canAnswer: n,
|
|
80
80
|
submitted: u,
|
|
@@ -82,62 +82,62 @@ function N(t) {
|
|
|
82
82
|
attempts: b,
|
|
83
83
|
submitQuestion: C,
|
|
84
84
|
resetQuestion: S
|
|
85
|
-
} =
|
|
85
|
+
} = E(), [o, d] = A([]), [h, I] = A(
|
|
86
86
|
[]
|
|
87
|
-
), [v, w] =
|
|
87
|
+
), [v, w] = A(
|
|
88
88
|
[]
|
|
89
|
-
), m =
|
|
90
|
-
function p(e,
|
|
91
|
-
|
|
92
|
-
...
|
|
93
|
-
(g) => g.targetId !== e && g.sourceId !==
|
|
89
|
+
), m = _([]);
|
|
90
|
+
function p(e, s) {
|
|
91
|
+
d((l) => [
|
|
92
|
+
...l.filter(
|
|
93
|
+
(g) => g.targetId !== e && g.sourceId !== s
|
|
94
94
|
),
|
|
95
|
-
{ targetId: e, sourceId:
|
|
95
|
+
{ targetId: e, sourceId: s }
|
|
96
96
|
]);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
(
|
|
98
|
+
function x(e, s) {
|
|
99
|
+
d(
|
|
100
|
+
(l) => l.filter((g) => g.targetId !== e || g.sourceId !== s)
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
function a() {
|
|
104
|
-
let e = 0,
|
|
105
|
-
return t.options.targets.forEach((
|
|
106
|
-
const g = o.find((U) => U.targetId ===
|
|
107
|
-
g && y && g.sourceId === y.id ? e +=
|
|
104
|
+
let e = 0, s = !0;
|
|
105
|
+
return t.options.targets.forEach((l) => {
|
|
106
|
+
const g = o.find((U) => U.targetId === l.id), y = t.options.sources[l.content.correct_position - 1];
|
|
107
|
+
g && y && g.sourceId === y.id ? e += l.content.point : s = !1;
|
|
108
108
|
}), {
|
|
109
|
-
isCorrect:
|
|
109
|
+
isCorrect: s,
|
|
110
110
|
score: e,
|
|
111
111
|
maxScore: t.options.targets.reduce(
|
|
112
|
-
(
|
|
112
|
+
(l, g) => l + g.content.point,
|
|
113
113
|
0
|
|
114
114
|
)
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function c() {
|
|
118
118
|
const e = a();
|
|
119
119
|
return C(e.isCorrect), e;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
121
|
+
function i() {
|
|
122
|
+
d([]), S();
|
|
123
123
|
}
|
|
124
124
|
function r(e) {
|
|
125
|
-
const
|
|
126
|
-
return t.options.targets.find((
|
|
125
|
+
const s = o.find((l) => l.sourceId === e)?.targetId;
|
|
126
|
+
return t.options.targets.find((l) => l.id === s);
|
|
127
127
|
}
|
|
128
|
-
return
|
|
128
|
+
return V(() => {
|
|
129
129
|
const e = t.options.sources.filter(
|
|
130
|
-
(
|
|
130
|
+
(s) => !o.some((l) => l.sourceId === s.id)
|
|
131
131
|
);
|
|
132
132
|
I(e);
|
|
133
|
-
}, [o, t.options.sources]),
|
|
133
|
+
}, [o, t.options.sources]), V(() => {
|
|
134
134
|
if (m.current.length === 0) return;
|
|
135
135
|
const e = m.current.filter(
|
|
136
|
-
(
|
|
136
|
+
(s) => !o.some((l) => l.targetId === s.id)
|
|
137
137
|
);
|
|
138
138
|
w(e);
|
|
139
|
-
}, [o]),
|
|
140
|
-
m.current =
|
|
139
|
+
}, [o]), V(() => {
|
|
140
|
+
m.current = z(t.options.targets);
|
|
141
141
|
}, [t.options.targets]), {
|
|
142
142
|
// data
|
|
143
143
|
sources: t.options.sources,
|
|
@@ -154,12 +154,12 @@ function N(t) {
|
|
|
154
154
|
// actions
|
|
155
155
|
getTargetBySourceId: r,
|
|
156
156
|
select: p,
|
|
157
|
-
remove:
|
|
158
|
-
submit:
|
|
159
|
-
reset:
|
|
157
|
+
remove: x,
|
|
158
|
+
submit: c,
|
|
159
|
+
reset: i
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Z(t) {
|
|
163
163
|
const {
|
|
164
164
|
canAnswer: n,
|
|
165
165
|
submitted: u,
|
|
@@ -167,11 +167,11 @@ function P(t) {
|
|
|
167
167
|
attempts: b,
|
|
168
168
|
resetQuestion: C,
|
|
169
169
|
submitQuestion: S
|
|
170
|
-
} =
|
|
170
|
+
} = E();
|
|
171
171
|
function o() {
|
|
172
172
|
S(!0);
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function d() {
|
|
175
175
|
C();
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
@@ -181,7 +181,7 @@ function P(t) {
|
|
|
181
181
|
type: t.options.urlType,
|
|
182
182
|
// actions
|
|
183
183
|
submit: o,
|
|
184
|
-
reset:
|
|
184
|
+
reset: d,
|
|
185
185
|
// base
|
|
186
186
|
submitted: u,
|
|
187
187
|
isCorrect: f,
|
|
@@ -189,7 +189,7 @@ function P(t) {
|
|
|
189
189
|
canAnswer: n
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function K(t) {
|
|
193
193
|
const {
|
|
194
194
|
canAnswer: n,
|
|
195
195
|
submitted: u,
|
|
@@ -197,15 +197,15 @@ function J(t) {
|
|
|
197
197
|
attempts: b,
|
|
198
198
|
submitQuestion: C,
|
|
199
199
|
resetQuestion: S
|
|
200
|
-
} =
|
|
200
|
+
} = E(), [o, d] = A([]), [h, I] = A(null), v = T(() => {
|
|
201
201
|
const r = new Set(o.map((e) => e.itemId));
|
|
202
202
|
return t.options.answers.filter(
|
|
203
203
|
(e) => !r.has(String(e.id))
|
|
204
204
|
);
|
|
205
205
|
}, [o, t.options.answers]);
|
|
206
206
|
function w(r, e) {
|
|
207
|
-
|
|
208
|
-
...
|
|
207
|
+
d((s) => [
|
|
208
|
+
...s.filter(
|
|
209
209
|
(g) => g.blankIndex !== e && g.itemId !== r
|
|
210
210
|
),
|
|
211
211
|
{
|
|
@@ -215,40 +215,40 @@ function J(t) {
|
|
|
215
215
|
]);
|
|
216
216
|
}
|
|
217
217
|
function m(r) {
|
|
218
|
-
|
|
218
|
+
d((e) => e.filter((s) => s.itemId !== r));
|
|
219
219
|
}
|
|
220
220
|
function p(r, e) {
|
|
221
221
|
w(r, e);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
let r = 0, e = !0,
|
|
225
|
-
const
|
|
226
|
-
return Object.entries(
|
|
227
|
-
const
|
|
223
|
+
function x() {
|
|
224
|
+
let r = 0, e = !0, s = 0;
|
|
225
|
+
const l = t.correct_answers.list, g = new Map(o.map((y) => [y.blankIndex, y.itemId]));
|
|
226
|
+
return Object.entries(l).forEach(([y, U]) => {
|
|
227
|
+
const B = y, L = g.get(B);
|
|
228
228
|
if (!L) {
|
|
229
229
|
e = !1;
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
const
|
|
233
|
-
|
|
232
|
+
const M = t.options.answers.find((D) => D.id === L);
|
|
233
|
+
M && String(M.group_position) === String(U) ? (r++, s += M.point) : e = !1;
|
|
234
234
|
}), {
|
|
235
235
|
isCorrect: e,
|
|
236
236
|
correctCount: r,
|
|
237
|
-
totalCount: Object.keys(
|
|
237
|
+
totalCount: Object.keys(l).length,
|
|
238
238
|
maxScore: t.metadata.points,
|
|
239
|
-
score:
|
|
239
|
+
score: s
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
function a() {
|
|
243
|
-
const r =
|
|
243
|
+
const r = x();
|
|
244
244
|
return C(r.isCorrect), r;
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
|
|
246
|
+
function c() {
|
|
247
|
+
d([]), S();
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
const e = o.find((
|
|
251
|
-
return t.options.answers.find((
|
|
249
|
+
function i(r) {
|
|
250
|
+
const e = o.find((s) => s.blankIndex === r)?.itemId;
|
|
251
|
+
return t.options.answers.find((s) => s.id === e);
|
|
252
252
|
}
|
|
253
253
|
return {
|
|
254
254
|
// data
|
|
@@ -268,12 +268,12 @@ function J(t) {
|
|
|
268
268
|
removeItem: m,
|
|
269
269
|
moveItem: p,
|
|
270
270
|
setDraggingItemId: I,
|
|
271
|
-
getItemByBlankId:
|
|
271
|
+
getItemByBlankId: i,
|
|
272
272
|
submit: a,
|
|
273
|
-
reset:
|
|
273
|
+
reset: c
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function H(t) {
|
|
277
277
|
const {
|
|
278
278
|
canAnswer: n,
|
|
279
279
|
submitted: u,
|
|
@@ -281,49 +281,49 @@ function X(t) {
|
|
|
281
281
|
attempts: b,
|
|
282
282
|
submitQuestion: C,
|
|
283
283
|
resetQuestion: S
|
|
284
|
-
} =
|
|
285
|
-
t.options.answers.map((
|
|
284
|
+
} = E(), [o, d] = A(() => z(
|
|
285
|
+
t.options.answers.map((c) => String(c.id))
|
|
286
286
|
)), h = T(() => o.map(
|
|
287
|
-
(
|
|
288
|
-
).filter((
|
|
289
|
-
function I(
|
|
290
|
-
|
|
291
|
-
const e = [...r], [
|
|
292
|
-
return e.splice(
|
|
287
|
+
(c) => t.options.answers.find((i) => String(i.id) === c)
|
|
288
|
+
).filter((c) => c !== void 0), [o, t.options.answers]);
|
|
289
|
+
function I(c, i) {
|
|
290
|
+
d((r) => {
|
|
291
|
+
const e = [...r], [s] = e.splice(c, 1);
|
|
292
|
+
return e.splice(i, 0, s), e;
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
-
function v(
|
|
296
|
-
const
|
|
297
|
-
|
|
295
|
+
function v(c) {
|
|
296
|
+
const i = o.indexOf(c);
|
|
297
|
+
i > 0 && I(i, i - 1);
|
|
298
298
|
}
|
|
299
|
-
function w(
|
|
300
|
-
const
|
|
301
|
-
|
|
299
|
+
function w(c) {
|
|
300
|
+
const i = o.indexOf(c);
|
|
301
|
+
i < o.length - 1 && I(i, i + 1);
|
|
302
302
|
}
|
|
303
|
-
function m(
|
|
304
|
-
const r = o.indexOf(
|
|
305
|
-
r !== -1 &&
|
|
303
|
+
function m(c, i) {
|
|
304
|
+
const r = o.indexOf(c);
|
|
305
|
+
r !== -1 && i >= 0 && i < o.length && I(r, i);
|
|
306
306
|
}
|
|
307
307
|
function p() {
|
|
308
|
-
let
|
|
308
|
+
let c = 0, i = !0;
|
|
309
309
|
return t.options.answers.forEach((r, e) => {
|
|
310
|
-
const
|
|
311
|
-
|
|
310
|
+
const s = o.indexOf(String(r.id));
|
|
311
|
+
s !== -1 && s + 1 === r.correct_position ? c += r.point : i = !1;
|
|
312
312
|
}), {
|
|
313
|
-
isCorrect:
|
|
314
|
-
score:
|
|
313
|
+
isCorrect: i,
|
|
314
|
+
score: c,
|
|
315
315
|
maxScore: t.options.answers.reduce(
|
|
316
316
|
(r, e) => r + e.point,
|
|
317
317
|
0
|
|
318
318
|
)
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
const
|
|
323
|
-
return C(
|
|
321
|
+
function x() {
|
|
322
|
+
const c = p();
|
|
323
|
+
return C(c.isCorrect), c;
|
|
324
324
|
}
|
|
325
325
|
function a() {
|
|
326
|
-
|
|
326
|
+
d(t.options.answers.map((c) => String(c.id))), S();
|
|
327
327
|
}
|
|
328
328
|
return {
|
|
329
329
|
// data
|
|
@@ -338,16 +338,16 @@ function X(t) {
|
|
|
338
338
|
attempts: b,
|
|
339
339
|
canAnswer: n,
|
|
340
340
|
// actions
|
|
341
|
-
setOrderedItemIds:
|
|
341
|
+
setOrderedItemIds: d,
|
|
342
342
|
moveItem: I,
|
|
343
343
|
moveUp: v,
|
|
344
344
|
moveDown: w,
|
|
345
345
|
moveToPosition: m,
|
|
346
|
-
submit:
|
|
346
|
+
submit: x,
|
|
347
347
|
reset: a
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function q(t) {
|
|
351
351
|
const {
|
|
352
352
|
canAnswer: n,
|
|
353
353
|
submitted: u,
|
|
@@ -355,66 +355,66 @@ function Y(t) {
|
|
|
355
355
|
attempts: b,
|
|
356
356
|
submitQuestion: C,
|
|
357
357
|
resetQuestion: S
|
|
358
|
-
} =
|
|
359
|
-
const
|
|
358
|
+
} = E(), [o, d] = A([]), h = T(() => {
|
|
359
|
+
const i = new Set(o.map((r) => r.labelId));
|
|
360
360
|
return t.options.labels.filter(
|
|
361
|
-
(r) => !
|
|
361
|
+
(r) => !i.has(String(r.id))
|
|
362
362
|
);
|
|
363
363
|
}, [o, t.options.labels]);
|
|
364
|
-
function I(
|
|
365
|
-
const
|
|
366
|
-
|
|
364
|
+
function I(i, r, e, s) {
|
|
365
|
+
const l = t.options.blanks.find((g) => String(g.id) === r);
|
|
366
|
+
l && d((g) => [
|
|
367
367
|
...g.filter(
|
|
368
|
-
(U) => U.labelId !==
|
|
368
|
+
(U) => U.labelId !== i && U.blankId !== r
|
|
369
369
|
),
|
|
370
370
|
{
|
|
371
|
-
labelId:
|
|
371
|
+
labelId: i,
|
|
372
372
|
blankId: r,
|
|
373
|
-
x: e ??
|
|
374
|
-
y:
|
|
373
|
+
x: e ?? l.coordinates.x,
|
|
374
|
+
y: s ?? l.coordinates.y
|
|
375
375
|
}
|
|
376
376
|
]);
|
|
377
377
|
}
|
|
378
|
-
function v(
|
|
379
|
-
|
|
378
|
+
function v(i) {
|
|
379
|
+
d((r) => r.filter((e) => e.labelId !== i));
|
|
380
380
|
}
|
|
381
|
-
function w(
|
|
382
|
-
I(
|
|
381
|
+
function w(i, r, e, s) {
|
|
382
|
+
I(i, r, e, s);
|
|
383
383
|
}
|
|
384
|
-
function m(
|
|
385
|
-
const r = o.find((e) => e.blankId ===
|
|
384
|
+
function m(i) {
|
|
385
|
+
const r = o.find((e) => e.blankId === i);
|
|
386
386
|
return r && t.options.labels.find(
|
|
387
387
|
(e) => String(e.id) === r.labelId
|
|
388
388
|
) || null;
|
|
389
389
|
}
|
|
390
|
-
function p(
|
|
391
|
-
const r = o.find((e) => e.labelId ===
|
|
390
|
+
function p(i) {
|
|
391
|
+
const r = o.find((e) => e.labelId === i);
|
|
392
392
|
return r ? r.blankId : null;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
let
|
|
394
|
+
function x() {
|
|
395
|
+
let i = 0, r = !0;
|
|
396
396
|
return t.options.labels.forEach((e) => {
|
|
397
|
-
const
|
|
397
|
+
const s = o.find(
|
|
398
398
|
(g) => String(g.labelId) === String(e.id)
|
|
399
|
-
),
|
|
399
|
+
), l = t.options.blanks.find(
|
|
400
400
|
(g, y) => y + 1 === e.correct_position
|
|
401
401
|
);
|
|
402
|
-
|
|
402
|
+
s && l && s.blankId === String(l.id) ? i += e.point : r = !1;
|
|
403
403
|
}), {
|
|
404
404
|
isCorrect: r,
|
|
405
|
-
score:
|
|
405
|
+
score: i,
|
|
406
406
|
maxScore: t.options.labels.reduce(
|
|
407
|
-
(e,
|
|
407
|
+
(e, s) => e + s.point,
|
|
408
408
|
0
|
|
409
409
|
)
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
412
|
function a() {
|
|
413
|
-
const
|
|
414
|
-
return C(
|
|
413
|
+
const i = x();
|
|
414
|
+
return C(i.isCorrect), i;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
|
|
416
|
+
function c() {
|
|
417
|
+
d([]), S();
|
|
418
418
|
}
|
|
419
419
|
return {
|
|
420
420
|
// data
|
|
@@ -438,10 +438,10 @@ function Y(t) {
|
|
|
438
438
|
getLabelAtBlank: m,
|
|
439
439
|
getBlankForLabel: p,
|
|
440
440
|
submit: a,
|
|
441
|
-
reset:
|
|
441
|
+
reset: c
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function tt(t) {
|
|
445
445
|
const {
|
|
446
446
|
canAnswer: n,
|
|
447
447
|
submitted: u,
|
|
@@ -449,33 +449,33 @@ function Z(t) {
|
|
|
449
449
|
attempts: b,
|
|
450
450
|
submitQuestion: C,
|
|
451
451
|
resetQuestion: S
|
|
452
|
-
} =
|
|
452
|
+
} = E(), [o, d] = A([]);
|
|
453
453
|
function h(m, p) {
|
|
454
|
-
|
|
455
|
-
const a =
|
|
454
|
+
d((x) => {
|
|
455
|
+
const a = x.findIndex((c) => c.blankId === m);
|
|
456
456
|
if (a >= 0) {
|
|
457
|
-
const
|
|
458
|
-
return
|
|
457
|
+
const c = [...x];
|
|
458
|
+
return c[a] = { blankId: m, value: p }, c;
|
|
459
459
|
}
|
|
460
|
-
return [...
|
|
460
|
+
return [...x, { blankId: m, value: p }];
|
|
461
461
|
});
|
|
462
462
|
}
|
|
463
463
|
function I() {
|
|
464
|
-
let m = 0, p = 0,
|
|
465
|
-
const a = t.correct_answers.list || {},
|
|
464
|
+
let m = 0, p = 0, x = 0;
|
|
465
|
+
const a = t.correct_answers.list || {}, c = Object.keys(a).length;
|
|
466
466
|
Object.entries(a).forEach(([r, e]) => {
|
|
467
|
-
const
|
|
468
|
-
(
|
|
469
|
-
), g =
|
|
470
|
-
|
|
471
|
-
const y = o.find((
|
|
472
|
-
(y ? String(y.value).trim().toLowerCase() : "") ===
|
|
467
|
+
const s = String(e).trim().toLowerCase(), l = t.options.answers.find(
|
|
468
|
+
(B) => B.correct_position === Number(r)
|
|
469
|
+
), g = l && l.point || 1;
|
|
470
|
+
x += g;
|
|
471
|
+
const y = o.find((B) => B.blankId === r);
|
|
472
|
+
(y ? String(y.value).trim().toLowerCase() : "") === s && (m += g, p++);
|
|
473
473
|
});
|
|
474
|
-
const
|
|
475
|
-
return
|
|
476
|
-
isCorrect:
|
|
474
|
+
const i = p === c && c > 0;
|
|
475
|
+
return x === 0 && c > 0 && (x = c), {
|
|
476
|
+
isCorrect: i,
|
|
477
477
|
score: Math.round(m * 100) / 100,
|
|
478
|
-
maxScore: Math.round(
|
|
478
|
+
maxScore: Math.round(x * 100) / 100
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
481
|
function v() {
|
|
@@ -483,7 +483,7 @@ function Z(t) {
|
|
|
483
483
|
return C(m.isCorrect), m;
|
|
484
484
|
}
|
|
485
485
|
function w() {
|
|
486
|
-
|
|
486
|
+
d([]), S();
|
|
487
487
|
}
|
|
488
488
|
return {
|
|
489
489
|
// data
|
|
@@ -501,7 +501,7 @@ function Z(t) {
|
|
|
501
501
|
reset: w
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function et(t) {
|
|
505
505
|
const {
|
|
506
506
|
canAnswer: n,
|
|
507
507
|
submitted: u,
|
|
@@ -509,33 +509,33 @@ function K(t) {
|
|
|
509
509
|
attempts: b,
|
|
510
510
|
submitQuestion: C,
|
|
511
511
|
resetQuestion: S
|
|
512
|
-
} =
|
|
513
|
-
function h(a,
|
|
514
|
-
|
|
515
|
-
const r =
|
|
512
|
+
} = E(), [o, d] = A([]);
|
|
513
|
+
function h(a, c) {
|
|
514
|
+
d((i) => {
|
|
515
|
+
const r = i.findIndex((e) => e.itemId === a);
|
|
516
516
|
if (r >= 0) {
|
|
517
|
-
const e = [...
|
|
518
|
-
return e[r] = { itemId: a, categoryId:
|
|
517
|
+
const e = [...i];
|
|
518
|
+
return e[r] = { itemId: a, categoryId: c }, e;
|
|
519
519
|
}
|
|
520
|
-
return [...
|
|
520
|
+
return [...i, { itemId: a, categoryId: c }];
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
523
|
function I(a) {
|
|
524
|
-
|
|
524
|
+
d((c) => c.filter((i) => i.itemId !== a));
|
|
525
525
|
}
|
|
526
526
|
function v() {
|
|
527
|
-
let a = 0,
|
|
527
|
+
let a = 0, c = 0;
|
|
528
528
|
const r = t.correct_answers.list || {}, e = Object.keys(r).length;
|
|
529
|
-
let
|
|
529
|
+
let s = 0;
|
|
530
530
|
return Object.entries(r).forEach(([g, y]) => {
|
|
531
|
-
const U = t.options.items.find((
|
|
532
|
-
|
|
533
|
-
const L = o.find((
|
|
534
|
-
L && L.categoryId === y && (a +=
|
|
535
|
-
}), a = Math.round(a * 100) / 100,
|
|
536
|
-
isCorrect:
|
|
531
|
+
const U = t.options.items.find((M) => M.id === g), B = U ? U.point : 0;
|
|
532
|
+
s += B;
|
|
533
|
+
const L = o.find((M) => M.itemId === g);
|
|
534
|
+
L && L.categoryId === y && (a += B, c++);
|
|
535
|
+
}), a = Math.round(a * 100) / 100, s = Math.round(s * 100) / 100, {
|
|
536
|
+
isCorrect: c === e && e > 0,
|
|
537
537
|
score: a,
|
|
538
|
-
maxScore:
|
|
538
|
+
maxScore: s
|
|
539
539
|
};
|
|
540
540
|
}
|
|
541
541
|
function w() {
|
|
@@ -543,17 +543,17 @@ function K(t) {
|
|
|
543
543
|
return C(a.isCorrect), a;
|
|
544
544
|
}
|
|
545
545
|
function m() {
|
|
546
|
-
|
|
546
|
+
d([]), S();
|
|
547
547
|
}
|
|
548
548
|
const p = T(() => t.options.items.filter(
|
|
549
|
-
(a) => !o.some((
|
|
550
|
-
), [t.options.items, o]),
|
|
551
|
-
const
|
|
552
|
-
...t.options.items.find((e) => e.id ===
|
|
549
|
+
(a) => !o.some((c) => c.itemId === a.id)
|
|
550
|
+
), [t.options.items, o]), x = T(() => t.options.categories.map((a) => {
|
|
551
|
+
const c = o.filter((i) => i.categoryId === a.id).map((i) => ({
|
|
552
|
+
...t.options.items.find((e) => e.id === i.itemId)
|
|
553
553
|
}));
|
|
554
554
|
return {
|
|
555
555
|
...a,
|
|
556
|
-
items:
|
|
556
|
+
items: c
|
|
557
557
|
};
|
|
558
558
|
}), [t.options.categories, t.options.items, o]);
|
|
559
559
|
return {
|
|
@@ -561,7 +561,7 @@ function K(t) {
|
|
|
561
561
|
categories: t.options.categories,
|
|
562
562
|
allItems: t.options.items,
|
|
563
563
|
question: t,
|
|
564
|
-
categoriesWithItems:
|
|
564
|
+
categoriesWithItems: x,
|
|
565
565
|
// state
|
|
566
566
|
answers: o,
|
|
567
567
|
unassignedItems: p,
|
|
@@ -577,7 +577,7 @@ function K(t) {
|
|
|
577
577
|
reset: m
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function rt(t) {
|
|
581
581
|
const {
|
|
582
582
|
canAnswer: n,
|
|
583
583
|
submitted: u,
|
|
@@ -585,11 +585,11 @@ function H(t) {
|
|
|
585
585
|
attempts: b,
|
|
586
586
|
resetQuestion: C,
|
|
587
587
|
submitQuestion: S
|
|
588
|
-
} =
|
|
588
|
+
} = E();
|
|
589
589
|
function o() {
|
|
590
590
|
u || S(!0);
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function d() {
|
|
593
593
|
C();
|
|
594
594
|
}
|
|
595
595
|
return {
|
|
@@ -599,7 +599,7 @@ function H(t) {
|
|
|
599
599
|
type: t.options.urlType,
|
|
600
600
|
// actions
|
|
601
601
|
submit: o,
|
|
602
|
-
reset:
|
|
602
|
+
reset: d,
|
|
603
603
|
// base
|
|
604
604
|
submitted: u,
|
|
605
605
|
isCorrect: f,
|
|
@@ -607,17 +607,17 @@ function H(t) {
|
|
|
607
607
|
canAnswer: n
|
|
608
608
|
};
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
const { canAnswer: u, submitted: f, attempts: b, submitQuestion: C, resetQuestion: S } =
|
|
610
|
+
function nt(t, n) {
|
|
611
|
+
const { canAnswer: u, submitted: f, attempts: b, submitQuestion: C, resetQuestion: S } = E(), [o, d] = A(""), [h, I] = A(void 0), [v, w] = A(!1), [m, p] = A(void 0), x = R(
|
|
612
612
|
async (e) => {
|
|
613
613
|
if (n) {
|
|
614
614
|
w(!0), p(void 0);
|
|
615
615
|
try {
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
} catch (
|
|
619
|
-
console.error("File upload failed:",
|
|
620
|
-
|
|
616
|
+
const s = await n(e, e.name);
|
|
617
|
+
s.success && s.url ? I(s.url) : p(s.error || "Upload failed");
|
|
618
|
+
} catch (s) {
|
|
619
|
+
console.error("File upload failed:", s), p(
|
|
620
|
+
s instanceof Error ? s.message : "File upload failed"
|
|
621
621
|
);
|
|
622
622
|
} finally {
|
|
623
623
|
w(!1);
|
|
@@ -625,12 +625,12 @@ function q(t, n) {
|
|
|
625
625
|
}
|
|
626
626
|
},
|
|
627
627
|
[n]
|
|
628
|
-
), a =
|
|
628
|
+
), a = R(async () => {
|
|
629
629
|
if (!(!n || !o)) {
|
|
630
630
|
w(!0), p(void 0);
|
|
631
631
|
try {
|
|
632
|
-
const e = new Blob([o], { type: "text/plain; charset=utf-8" }),
|
|
633
|
-
|
|
632
|
+
const e = new Blob([o], { type: "text/plain; charset=utf-8" }), s = `writing-${t.id}-${Date.now()}.txt`, l = await n(e, s);
|
|
633
|
+
l.success && l.url ? I(l.url) : p(l.error || "Upload failed");
|
|
634
634
|
} catch (e) {
|
|
635
635
|
console.error("Text upload failed:", e), p(
|
|
636
636
|
e instanceof Error ? e.message : "Text upload failed"
|
|
@@ -639,7 +639,7 @@ function q(t, n) {
|
|
|
639
639
|
w(!1);
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
}, [o, t.id, n]),
|
|
642
|
+
}, [o, t.id, n]), c = T(
|
|
643
643
|
() => ({
|
|
644
644
|
questionId: t.id || "",
|
|
645
645
|
type: "writing",
|
|
@@ -647,8 +647,8 @@ function q(t, n) {
|
|
|
647
647
|
fileUrl: h
|
|
648
648
|
}),
|
|
649
649
|
[t.id, o, h]
|
|
650
|
-
),
|
|
651
|
-
|
|
650
|
+
), i = R(() => (C(), c), [C, c]), r = R(() => {
|
|
651
|
+
d(""), I(void 0), p(void 0), S();
|
|
652
652
|
}, [S]);
|
|
653
653
|
return {
|
|
654
654
|
question: t,
|
|
@@ -656,66 +656,69 @@ function q(t, n) {
|
|
|
656
656
|
submitted: f,
|
|
657
657
|
attempts: b,
|
|
658
658
|
text: o,
|
|
659
|
-
setText:
|
|
659
|
+
setText: d,
|
|
660
660
|
fileUrl: h,
|
|
661
661
|
setFileUrl: I,
|
|
662
662
|
isUploading: v,
|
|
663
663
|
uploadError: m,
|
|
664
|
-
uploadFile:
|
|
664
|
+
uploadFile: x,
|
|
665
665
|
uploadText: a,
|
|
666
|
-
submit:
|
|
666
|
+
submit: i,
|
|
667
667
|
reset: r,
|
|
668
|
-
payload:
|
|
668
|
+
payload: c
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
|
-
function
|
|
672
|
-
const { canAnswer: u, submitted: f, attempts: b, submitQuestion: C, resetQuestion: S } =
|
|
671
|
+
function st(t, n) {
|
|
672
|
+
const { canAnswer: u, submitted: f, attempts: b, submitQuestion: C, resetQuestion: S } = E(), [o, d] = A(void 0), [h, I] = A("idle"), [v, w] = A(0), [m, p] = A(!1), [x, a] = A(void 0), [c, i] = A(!1), r = _(null), e = _([]), s = _(null), l = _(null), g = R(async () => {
|
|
673
|
+
i(!0);
|
|
673
674
|
try {
|
|
674
675
|
const Q = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
675
|
-
|
|
676
|
+
l.current = Q;
|
|
676
677
|
const k = new MediaRecorder(Q);
|
|
677
|
-
|
|
678
|
-
|
|
678
|
+
r.current = k, e.current = [], k.ondataavailable = (F) => {
|
|
679
|
+
F.data.size > 0 && e.current.push(F.data);
|
|
679
680
|
}, k.onstop = () => {
|
|
680
|
-
const
|
|
681
|
+
const F = new Blob(e.current, {
|
|
681
682
|
type: "audio/webm"
|
|
682
|
-
}),
|
|
683
|
-
|
|
684
|
-
}, k.start(), I("recording"), w(0)
|
|
685
|
-
|
|
683
|
+
}), P = URL.createObjectURL(F);
|
|
684
|
+
d(P);
|
|
685
|
+
}, k.start(), I("recording"), w(0);
|
|
686
|
+
let O = 0;
|
|
687
|
+
s.current = setInterval(() => {
|
|
688
|
+
O++, w((F) => F + 1), O >= (t.metadata?.max_recording_time || 300) && B();
|
|
686
689
|
}, 1e3);
|
|
687
690
|
} catch (Q) {
|
|
688
691
|
console.error("Failed to start recording:", Q), a("Failed to access microphone");
|
|
689
692
|
}
|
|
690
|
-
}, []),
|
|
691
|
-
|
|
692
|
-
}, [h]),
|
|
693
|
-
|
|
693
|
+
}, []), y = R(() => {
|
|
694
|
+
r.current && h === "recording" && (r.current.pause(), I("paused"), s.current && clearInterval(s.current));
|
|
695
|
+
}, [h]), U = R(() => {
|
|
696
|
+
r.current && h === "paused" && (r.current.resume(), I("recording"), s.current = setInterval(() => {
|
|
694
697
|
w((Q) => Q + 1);
|
|
695
698
|
}, 1e3));
|
|
696
|
-
}, [h]),
|
|
697
|
-
|
|
698
|
-
}, [h]),
|
|
699
|
-
if (!(!
|
|
699
|
+
}, [h]), B = R(() => {
|
|
700
|
+
r.current && h !== "idle" && (r.current.stop(), I("stopped"), s.current && clearInterval(s.current), l.current && l.current.getTracks().forEach((Q) => Q.stop()), i(!1));
|
|
701
|
+
}, [h]), L = R(() => c ? B() : g(), []), M = R(async () => {
|
|
702
|
+
if (!(!e.current.length || !n)) {
|
|
700
703
|
p(!0), a(void 0);
|
|
701
704
|
try {
|
|
702
|
-
const Q = new Blob(
|
|
705
|
+
const Q = new Blob(e.current, {
|
|
703
706
|
type: "audio/webm"
|
|
704
|
-
}), k = `speaking-${t.id}-${Date.now()}.webm`,
|
|
705
|
-
|
|
707
|
+
}), k = `speaking-${t.id}-${Date.now()}.webm`, O = await n(Q, k);
|
|
708
|
+
O.success && O.url ? d(O.url) : a(O.error || "Upload failed");
|
|
706
709
|
} catch (Q) {
|
|
707
710
|
console.error("Upload failed:", Q), a(Q instanceof Error ? Q.message : "Upload failed");
|
|
708
711
|
} finally {
|
|
709
712
|
p(!1);
|
|
710
713
|
}
|
|
711
714
|
}
|
|
712
|
-
}, [t.id, n]),
|
|
715
|
+
}, [t.id, n]), D = R(
|
|
713
716
|
async (Q) => {
|
|
714
717
|
if (n) {
|
|
715
718
|
p(!0), a(void 0);
|
|
716
719
|
try {
|
|
717
720
|
const k = await n(Q, Q.name);
|
|
718
|
-
k.success && k.url ?
|
|
721
|
+
k.success && k.url ? d(k.url) : a(k.error || "Upload failed");
|
|
719
722
|
} catch (k) {
|
|
720
723
|
console.error("File upload failed:", k), a(
|
|
721
724
|
k instanceof Error ? k.message : "File upload failed"
|
|
@@ -726,15 +729,15 @@ function tt(t, n) {
|
|
|
726
729
|
}
|
|
727
730
|
},
|
|
728
731
|
[n]
|
|
729
|
-
),
|
|
732
|
+
), j = T(
|
|
730
733
|
() => ({
|
|
731
734
|
questionId: t.id || "",
|
|
732
735
|
type: "speaking",
|
|
733
736
|
audioUrl: o
|
|
734
737
|
}),
|
|
735
738
|
[t.id, o]
|
|
736
|
-
),
|
|
737
|
-
|
|
739
|
+
), G = R(() => (C(), j), [C, j]), N = R(() => {
|
|
740
|
+
d(void 0), I("idle"), w(0), a(void 0), e.current = [], s.current && clearInterval(s.current), l.current && l.current.getTracks().forEach((Q) => Q.stop()), S();
|
|
738
741
|
}, [S]);
|
|
739
742
|
return {
|
|
740
743
|
question: t,
|
|
@@ -742,125 +745,127 @@ function tt(t, n) {
|
|
|
742
745
|
submitted: f,
|
|
743
746
|
attempts: b,
|
|
744
747
|
audioUrl: o,
|
|
745
|
-
setAudioUrl: l,
|
|
746
748
|
recordingState: h,
|
|
747
749
|
recordingTime: v,
|
|
748
750
|
isUploading: m,
|
|
749
|
-
uploadError:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
751
|
+
uploadError: x,
|
|
752
|
+
isRecording: c,
|
|
753
|
+
payload: j,
|
|
754
|
+
setAudioUrl: d,
|
|
755
|
+
startRecording: g,
|
|
756
|
+
pauseRecording: y,
|
|
757
|
+
resumeRecording: U,
|
|
758
|
+
stopRecording: B,
|
|
759
|
+
toggleRecording: L,
|
|
760
|
+
uploadAudio: M,
|
|
761
|
+
uploadFile: D,
|
|
762
|
+
submit: G,
|
|
763
|
+
reset: N
|
|
759
764
|
};
|
|
760
765
|
}
|
|
761
|
-
function
|
|
766
|
+
function ct({
|
|
762
767
|
getData: t,
|
|
763
768
|
children: n
|
|
764
769
|
}) {
|
|
765
|
-
const u =
|
|
770
|
+
const u = X(t());
|
|
766
771
|
return n(u);
|
|
767
772
|
}
|
|
768
|
-
function
|
|
773
|
+
function ut({
|
|
769
774
|
getData: t,
|
|
770
775
|
children: n
|
|
771
776
|
}) {
|
|
772
|
-
const u =
|
|
777
|
+
const u = Y(t());
|
|
773
778
|
return n(u);
|
|
774
779
|
}
|
|
775
|
-
function
|
|
780
|
+
function at({
|
|
776
781
|
getData: t,
|
|
777
782
|
children: n
|
|
778
783
|
}) {
|
|
779
|
-
const u =
|
|
784
|
+
const u = Z(t());
|
|
780
785
|
return n(u);
|
|
781
786
|
}
|
|
782
|
-
function
|
|
787
|
+
function lt({
|
|
783
788
|
getData: t,
|
|
784
789
|
children: n
|
|
785
790
|
}) {
|
|
786
|
-
const u =
|
|
791
|
+
const u = K(t());
|
|
787
792
|
return n(u);
|
|
788
793
|
}
|
|
789
|
-
function
|
|
794
|
+
function dt({
|
|
790
795
|
getData: t,
|
|
791
796
|
children: n
|
|
792
797
|
}) {
|
|
793
|
-
const u =
|
|
798
|
+
const u = H(t());
|
|
794
799
|
return n(u);
|
|
795
800
|
}
|
|
796
|
-
function
|
|
801
|
+
function ft({
|
|
797
802
|
getData: t,
|
|
798
803
|
children: n
|
|
799
804
|
}) {
|
|
800
|
-
const u =
|
|
805
|
+
const u = q(t());
|
|
801
806
|
return n(u);
|
|
802
807
|
}
|
|
803
|
-
function
|
|
808
|
+
function pt({
|
|
804
809
|
getData: t,
|
|
805
810
|
children: n
|
|
806
811
|
}) {
|
|
807
|
-
const u =
|
|
812
|
+
const u = tt(t());
|
|
808
813
|
return n(u);
|
|
809
814
|
}
|
|
810
|
-
function
|
|
815
|
+
function mt({
|
|
811
816
|
getData: t,
|
|
812
817
|
children: n
|
|
813
818
|
}) {
|
|
814
|
-
const u =
|
|
819
|
+
const u = et(t());
|
|
815
820
|
return n(u);
|
|
816
821
|
}
|
|
817
|
-
function
|
|
822
|
+
function gt({
|
|
818
823
|
getData: t,
|
|
819
824
|
children: n
|
|
820
825
|
}) {
|
|
821
|
-
const u =
|
|
826
|
+
const u = rt(t());
|
|
822
827
|
return n(u);
|
|
823
828
|
}
|
|
824
|
-
function
|
|
829
|
+
function bt({
|
|
825
830
|
getData: t,
|
|
826
831
|
children: n,
|
|
827
832
|
uploadHandler: u
|
|
828
833
|
}) {
|
|
829
|
-
const f = t(), b =
|
|
830
|
-
return /* @__PURE__ */
|
|
834
|
+
const f = t(), b = nt(f, u);
|
|
835
|
+
return /* @__PURE__ */ W($, { children: n(b) });
|
|
831
836
|
}
|
|
832
|
-
function
|
|
837
|
+
function wt({
|
|
833
838
|
getData: t,
|
|
834
839
|
children: n,
|
|
835
840
|
uploadHandler: u
|
|
836
841
|
}) {
|
|
837
|
-
const f = t(), b =
|
|
838
|
-
return /* @__PURE__ */
|
|
842
|
+
const f = t(), b = st(f, u);
|
|
843
|
+
return /* @__PURE__ */ W($, { children: n(b) });
|
|
839
844
|
}
|
|
840
845
|
export {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
846
|
+
lt as DragDropQuestion,
|
|
847
|
+
pt as FillInBlankQuestion,
|
|
848
|
+
mt as GroupingQuestion,
|
|
849
|
+
ft as LabelingQuestion,
|
|
850
|
+
ut as MatchingQuestion,
|
|
851
|
+
ct as MultipleChoicesQuestion,
|
|
852
|
+
dt as OrderingQuestion,
|
|
853
|
+
gt as PowerpointQuestion,
|
|
854
|
+
wt as SpeakingQuestion,
|
|
855
|
+
at as VideoQuestion,
|
|
856
|
+
bt as WritingQuestion,
|
|
857
|
+
J as isSameSet,
|
|
858
|
+
z as shuffleArray,
|
|
859
|
+
E as useBaseQuestion,
|
|
860
|
+
K as useDragDrop,
|
|
861
|
+
tt as useFillInBlank,
|
|
862
|
+
et as useGrouping,
|
|
863
|
+
q as useLabeling,
|
|
864
|
+
Y as useMatching,
|
|
865
|
+
X as useMultipleChoice,
|
|
866
|
+
H as useOrdering,
|
|
867
|
+
rt as usePowerpoint,
|
|
868
|
+
st as useSpeaking,
|
|
869
|
+
Z as useVideo,
|
|
870
|
+
nt as useWriting
|
|
866
871
|
};
|