@jswork/react-questkit 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +594 -551
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +24 -22
- package/dist/index.d.ts +24 -22
- package/dist/index.mjs +570 -527
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +2 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -208,104 +208,8 @@ function classNames(...values) {
|
|
|
208
208
|
return classnames(...values);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
// src/core/icons.tsx
|
|
212
|
-
import classnames2 from "classnames";
|
|
213
|
-
|
|
214
|
-
// src/assets/svg/icon-alert.svg
|
|
215
|
-
var icon_alert_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="2"></circle><path d="M12 7.5v5.5" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"></path><circle cx="12" cy="16.6" r="1.2" fill="currentColor" stroke="none"></circle></svg>\n';
|
|
216
|
-
|
|
217
|
-
// src/assets/svg/icon-back.svg
|
|
218
|
-
var icon_back_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M14.5 5.5L8 12l6.5 6.5" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"></path></svg>\n';
|
|
219
|
-
|
|
220
|
-
// src/assets/svg/icon-check.svg
|
|
221
|
-
var icon_check_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M5 12.5l4.6 4.6L19 7.4" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"></path></svg>\n';
|
|
222
|
-
|
|
223
|
-
// src/assets/svg/icon-cross.svg
|
|
224
|
-
var icon_cross_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"></path></svg>\n';
|
|
225
|
-
|
|
226
|
-
// src/assets/svg/icon-fullscreen.svg
|
|
227
|
-
var icon_fullscreen_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M4.6 9V4.6H9M15 4.6h4.4V9M19.4 15v4.4H15M9 19.4H4.6V15" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"></path></svg>\n';
|
|
228
|
-
|
|
229
|
-
// src/assets/svg/icon-keyboard.svg
|
|
230
|
-
var icon_keyboard_default = '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><rect x="2.5" y="6" width="19" height="12" rx="3" stroke="currentColor" stroke-width="1.6"></rect><path d="M7 10h.01M10.5 10h.01M14 10h.01M17.5 10h.01M8 14h8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path></svg>\n';
|
|
231
|
-
|
|
232
|
-
// src/assets/svg/icon-loop.svg
|
|
233
|
-
var icon_loop_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M5.4 10.4A6.6 6.6 0 0118 9.4M18.6 13.6A6.6 6.6 0 016 14.6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M18.6 5.6v4h-4M5.4 18.4v-4h4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>\n';
|
|
234
|
-
|
|
235
|
-
// src/assets/svg/icon-mic.svg
|
|
236
|
-
var icon_mic_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><rect x="9" y="3.6" width="6" height="10" rx="3" stroke="currentColor" stroke-width="1.9"></rect><path d="M5.6 11.4a6.4 6.4 0 0012.8 0" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"></path><path d="M12 17.8V21M9 21h6" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"></path></svg>\n';
|
|
237
|
-
|
|
238
|
-
// src/assets/svg/icon-pause.svg
|
|
239
|
-
var icon_pause_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><rect x="7" y="5.5" width="3.6" height="13" rx="1.4" fill="currentColor"></rect><rect x="13.4" y="5.5" width="3.6" height="13" rx="1.4" fill="currentColor"></rect></svg>\n';
|
|
240
|
-
|
|
241
|
-
// src/assets/svg/icon-play.svg
|
|
242
|
-
var icon_play_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M8 5.4l10.2 6.6L8 18.6V5.4z" fill="currentColor" stroke="currentColor" stroke-width="0.6" stroke-linejoin="round"></path></svg>\n';
|
|
243
|
-
|
|
244
|
-
// src/assets/svg/icon-speaker.svg
|
|
245
|
-
var icon_speaker_default = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M4 9.6h3.2L12 5.4v13.2L7.2 14.4H4z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"></path><path d="M15.6 9.2a4 4 0 010 5.6M18.2 6.8a7.4 7.4 0 010 10.4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path></svg>\n';
|
|
246
|
-
|
|
247
|
-
// src/core/icons.tsx
|
|
248
|
-
import { jsx } from "react/jsx-runtime";
|
|
249
|
-
function SvgIcon(_a) {
|
|
250
|
-
var _b = _a, {
|
|
251
|
-
source,
|
|
252
|
-
size,
|
|
253
|
-
className,
|
|
254
|
-
style
|
|
255
|
-
} = _b, rest = __objRest(_b, [
|
|
256
|
-
"source",
|
|
257
|
-
"size",
|
|
258
|
-
"className",
|
|
259
|
-
"style"
|
|
260
|
-
]);
|
|
261
|
-
const html = size ? source.replace("<svg", '<svg style="width:100%;height:100%"') : source;
|
|
262
|
-
return /* @__PURE__ */ jsx(
|
|
263
|
-
"span",
|
|
264
|
-
__spreadProps(__spreadValues({
|
|
265
|
-
className: classnames2("rqk-icon", className),
|
|
266
|
-
style: size ? __spreadValues({ width: size, height: size }, style) : style,
|
|
267
|
-
"aria-hidden": true
|
|
268
|
-
}, rest), {
|
|
269
|
-
dangerouslySetInnerHTML: { __html: html }
|
|
270
|
-
})
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
function CheckIcon(props) {
|
|
274
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_check_default }, props));
|
|
275
|
-
}
|
|
276
|
-
function CrossIcon(props) {
|
|
277
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_cross_default }, props));
|
|
278
|
-
}
|
|
279
|
-
function AlertIcon(props) {
|
|
280
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_alert_default }, props));
|
|
281
|
-
}
|
|
282
|
-
function PlayIcon(props) {
|
|
283
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_play_default }, props));
|
|
284
|
-
}
|
|
285
|
-
function PauseIcon(props) {
|
|
286
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_pause_default }, props));
|
|
287
|
-
}
|
|
288
|
-
function MicIcon(props) {
|
|
289
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_mic_default }, props));
|
|
290
|
-
}
|
|
291
|
-
function SpeakerIcon(props) {
|
|
292
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_speaker_default }, props));
|
|
293
|
-
}
|
|
294
|
-
function BackIcon(props) {
|
|
295
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_back_default }, props));
|
|
296
|
-
}
|
|
297
|
-
function LoopIcon(props) {
|
|
298
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_loop_default }, props));
|
|
299
|
-
}
|
|
300
|
-
function FullscreenIcon(props) {
|
|
301
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_fullscreen_default }, props));
|
|
302
|
-
}
|
|
303
|
-
function KeyboardIcon(props) {
|
|
304
|
-
return /* @__PURE__ */ jsx(SvgIcon, __spreadValues({ source: icon_keyboard_default }, props));
|
|
305
|
-
}
|
|
306
|
-
|
|
307
211
|
// src/primitives/instruction.tsx
|
|
308
|
-
import { jsx
|
|
212
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
309
213
|
function Instruction({
|
|
310
214
|
children,
|
|
311
215
|
icon = true,
|
|
@@ -317,20 +221,36 @@ function Instruction({
|
|
|
317
221
|
"div",
|
|
318
222
|
{
|
|
319
223
|
className: classNames(
|
|
320
|
-
"rqk-instruction",
|
|
321
|
-
variant
|
|
224
|
+
"rqk-instruction flex flex-none items-start gap-2 px-3 py-2.5",
|
|
225
|
+
variant === "plain" ? "rqk-instruction-plain mx-5 mb-3 mt-1.5 gap-0 rounded-none bg-transparent p-0" : "rounded-[14px] bg-[rgba(228,237,255,0.6)]",
|
|
322
226
|
className
|
|
323
227
|
),
|
|
324
228
|
children: [
|
|
325
|
-
icon && variant !== "plain" ? /* @__PURE__ */
|
|
326
|
-
|
|
229
|
+
icon && variant !== "plain" ? /* @__PURE__ */ jsx(
|
|
230
|
+
"span",
|
|
231
|
+
{
|
|
232
|
+
className: "rqk-instruction-icon bg-rqk-blue-500 mt-px grid h-[18px] w-[18px] flex-none place-items-center rounded-full font-serif text-[11px] font-bold italic text-white",
|
|
233
|
+
"aria-hidden": true,
|
|
234
|
+
children: "i"
|
|
235
|
+
}
|
|
236
|
+
) : null,
|
|
237
|
+
/* @__PURE__ */ jsx(
|
|
238
|
+
"div",
|
|
239
|
+
{
|
|
240
|
+
className: classNames(
|
|
241
|
+
"rqk-instruction-text text-rqk-ink-2 text-[13px] leading-[1.55]",
|
|
242
|
+
variant === "plain" ? "text-rqk-cap text-rqk-ink-3 [&_b]:text-rqk-ink-3 [&_strong]:text-rqk-ink-3 font-semibold tracking-[0.1px] [&_b]:font-extrabold [&_strong]:font-extrabold" : "[&_b]:text-rqk-blue-500 [&_strong]:text-rqk-blue-500 [&_b]:font-semibold [&_strong]:font-semibold [&_u]:[text-decoration-color:var(--rqk-blue-300)] [&_u]:[text-underline-offset:3px]"
|
|
243
|
+
),
|
|
244
|
+
children
|
|
245
|
+
}
|
|
246
|
+
)
|
|
327
247
|
]
|
|
328
248
|
}
|
|
329
249
|
);
|
|
330
250
|
}
|
|
331
251
|
|
|
332
252
|
// src/primitives/progress.tsx
|
|
333
|
-
import { jsx as
|
|
253
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
334
254
|
function Progress({
|
|
335
255
|
value,
|
|
336
256
|
total,
|
|
@@ -343,7 +263,10 @@ function Progress({
|
|
|
343
263
|
return /* @__PURE__ */ jsxs2(
|
|
344
264
|
"div",
|
|
345
265
|
{
|
|
346
|
-
className: classNames(
|
|
266
|
+
className: classNames(
|
|
267
|
+
"rqk-progress flex flex-none items-center gap-3",
|
|
268
|
+
className
|
|
269
|
+
),
|
|
347
270
|
role: "progressbar",
|
|
348
271
|
"aria-label": ariaLabel,
|
|
349
272
|
"aria-valuenow": value,
|
|
@@ -351,12 +274,18 @@ function Progress({
|
|
|
351
274
|
"aria-valuemax": total,
|
|
352
275
|
"aria-valuetext": `${value}/${total}`,
|
|
353
276
|
children: [
|
|
354
|
-
showValue ? /* @__PURE__ */ jsxs2("span", { className: "rqk-progress-text", children: [
|
|
277
|
+
showValue ? /* @__PURE__ */ jsxs2("span", { className: "rqk-progress-text text-rqk-cap text-rqk-ink-2 min-w-[34px] flex-none font-extrabold leading-[1.2] tracking-[0.2px] [font-variant-numeric:tabular-nums]", children: [
|
|
355
278
|
value,
|
|
356
279
|
"/",
|
|
357
280
|
total
|
|
358
281
|
] }) : null,
|
|
359
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ jsx2("span", { className: "rqk-progress-track rounded-rqk-pill block h-2 flex-1 overflow-hidden bg-[#e9eef7] shadow-[inset_0_1px_2px_rgba(16,24,40,0.05)]", children: /* @__PURE__ */ jsx2(
|
|
283
|
+
"span",
|
|
284
|
+
{
|
|
285
|
+
className: "rqk-progress-fill ease-rqk-ease block h-full rounded-[inherit] bg-[linear-gradient(90deg,#5b95ff,var(--rqk-blue-500)_76%)] shadow-[inset_0_1px_0_rgba(255,255,255,0.28)] transition-[width] duration-[450ms] will-change-[width]",
|
|
286
|
+
style: { width: `${percent}%` }
|
|
287
|
+
}
|
|
288
|
+
) })
|
|
360
289
|
]
|
|
361
290
|
}
|
|
362
291
|
);
|
|
@@ -372,7 +301,7 @@ import {
|
|
|
372
301
|
useRef as useRef2,
|
|
373
302
|
useState as useState2
|
|
374
303
|
} from "react";
|
|
375
|
-
import { jsx as
|
|
304
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
376
305
|
var QuestToastContext = createContext({ show: () => void 0 });
|
|
377
306
|
function useQuestToast() {
|
|
378
307
|
return useContext(QuestToastContext);
|
|
@@ -396,67 +325,157 @@ function useToastController() {
|
|
|
396
325
|
}
|
|
397
326
|
function Toast({ children, align = "center", className }) {
|
|
398
327
|
if (!children) return null;
|
|
399
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ jsx3(
|
|
329
|
+
"div",
|
|
330
|
+
{
|
|
331
|
+
className: classNames(
|
|
332
|
+
"rqk-toast rounded-rqk-pill animate-rqk-toast-in absolute bottom-28 z-20 max-w-[78%] bg-[rgba(15,23,42,0.88)] px-4 py-[9px] text-center text-[13px] leading-[1.4] text-white shadow-[0_12px_26px_-10px_rgba(15,23,42,0.5)] backdrop-blur-[8px]",
|
|
333
|
+
`rqk-toast-${align}`,
|
|
334
|
+
align === "left" && "left-5 right-auto translate-x-0 text-left",
|
|
335
|
+
align === "right" && "left-auto right-5 translate-x-0 text-right",
|
|
336
|
+
align === "center" && "left-1/2 -translate-x-1/2",
|
|
337
|
+
className
|
|
338
|
+
),
|
|
339
|
+
role: "status",
|
|
340
|
+
children
|
|
341
|
+
}
|
|
342
|
+
);
|
|
400
343
|
}
|
|
401
344
|
function QuestToastProvider({ api, children }) {
|
|
402
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ jsx3(QuestToastContext.Provider, { value: api, children });
|
|
403
346
|
}
|
|
404
347
|
|
|
405
348
|
// src/primitives/quest-shell.tsx
|
|
406
|
-
import { jsx as
|
|
349
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
407
350
|
function QuestShell({
|
|
408
351
|
mode = "answer",
|
|
409
|
-
title,
|
|
410
352
|
index = 1,
|
|
411
353
|
total = 99,
|
|
412
354
|
instruction,
|
|
413
355
|
instructionVariant = "card",
|
|
414
|
-
onBack,
|
|
415
356
|
footer,
|
|
416
357
|
feedback,
|
|
417
|
-
frame = false,
|
|
418
|
-
statusBar,
|
|
419
358
|
dataQuest,
|
|
420
359
|
className,
|
|
421
360
|
children
|
|
422
361
|
}) {
|
|
423
362
|
const { toast, api } = useToastController();
|
|
424
|
-
|
|
425
|
-
return /* @__PURE__ */ jsx5(QuestToastProvider, { api, children: /* @__PURE__ */ jsxs3(
|
|
363
|
+
return /* @__PURE__ */ jsx4(QuestToastProvider, { api, children: /* @__PURE__ */ jsxs3(
|
|
426
364
|
"div",
|
|
427
365
|
{
|
|
428
|
-
className: classNames(
|
|
366
|
+
className: classNames(
|
|
367
|
+
"rqk-shell relative isolate flex h-full w-full min-h-0 flex-col overflow-hidden bg-[var(--rqk-screen-bg)]",
|
|
368
|
+
className
|
|
369
|
+
),
|
|
429
370
|
"data-component": "react-questkit",
|
|
430
371
|
"data-mode": mode,
|
|
431
372
|
"data-quest": dataQuest,
|
|
432
373
|
children: [
|
|
433
|
-
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
] }) : null,
|
|
442
|
-
/* @__PURE__ */ jsxs3("header", { className: "rqk-nav", children: [
|
|
443
|
-
onBack ? /* @__PURE__ */ jsx5("button", { type: "button", className: "rqk-nav-back", onClick: onBack, "aria-label": "\u8FD4\u56DE", children: /* @__PURE__ */ jsx5(BackIcon, { size: 20 }) }) : /* @__PURE__ */ jsx5("span", { className: "rqk-nav-spacer" }),
|
|
444
|
-
/* @__PURE__ */ jsx5("div", { className: "rqk-nav-title", children: title }),
|
|
445
|
-
/* @__PURE__ */ jsx5("span", { className: "rqk-nav-spacer" })
|
|
446
|
-
] }),
|
|
447
|
-
/* @__PURE__ */ jsx5(Progress, { value: index, total }),
|
|
448
|
-
/* @__PURE__ */ jsx5(Instruction, { variant: instructionVariant, children: instruction }),
|
|
449
|
-
/* @__PURE__ */ jsxs3("div", { className: "rqk-body", children: [
|
|
450
|
-
children,
|
|
451
|
-
feedback ? /* @__PURE__ */ jsx5("div", { className: "rqk-feedback-wrap", children: feedback }) : null,
|
|
452
|
-
/* @__PURE__ */ jsx5(Toast, { align: toast == null ? void 0 : toast.align, children: toast == null ? void 0 : toast.message })
|
|
374
|
+
/* @__PURE__ */ jsxs3("div", { className: "rqk-body relative flex min-h-0 flex-1 flex-col", children: [
|
|
375
|
+
/* @__PURE__ */ jsxs3("div", { className: "rqk-page", children: [
|
|
376
|
+
/* @__PURE__ */ jsx4(Progress, { value: index, total }),
|
|
377
|
+
/* @__PURE__ */ jsx4(Instruction, { variant: instructionVariant, children: instruction }),
|
|
378
|
+
children
|
|
379
|
+
] }),
|
|
380
|
+
feedback ? /* @__PURE__ */ jsx4("div", { className: "rqk-feedback-wrap pointer-events-none absolute inset-x-5 bottom-24 z-[4] [&>*]:pointer-events-auto", children: feedback }) : null,
|
|
381
|
+
/* @__PURE__ */ jsx4(Toast, { align: toast == null ? void 0 : toast.align, children: toast == null ? void 0 : toast.message })
|
|
453
382
|
] }),
|
|
454
|
-
footer ? /* @__PURE__ */
|
|
383
|
+
footer ? /* @__PURE__ */ jsx4("div", { className: "rqk-footer absolute inset-x-0 bottom-0 z-[5] [background:linear-gradient(180deg,rgba(246,248,252,0)_0%,rgba(246,248,252,0.9)_32%,var(--rqk-screen-bg)_66%)]", children: footer }) : null
|
|
455
384
|
]
|
|
456
385
|
}
|
|
457
386
|
) });
|
|
458
387
|
}
|
|
459
388
|
|
|
389
|
+
// src/core/icons.tsx
|
|
390
|
+
import classnames2 from "classnames";
|
|
391
|
+
|
|
392
|
+
// src/assets/svg/icon-alert.svg
|
|
393
|
+
var icon_alert_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><circle cx="12" cy="12" r="9" stroke="currentColor" stroke-width="2"></circle><path d="M12 7.5v5.5" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"></path><circle cx="12" cy="16.6" r="1.2" fill="currentColor" stroke="none"></circle></svg>\n';
|
|
394
|
+
|
|
395
|
+
// src/assets/svg/icon-check.svg
|
|
396
|
+
var icon_check_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M5 12.5l4.6 4.6L19 7.4" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"></path></svg>\n';
|
|
397
|
+
|
|
398
|
+
// src/assets/svg/icon-cross.svg
|
|
399
|
+
var icon_cross_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"></path></svg>\n';
|
|
400
|
+
|
|
401
|
+
// src/assets/svg/icon-fullscreen.svg
|
|
402
|
+
var icon_fullscreen_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M4.6 9V4.6H9M15 4.6h4.4V9M19.4 15v4.4H15M9 19.4H4.6V15" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"></path></svg>\n';
|
|
403
|
+
|
|
404
|
+
// src/assets/svg/icon-keyboard.svg
|
|
405
|
+
var icon_keyboard_default = '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><rect x="2.5" y="6" width="19" height="12" rx="3" stroke="currentColor" stroke-width="1.6"></rect><path d="M7 10h.01M10.5 10h.01M14 10h.01M17.5 10h.01M8 14h8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path></svg>\n';
|
|
406
|
+
|
|
407
|
+
// src/assets/svg/icon-loop.svg
|
|
408
|
+
var icon_loop_default = '<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M5.4 10.4A6.6 6.6 0 0118 9.4M18.6 13.6A6.6 6.6 0 016 14.6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path><path d="M18.6 5.6v4h-4M5.4 18.4v-4h4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path></svg>\n';
|
|
409
|
+
|
|
410
|
+
// src/assets/svg/icon-mic.svg
|
|
411
|
+
var icon_mic_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><rect x="9" y="3.6" width="6" height="10" rx="3" stroke="currentColor" stroke-width="1.9"></rect><path d="M5.6 11.4a6.4 6.4 0 0012.8 0" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"></path><path d="M12 17.8V21M9 21h6" stroke="currentColor" stroke-width="1.9" stroke-linecap="round"></path></svg>\n';
|
|
412
|
+
|
|
413
|
+
// src/assets/svg/icon-pause.svg
|
|
414
|
+
var icon_pause_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><rect x="7" y="5.5" width="3.6" height="13" rx="1.4" fill="currentColor"></rect><rect x="13.4" y="5.5" width="3.6" height="13" rx="1.4" fill="currentColor"></rect></svg>\n';
|
|
415
|
+
|
|
416
|
+
// src/assets/svg/icon-play.svg
|
|
417
|
+
var icon_play_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M8 5.4l10.2 6.6L8 18.6V5.4z" fill="currentColor" stroke="currentColor" stroke-width="0.6" stroke-linejoin="round"></path></svg>\n';
|
|
418
|
+
|
|
419
|
+
// src/assets/svg/icon-speaker.svg
|
|
420
|
+
var icon_speaker_default = '<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" focusable="false" aria-hidden="true"><path d="M4 9.6h3.2L12 5.4v13.2L7.2 14.4H4z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"></path><path d="M15.6 9.2a4 4 0 010 5.6M18.2 6.8a7.4 7.4 0 010 10.4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"></path></svg>\n';
|
|
421
|
+
|
|
422
|
+
// src/core/icons.tsx
|
|
423
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
424
|
+
function SvgIcon(_a) {
|
|
425
|
+
var _b = _a, {
|
|
426
|
+
source,
|
|
427
|
+
size,
|
|
428
|
+
className,
|
|
429
|
+
style
|
|
430
|
+
} = _b, rest = __objRest(_b, [
|
|
431
|
+
"source",
|
|
432
|
+
"size",
|
|
433
|
+
"className",
|
|
434
|
+
"style"
|
|
435
|
+
]);
|
|
436
|
+
const html = size ? source.replace("<svg", '<svg style="width:100%;height:100%"') : source;
|
|
437
|
+
return /* @__PURE__ */ jsx5(
|
|
438
|
+
"span",
|
|
439
|
+
__spreadProps(__spreadValues({
|
|
440
|
+
className: classnames2("rqk-icon", className),
|
|
441
|
+
style: size ? __spreadValues({ width: size, height: size }, style) : style,
|
|
442
|
+
"aria-hidden": true
|
|
443
|
+
}, rest), {
|
|
444
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
445
|
+
})
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
function CheckIcon(props) {
|
|
449
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_check_default }, props));
|
|
450
|
+
}
|
|
451
|
+
function CrossIcon(props) {
|
|
452
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_cross_default }, props));
|
|
453
|
+
}
|
|
454
|
+
function AlertIcon(props) {
|
|
455
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_alert_default }, props));
|
|
456
|
+
}
|
|
457
|
+
function PlayIcon(props) {
|
|
458
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_play_default }, props));
|
|
459
|
+
}
|
|
460
|
+
function PauseIcon(props) {
|
|
461
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_pause_default }, props));
|
|
462
|
+
}
|
|
463
|
+
function MicIcon(props) {
|
|
464
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_mic_default }, props));
|
|
465
|
+
}
|
|
466
|
+
function SpeakerIcon(props) {
|
|
467
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_speaker_default }, props));
|
|
468
|
+
}
|
|
469
|
+
function LoopIcon(props) {
|
|
470
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_loop_default }, props));
|
|
471
|
+
}
|
|
472
|
+
function FullscreenIcon(props) {
|
|
473
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_fullscreen_default }, props));
|
|
474
|
+
}
|
|
475
|
+
function KeyboardIcon(props) {
|
|
476
|
+
return /* @__PURE__ */ jsx5(SvgIcon, __spreadValues({ source: icon_keyboard_default }, props));
|
|
477
|
+
}
|
|
478
|
+
|
|
460
479
|
// src/primitives/option-item.tsx
|
|
461
480
|
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
462
481
|
function OptionItem({
|
|
@@ -660,31 +679,114 @@ function SegmentedControl({
|
|
|
660
679
|
);
|
|
661
680
|
}
|
|
662
681
|
|
|
682
|
+
// src/core/quest-config.tsx
|
|
683
|
+
import { createContext as createContext2, useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
684
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
685
|
+
var defaultQuestLabels = {
|
|
686
|
+
submit: "\u63D0\u4EA4\u7B54\u6848",
|
|
687
|
+
submitCount: "\u63D0\u4EA4\u7B54\u6848",
|
|
688
|
+
retry: "\u91CD\u8BD5\u4E00\u6B21",
|
|
689
|
+
next: "\u5207\u9898",
|
|
690
|
+
prev: "\u4E0A\u4E00\u9898",
|
|
691
|
+
back: "\u8FD4\u56DE",
|
|
692
|
+
answer: "\u6B63\u786E\u7B54\u6848",
|
|
693
|
+
analysis: "\u89E3\u6790",
|
|
694
|
+
correctAll: "\u5168\u90E8\u7B54\u5BF9",
|
|
695
|
+
wrongAnswer: "\u7B54\u6848\u8FD8\u4E0D\u6B63\u786E",
|
|
696
|
+
tapToRead: "\u70B9\u51FB\u6717\u8BFB",
|
|
697
|
+
readAloud: "\u8303\u8BFB",
|
|
698
|
+
recording: "\u5F55\u97F3\u4E2D",
|
|
699
|
+
scoring: "\u8BC4\u5206\u4E2D",
|
|
700
|
+
releaseToSend: "\u677E\u624B\u5373\u63D0\u4EA4",
|
|
701
|
+
holdToRecord: "\u70B9\u51FB\u5F00\u59CB\u5F55\u97F3",
|
|
702
|
+
tapToFollow: "\u70B9\u51FB\u8DDF\u8BFB",
|
|
703
|
+
recordingHint: "\u6B63\u5728\u5F55\u97F3 \xB7 \u70B9\u51FB\u7ED3\u675F",
|
|
704
|
+
rescore: "\u91CD\u65B0\u5F55\u97F3",
|
|
705
|
+
submitted: "\u5DF2\u63D0\u4EA4 \xB7 \u53EF\u91CD\u5F55",
|
|
706
|
+
noiseHint: "\u97F3\u8D28\u4E0D\u5408\u683C\uFF1A\u4E0D\u51FA\u5206\uFF0C\u8BF7\u6362\u5B89\u9759\u73AF\u5883\u91CD\u8BD5",
|
|
707
|
+
againHint: "\u672A\u83B7\u53D6\u5206\u6570\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21",
|
|
708
|
+
attemptsLeft: "\u8FD8\u6709 {n} \u6B21\u5F55\u97F3\u673A\u4F1A",
|
|
709
|
+
attemptsUsedUp: "\u673A\u4F1A\u5DF2\u7528\u5B8C",
|
|
710
|
+
play: "\u64AD\u653E",
|
|
711
|
+
pause: "\u6682\u505C",
|
|
712
|
+
replay: "\u518D\u542C\u4E00\u904D",
|
|
713
|
+
loop: "\u5FAA\u73AF",
|
|
714
|
+
speed: "\u500D\u901F",
|
|
715
|
+
finish: "\u5B8C\u6210\u5E76\u8FD4\u56DE",
|
|
716
|
+
submitAndStats: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
|
|
717
|
+
effectivePlay: "\u6709\u6548\u64AD\u653E",
|
|
718
|
+
totalTime: "\u603B\u65F6\u957F",
|
|
719
|
+
reading: "\u9605\u8BFB",
|
|
720
|
+
expand: "\u5C55\u5F00\u5168\u6587",
|
|
721
|
+
collapse: "\u6536\u8D77",
|
|
722
|
+
notAnswered: "\u672A\u4F5C\u7B54",
|
|
723
|
+
fullscreen: "\u5168\u5C4F"
|
|
724
|
+
};
|
|
725
|
+
var QuestConfigContext = createContext2({});
|
|
726
|
+
function QuestConfigProvider({
|
|
727
|
+
config,
|
|
728
|
+
children
|
|
729
|
+
}) {
|
|
730
|
+
const parent = useContext2(QuestConfigContext);
|
|
731
|
+
const value = useMemo2(
|
|
732
|
+
() => {
|
|
733
|
+
var _a, _b;
|
|
734
|
+
return {
|
|
735
|
+
sound: (_a = config == null ? void 0 : config.sound) != null ? _a : parent.sound,
|
|
736
|
+
speakText: (_b = config == null ? void 0 : config.speakText) != null ? _b : parent.speakText,
|
|
737
|
+
labels: __spreadValues(__spreadValues({}, parent.labels), config == null ? void 0 : config.labels)
|
|
738
|
+
};
|
|
739
|
+
},
|
|
740
|
+
[config, parent]
|
|
741
|
+
);
|
|
742
|
+
return /* @__PURE__ */ jsx10(QuestConfigContext.Provider, { value, children });
|
|
743
|
+
}
|
|
744
|
+
function useQuestConfig() {
|
|
745
|
+
return useContext2(QuestConfigContext);
|
|
746
|
+
}
|
|
747
|
+
function useQuestLabels(override) {
|
|
748
|
+
const config = useQuestConfig();
|
|
749
|
+
return useMemo2(
|
|
750
|
+
() => __spreadValues(__spreadValues(__spreadValues({}, defaultQuestLabels), config.labels), override),
|
|
751
|
+
[config.labels, override]
|
|
752
|
+
);
|
|
753
|
+
}
|
|
754
|
+
|
|
663
755
|
// src/primitives/action-bar.tsx
|
|
664
|
-
import { jsx as
|
|
665
|
-
function ActionBar({ actions, className }) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
756
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
757
|
+
function ActionBar({ actions, index = 1, onPrev, className }) {
|
|
758
|
+
const labels = useQuestLabels();
|
|
759
|
+
const autoPrev = Boolean(onPrev) && index > 1;
|
|
760
|
+
const body = autoPrev ? actions.filter((action) => action.key !== "prev") : actions;
|
|
761
|
+
const visibleActions = autoPrev ? [
|
|
762
|
+
{
|
|
763
|
+
key: "prev",
|
|
764
|
+
label: labels.prev,
|
|
765
|
+
variant: "ghost",
|
|
766
|
+
onClick: onPrev,
|
|
767
|
+
ariaLabel: labels.prev
|
|
768
|
+
},
|
|
769
|
+
...body
|
|
770
|
+
] : body;
|
|
771
|
+
if (!visibleActions.length) return null;
|
|
772
|
+
return /* @__PURE__ */ jsx11("div", { className: classNames("rqk-action-bar flex gap-2.5", className), children: visibleActions.map((action) => /* @__PURE__ */ jsxs7(
|
|
773
|
+
"button",
|
|
774
|
+
{
|
|
775
|
+
type: "button",
|
|
776
|
+
className: classNames(
|
|
777
|
+
"rqk-action ease-rqk-spring inline-flex h-[52px] min-w-0 items-center justify-center gap-1.5 rounded-[16px] px-[18px] text-[17px] font-semibold transition-[transform,opacity,background] duration-200 active:scale-[0.98] disabled:opacity-45 disabled:active:scale-100",
|
|
778
|
+
action.variant === "ghost" ? "rqk-action-ghost text-rqk-ink-2 flex-none bg-white" : "rqk-action-primary disabled:bg-rqk-blue-300 flex-1 bg-[linear-gradient(180deg,#2c74ff,var(--rqk-blue-500)_70%)] text-white"
|
|
779
|
+
),
|
|
780
|
+
onClick: action.onClick,
|
|
781
|
+
disabled: action.disabled,
|
|
782
|
+
"aria-label": action.ariaLabel,
|
|
783
|
+
children: [
|
|
784
|
+
action.icon ? /* @__PURE__ */ jsx11("span", { className: "rqk-action-icon inline-flex items-center justify-center", children: action.icon }) : null,
|
|
785
|
+
/* @__PURE__ */ jsx11("span", { className: "rqk-action-label", children: action.label })
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
action.key
|
|
789
|
+
)) });
|
|
688
790
|
}
|
|
689
791
|
|
|
690
792
|
// src/questions/single-choice/actions.ts
|
|
@@ -693,16 +795,12 @@ function singleChoiceActions({
|
|
|
693
795
|
phase,
|
|
694
796
|
labels,
|
|
695
797
|
selected,
|
|
696
|
-
onPrev,
|
|
697
798
|
onNext,
|
|
698
799
|
onSubmit,
|
|
699
800
|
onRetry
|
|
700
801
|
}) {
|
|
701
802
|
const actions = [];
|
|
702
803
|
if (readonly) {
|
|
703
|
-
if (onPrev) {
|
|
704
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
705
|
-
}
|
|
706
804
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
707
805
|
} else if (phase === "correct" || phase === "locked") {
|
|
708
806
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -720,7 +818,7 @@ function singleChoiceActions({
|
|
|
720
818
|
}
|
|
721
819
|
|
|
722
820
|
// src/questions/single-choice/feedback.tsx
|
|
723
|
-
import { jsx as
|
|
821
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
724
822
|
function SingleChoiceFeedback({
|
|
725
823
|
readonly,
|
|
726
824
|
phase,
|
|
@@ -729,7 +827,7 @@ function SingleChoiceFeedback({
|
|
|
729
827
|
answerLabel
|
|
730
828
|
}) {
|
|
731
829
|
if (readonly) {
|
|
732
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ jsx12(
|
|
733
831
|
FeedbackSheet,
|
|
734
832
|
{
|
|
735
833
|
tone: "ok",
|
|
@@ -741,10 +839,10 @@ function SingleChoiceFeedback({
|
|
|
741
839
|
);
|
|
742
840
|
}
|
|
743
841
|
if (phase === "retry") {
|
|
744
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ jsx12(FeedbackSheet, { tone: "bad", title: labels.wrongAnswer, detail: "\u518D\u68C0\u67E5\u4E00\u6B21\uFF0C\u8FD8\u6709\u4E00\u6B21\u673A\u4F1A" });
|
|
745
843
|
}
|
|
746
844
|
if (phase === "correct") {
|
|
747
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ jsx12(
|
|
748
846
|
FeedbackSheet,
|
|
749
847
|
{
|
|
750
848
|
tone: "ok",
|
|
@@ -755,7 +853,7 @@ function SingleChoiceFeedback({
|
|
|
755
853
|
);
|
|
756
854
|
}
|
|
757
855
|
if (phase === "locked") {
|
|
758
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ jsx12(
|
|
759
857
|
FeedbackSheet,
|
|
760
858
|
{
|
|
761
859
|
tone: "bad",
|
|
@@ -787,7 +885,7 @@ function matchesAny(value, answers) {
|
|
|
787
885
|
}
|
|
788
886
|
|
|
789
887
|
// src/questions/single-choice/option-list.tsx
|
|
790
|
-
import { jsx as
|
|
888
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
791
889
|
function SingleChoiceOptions({
|
|
792
890
|
data,
|
|
793
891
|
canPick,
|
|
@@ -795,7 +893,7 @@ function SingleChoiceOptions({
|
|
|
795
893
|
onPick
|
|
796
894
|
}) {
|
|
797
895
|
const hasImages = data.options.some((option) => option.image);
|
|
798
|
-
return /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ jsx13("div", { className: classNames("rqk-option-list", hasImages && "rqk-option-list-grid"), children: data.options.map((option, optionIndex) => /* @__PURE__ */ jsx13(
|
|
799
897
|
OptionItem,
|
|
800
898
|
{
|
|
801
899
|
label: optionLetter(optionIndex),
|
|
@@ -803,7 +901,7 @@ function SingleChoiceOptions({
|
|
|
803
901
|
state: stateOf(optionIndex),
|
|
804
902
|
layout: hasImages ? "grid" : "row",
|
|
805
903
|
disabled: !canPick,
|
|
806
|
-
media: option.image ? /* @__PURE__ */
|
|
904
|
+
media: option.image ? /* @__PURE__ */ jsx13("img", { className: "rqk-option-image", src: option.image, alt: "" }) : void 0,
|
|
807
905
|
audioIndicator: Boolean(option.audio || option.speak),
|
|
808
906
|
onClick: () => onPick(optionIndex),
|
|
809
907
|
children: option.text
|
|
@@ -813,9 +911,9 @@ function SingleChoiceOptions({
|
|
|
813
911
|
}
|
|
814
912
|
|
|
815
913
|
// src/primitives/card.tsx
|
|
816
|
-
import { jsx as
|
|
914
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
817
915
|
function Card({ children, flush, tint, className }) {
|
|
818
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ jsx14(
|
|
819
917
|
"div",
|
|
820
918
|
{
|
|
821
919
|
className: classNames(
|
|
@@ -1024,7 +1122,7 @@ function useMediaProgress({
|
|
|
1024
1122
|
}
|
|
1025
1123
|
|
|
1026
1124
|
// src/primitives/audio-bar.tsx
|
|
1027
|
-
import { jsx as
|
|
1125
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1028
1126
|
var WAVE_BARS = [
|
|
1029
1127
|
10,
|
|
1030
1128
|
16,
|
|
@@ -1150,22 +1248,22 @@ function AudioBar({
|
|
|
1150
1248
|
className
|
|
1151
1249
|
),
|
|
1152
1250
|
children: [
|
|
1153
|
-
/* @__PURE__ */
|
|
1251
|
+
/* @__PURE__ */ jsx15(
|
|
1154
1252
|
"button",
|
|
1155
1253
|
{
|
|
1156
1254
|
type: "button",
|
|
1157
1255
|
className: "rqk-audio-bar-play",
|
|
1158
1256
|
onClick: handleToggle,
|
|
1159
1257
|
"aria-label": isPlaying ? "\u6682\u505C" : "\u64AD\u653E",
|
|
1160
|
-
children: isPlaying ? /* @__PURE__ */
|
|
1258
|
+
children: isPlaying ? /* @__PURE__ */ jsx15(PauseIcon, { size: 18 }) : /* @__PURE__ */ jsx15(PlayIcon, { size: 18 })
|
|
1161
1259
|
}
|
|
1162
1260
|
),
|
|
1163
1261
|
/* @__PURE__ */ jsxs8("div", { className: "rqk-audio-bar-main", children: [
|
|
1164
|
-
label ? /* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1262
|
+
label ? /* @__PURE__ */ jsx15("div", { className: "rqk-audio-bar-label", children: label }) : null,
|
|
1263
|
+
/* @__PURE__ */ jsx15("div", { className: "rqk-audio-bar-wave", "aria-hidden": true, children: WAVE_BARS.map((height, barIndex) => /* @__PURE__ */ jsx15("span", { style: { height: `${height}px` } }, barIndex)) })
|
|
1166
1264
|
] }),
|
|
1167
|
-
/* @__PURE__ */
|
|
1168
|
-
src ? /* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ jsx15("span", { className: "rqk-audio-bar-time", children: formatTime(isPlaying ? position : total) }),
|
|
1266
|
+
src ? /* @__PURE__ */ jsx15("audio", { ref: audioRef, src, preload: "metadata" }) : null
|
|
1169
1267
|
]
|
|
1170
1268
|
}
|
|
1171
1269
|
);
|
|
@@ -1208,7 +1306,7 @@ var art_speech_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1
|
|
|
1208
1306
|
var art_trophy_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#FFE29A"></stop><stop offset="0.55" stop-color="#FFC24B"></stop><stop offset="1" stop-color="#E08A00"></stop></linearGradient></defs><circle cx="60" cy="54" r="42" fill="#FFF7E6"></circle><path d="M38 34h44v18c0 14-9 22-22 22s-22-8-22-22z" fill="url(#rqk-grad)"></path><path d="M38 40H28v4c0 9 6 15 14 15M82 40h10v4c0 9-6 15-14 15" stroke="#E08A00" stroke-width="3.4" fill="none"></path><rect x="52" y="72" width="16" height="10" fill="#F0A600"></rect><rect x="44" y="82" width="32" height="9" rx="3" fill="#E08A00"></rect><path d="M60 44l3 6 7 1-5 5 1 7-6-3-6 3 1-7-5-5 7-1z" fill="#FFF7E6" opacity="0.9"></path><circle cx="90" cy="30" r="3.4" fill="#FFB020" opacity="0.8"></circle><circle cx="26" cy="76" r="2.6" fill="#7C5CFF" opacity="0.6"></circle></svg>\n';
|
|
1209
1307
|
|
|
1210
1308
|
// src/art/illustrations.tsx
|
|
1211
|
-
import { jsx as
|
|
1309
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1212
1310
|
var ART_SOURCES = {
|
|
1213
1311
|
kid: art_kid_default,
|
|
1214
1312
|
balloon: art_balloon_default,
|
|
@@ -1228,7 +1326,7 @@ function Art({ name, className, size }) {
|
|
|
1228
1326
|
/rqk-grad/g,
|
|
1229
1327
|
`rqk-grad-${unique}`
|
|
1230
1328
|
);
|
|
1231
|
-
return /* @__PURE__ */
|
|
1329
|
+
return /* @__PURE__ */ jsx16(
|
|
1232
1330
|
"span",
|
|
1233
1331
|
{
|
|
1234
1332
|
className: ["rqk-art", className].filter(Boolean).join(" "),
|
|
@@ -1240,7 +1338,7 @@ function Art({ name, className, size }) {
|
|
|
1240
1338
|
}
|
|
1241
1339
|
|
|
1242
1340
|
// src/primitives/picture-box.tsx
|
|
1243
|
-
import { jsx as
|
|
1341
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1244
1342
|
function PictureBox({
|
|
1245
1343
|
src,
|
|
1246
1344
|
alt = "",
|
|
@@ -1269,7 +1367,7 @@ function PictureBox({
|
|
|
1269
1367
|
style: { aspectRatio: ratio },
|
|
1270
1368
|
"data-state": resolved,
|
|
1271
1369
|
children: [
|
|
1272
|
-
src && resolved !== "fail" ? /* @__PURE__ */
|
|
1370
|
+
src && resolved !== "fail" ? /* @__PURE__ */ jsx17(
|
|
1273
1371
|
"img",
|
|
1274
1372
|
{
|
|
1275
1373
|
src,
|
|
@@ -1278,9 +1376,9 @@ function PictureBox({
|
|
|
1278
1376
|
onError: () => setFailed(true)
|
|
1279
1377
|
}
|
|
1280
1378
|
) : null,
|
|
1281
|
-
resolved === "loading" ? /* @__PURE__ */
|
|
1282
|
-
resolved === "default" || resolved === "fail" ? /* @__PURE__ */
|
|
1283
|
-
resolved === "fail" ? /* @__PURE__ */
|
|
1379
|
+
resolved === "loading" ? /* @__PURE__ */ jsx17("span", { className: "rqk-picture-skeleton", "aria-hidden": true }) : null,
|
|
1380
|
+
resolved === "default" || resolved === "fail" ? /* @__PURE__ */ jsx17("span", { className: "rqk-picture-fallback", children: /* @__PURE__ */ jsx17(Art, { name: art }) }) : null,
|
|
1381
|
+
resolved === "fail" ? /* @__PURE__ */ jsx17(
|
|
1284
1382
|
"button",
|
|
1285
1383
|
{
|
|
1286
1384
|
type: "button",
|
|
@@ -1289,98 +1387,25 @@ function PictureBox({
|
|
|
1289
1387
|
children: "\u91CD\u65B0\u52A0\u8F7D"
|
|
1290
1388
|
}
|
|
1291
1389
|
) : null,
|
|
1292
|
-
caption ? /* @__PURE__ */
|
|
1390
|
+
caption ? /* @__PURE__ */ jsx17("span", { className: "rqk-picture-caption", children: caption }) : null
|
|
1293
1391
|
]
|
|
1294
1392
|
}
|
|
1295
1393
|
);
|
|
1296
1394
|
}
|
|
1297
1395
|
|
|
1298
1396
|
// src/questions/single-choice/stem-card.tsx
|
|
1299
|
-
import { jsx as
|
|
1397
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1300
1398
|
function SingleChoiceStem({ data }) {
|
|
1301
1399
|
return /* @__PURE__ */ jsxs10(Card, { className: "rqk-stem-card", children: [
|
|
1302
|
-
data.stemImage ? /* @__PURE__ */
|
|
1303
|
-
data.stemAudio ? /* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1400
|
+
data.stemImage ? /* @__PURE__ */ jsx18(PictureBox, { src: data.stemImage, art: "books", ratio: "16 / 9", alt: "\u9898\u5E72\u914D\u56FE" }) : null,
|
|
1401
|
+
data.stemAudio ? /* @__PURE__ */ jsx18(AudioBar, { src: data.stemAudio }) : null,
|
|
1402
|
+
/* @__PURE__ */ jsx18("div", { className: "rqk-stem", children: data.stem })
|
|
1305
1403
|
] });
|
|
1306
1404
|
}
|
|
1307
1405
|
|
|
1308
1406
|
// src/questions/single-choice/use-single-choice.tsx
|
|
1309
1407
|
import { useCallback as useCallback4, useState as useState7 } from "react";
|
|
1310
1408
|
|
|
1311
|
-
// src/core/quest-config.tsx
|
|
1312
|
-
import { createContext as createContext2, useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
1313
|
-
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1314
|
-
var defaultQuestLabels = {
|
|
1315
|
-
submit: "\u63D0\u4EA4\u7B54\u6848",
|
|
1316
|
-
submitCount: "\u63D0\u4EA4\u7B54\u6848",
|
|
1317
|
-
retry: "\u91CD\u8BD5\u4E00\u6B21",
|
|
1318
|
-
next: "\u5207\u9898",
|
|
1319
|
-
prev: "\u4E0A\u4E00\u9898",
|
|
1320
|
-
back: "\u8FD4\u56DE",
|
|
1321
|
-
answer: "\u6B63\u786E\u7B54\u6848",
|
|
1322
|
-
analysis: "\u89E3\u6790",
|
|
1323
|
-
correctAll: "\u5168\u90E8\u7B54\u5BF9",
|
|
1324
|
-
wrongAnswer: "\u7B54\u6848\u8FD8\u4E0D\u6B63\u786E",
|
|
1325
|
-
tapToRead: "\u70B9\u51FB\u6717\u8BFB",
|
|
1326
|
-
readAloud: "\u8303\u8BFB",
|
|
1327
|
-
recording: "\u5F55\u97F3\u4E2D",
|
|
1328
|
-
scoring: "\u8BC4\u5206\u4E2D",
|
|
1329
|
-
releaseToSend: "\u677E\u624B\u5373\u63D0\u4EA4",
|
|
1330
|
-
holdToRecord: "\u6309\u4F4F\u5F00\u59CB\u5F55\u97F3",
|
|
1331
|
-
tapToFollow: "\u70B9\u51FB\u8DDF\u8BFB",
|
|
1332
|
-
recordingHint: "\u6B63\u5728\u5F55\u97F3 \xB7 \u677E\u624B\u7ED3\u675F",
|
|
1333
|
-
rescore: "\u91CD\u65B0\u5F55\u97F3",
|
|
1334
|
-
submitted: "\u5DF2\u63D0\u4EA4 \xB7 \u53EF\u91CD\u5F55",
|
|
1335
|
-
noiseHint: "\u97F3\u8D28\u4E0D\u5408\u683C\uFF1A\u4E0D\u51FA\u5206\uFF0C\u8BF7\u6362\u5B89\u9759\u73AF\u5883\u91CD\u8BD5",
|
|
1336
|
-
againHint: "\u672A\u83B7\u53D6\u5206\u6570\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21",
|
|
1337
|
-
attemptsLeft: "\u8FD8\u6709 {n} \u6B21\u5F55\u97F3\u673A\u4F1A",
|
|
1338
|
-
attemptsUsedUp: "\u673A\u4F1A\u5DF2\u7528\u5B8C",
|
|
1339
|
-
play: "\u64AD\u653E",
|
|
1340
|
-
pause: "\u6682\u505C",
|
|
1341
|
-
replay: "\u518D\u542C\u4E00\u904D",
|
|
1342
|
-
loop: "\u5FAA\u73AF",
|
|
1343
|
-
speed: "\u500D\u901F",
|
|
1344
|
-
finish: "\u5B8C\u6210\u5E76\u8FD4\u56DE",
|
|
1345
|
-
submitAndStats: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
|
|
1346
|
-
effectivePlay: "\u6709\u6548\u64AD\u653E",
|
|
1347
|
-
totalTime: "\u603B\u65F6\u957F",
|
|
1348
|
-
reading: "\u9605\u8BFB",
|
|
1349
|
-
expand: "\u5C55\u5F00\u5168\u6587",
|
|
1350
|
-
collapse: "\u6536\u8D77",
|
|
1351
|
-
notAnswered: "\u672A\u4F5C\u7B54",
|
|
1352
|
-
fullscreen: "\u5168\u5C4F"
|
|
1353
|
-
};
|
|
1354
|
-
var QuestConfigContext = createContext2({});
|
|
1355
|
-
function QuestConfigProvider({
|
|
1356
|
-
config,
|
|
1357
|
-
children
|
|
1358
|
-
}) {
|
|
1359
|
-
const parent = useContext2(QuestConfigContext);
|
|
1360
|
-
const value = useMemo2(
|
|
1361
|
-
() => {
|
|
1362
|
-
var _a, _b;
|
|
1363
|
-
return {
|
|
1364
|
-
sound: (_a = config == null ? void 0 : config.sound) != null ? _a : parent.sound,
|
|
1365
|
-
speakText: (_b = config == null ? void 0 : config.speakText) != null ? _b : parent.speakText,
|
|
1366
|
-
labels: __spreadValues(__spreadValues({}, parent.labels), config == null ? void 0 : config.labels)
|
|
1367
|
-
};
|
|
1368
|
-
},
|
|
1369
|
-
[config, parent]
|
|
1370
|
-
);
|
|
1371
|
-
return /* @__PURE__ */ jsx18(QuestConfigContext.Provider, { value, children });
|
|
1372
|
-
}
|
|
1373
|
-
function useQuestConfig() {
|
|
1374
|
-
return useContext2(QuestConfigContext);
|
|
1375
|
-
}
|
|
1376
|
-
function useQuestLabels(override) {
|
|
1377
|
-
const config = useQuestConfig();
|
|
1378
|
-
return useMemo2(
|
|
1379
|
-
() => __spreadValues(__spreadValues(__spreadValues({}, defaultQuestLabels), config.labels), override),
|
|
1380
|
-
[config.labels, override]
|
|
1381
|
-
);
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
1409
|
// src/core/speech.ts
|
|
1385
1410
|
var speakWithSynthesis = (text, opts) => {
|
|
1386
1411
|
if (typeof window === "undefined" || !window.speechSynthesis) {
|
|
@@ -1496,7 +1521,7 @@ function useSingleChoice({
|
|
|
1496
1521
|
}
|
|
1497
1522
|
|
|
1498
1523
|
// src/questions/single-choice/index.tsx
|
|
1499
|
-
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1524
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1500
1525
|
function SingleChoice({
|
|
1501
1526
|
data,
|
|
1502
1527
|
mode = "answer",
|
|
@@ -1509,7 +1534,6 @@ function SingleChoice({
|
|
|
1509
1534
|
onNext,
|
|
1510
1535
|
onSubmit,
|
|
1511
1536
|
sound,
|
|
1512
|
-
frame,
|
|
1513
1537
|
demoAttempt,
|
|
1514
1538
|
className
|
|
1515
1539
|
}) {
|
|
@@ -1519,7 +1543,6 @@ function SingleChoice({
|
|
|
1519
1543
|
phase: model.judge.phase,
|
|
1520
1544
|
labels: model.labels,
|
|
1521
1545
|
selected: model.selected,
|
|
1522
|
-
onPrev,
|
|
1523
1546
|
onNext,
|
|
1524
1547
|
onSubmit: model.handleSubmit,
|
|
1525
1548
|
onRetry: model.judge.retry
|
|
@@ -1533,7 +1556,6 @@ function SingleChoice({
|
|
|
1533
1556
|
total,
|
|
1534
1557
|
instruction,
|
|
1535
1558
|
onBack,
|
|
1536
|
-
frame,
|
|
1537
1559
|
className: classNames("rqk-quest", className),
|
|
1538
1560
|
dataQuest: "single-choice",
|
|
1539
1561
|
feedback: /* @__PURE__ */ jsx19(
|
|
@@ -1546,8 +1568,8 @@ function SingleChoice({
|
|
|
1546
1568
|
answerLabel: model.answerLabel
|
|
1547
1569
|
}
|
|
1548
1570
|
),
|
|
1549
|
-
footer: /* @__PURE__ */ jsx19(ActionBar, { actions }),
|
|
1550
|
-
children: /* @__PURE__ */ jsxs12(
|
|
1571
|
+
footer: /* @__PURE__ */ jsx19(ActionBar, { actions, index, onPrev }),
|
|
1572
|
+
children: /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
1551
1573
|
/* @__PURE__ */ jsx19(SingleChoiceStem, { data }),
|
|
1552
1574
|
/* @__PURE__ */ jsx19(
|
|
1553
1575
|
SingleChoiceOptions,
|
|
@@ -1614,7 +1636,7 @@ function recordState(stage) {
|
|
|
1614
1636
|
}
|
|
1615
1637
|
function followArt(data) {
|
|
1616
1638
|
var _a;
|
|
1617
|
-
return (_a = data.art) != null ? _a : data.kind === "
|
|
1639
|
+
return (_a = data.art) != null ? _a : data.kind === "sentence" ? "speech" : null;
|
|
1618
1640
|
}
|
|
1619
1641
|
|
|
1620
1642
|
// src/questions/follow-read/follow-content.tsx
|
|
@@ -1628,12 +1650,57 @@ function FollowContent({
|
|
|
1628
1650
|
startBadgeVisible
|
|
1629
1651
|
}) {
|
|
1630
1652
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1631
|
-
return /* @__PURE__ */ jsxs13(
|
|
1653
|
+
return /* @__PURE__ */ jsxs13("div", { className: "rqk-follow-card flex flex-col gap-3", children: [
|
|
1632
1654
|
/* @__PURE__ */ jsxs13("div", { className: "rqk-follow-stage", children: [
|
|
1633
|
-
/* @__PURE__ */ jsx20(Art, { name: art, className: "rqk-follow-art" }),
|
|
1655
|
+
art ? /* @__PURE__ */ jsx20(Art, { name: art, className: "rqk-follow-art" }) : /* @__PURE__ */ jsxs13("span", { className: "rqk-follow-no-image", role: "img", "aria-label": "No image", children: [
|
|
1656
|
+
/* @__PURE__ */ jsxs13(
|
|
1657
|
+
"svg",
|
|
1658
|
+
{
|
|
1659
|
+
className: "rqk-follow-no-image-icon",
|
|
1660
|
+
viewBox: "0 0 48 48",
|
|
1661
|
+
fill: "none",
|
|
1662
|
+
"aria-hidden": true,
|
|
1663
|
+
children: [
|
|
1664
|
+
/* @__PURE__ */ jsx20(
|
|
1665
|
+
"rect",
|
|
1666
|
+
{
|
|
1667
|
+
x: "7",
|
|
1668
|
+
y: "10",
|
|
1669
|
+
width: "34",
|
|
1670
|
+
height: "28",
|
|
1671
|
+
rx: "4",
|
|
1672
|
+
stroke: "currentColor",
|
|
1673
|
+
strokeWidth: "2"
|
|
1674
|
+
}
|
|
1675
|
+
),
|
|
1676
|
+
/* @__PURE__ */ jsx20("circle", { cx: "17", cy: "19", r: "3", fill: "currentColor", opacity: "0.45" }),
|
|
1677
|
+
/* @__PURE__ */ jsx20(
|
|
1678
|
+
"path",
|
|
1679
|
+
{
|
|
1680
|
+
d: "M10 34l9-9 7 7 6-6 8 8",
|
|
1681
|
+
stroke: "currentColor",
|
|
1682
|
+
strokeWidth: "2",
|
|
1683
|
+
strokeLinecap: "round",
|
|
1684
|
+
strokeLinejoin: "round"
|
|
1685
|
+
}
|
|
1686
|
+
),
|
|
1687
|
+
/* @__PURE__ */ jsx20(
|
|
1688
|
+
"path",
|
|
1689
|
+
{
|
|
1690
|
+
d: "M11 8l27 32",
|
|
1691
|
+
stroke: "currentColor",
|
|
1692
|
+
strokeWidth: "3",
|
|
1693
|
+
strokeLinecap: "round"
|
|
1694
|
+
}
|
|
1695
|
+
)
|
|
1696
|
+
]
|
|
1697
|
+
}
|
|
1698
|
+
),
|
|
1699
|
+
/* @__PURE__ */ jsx20("span", { className: "rqk-follow-no-image-text", children: "No image" })
|
|
1700
|
+
] }),
|
|
1634
1701
|
startBadgeVisible ? /* @__PURE__ */ jsx20("span", { className: "rqk-follow-start", children: "\u51C6\u5907\u5F00\u59CB\u8DDF\u8BFB" }) : null
|
|
1635
1702
|
] }),
|
|
1636
|
-
data.kind === "word" ? /* @__PURE__ */ jsxs13(
|
|
1703
|
+
data.kind === "word" ? /* @__PURE__ */ jsxs13(Card, { className: "rqk-follow-word", children: [
|
|
1637
1704
|
/* @__PURE__ */ jsx20("div", { className: "rqk-follow-word-text", children: (_a = data.word) == null ? void 0 : _a.text }),
|
|
1638
1705
|
/* @__PURE__ */ jsxs13("div", { className: "rqk-follow-word-meta", children: [
|
|
1639
1706
|
((_b = data.word) == null ? void 0 : _b.phonetic) ? /* @__PURE__ */ jsx20("span", { className: "rqk-follow-phonetic", children: data.word.phonetic }) : null,
|
|
@@ -1682,6 +1749,7 @@ function FollowContent({
|
|
|
1682
1749
|
}
|
|
1683
1750
|
|
|
1684
1751
|
// src/primitives/celebration.tsx
|
|
1752
|
+
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1685
1753
|
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1686
1754
|
var CONFETTI_COLORS = [
|
|
1687
1755
|
"var(--rqk-gold)",
|
|
@@ -1698,9 +1766,25 @@ var GRADE_CONFIG = {
|
|
|
1698
1766
|
nobad: { title: "Not bad", stars: 1, ribbon: "\u7EE7\u7EED\u52A0\u6CB9" },
|
|
1699
1767
|
again: { title: "Try again", stars: 0, ribbon: "\u518D\u6765\u4E00\u6B21" }
|
|
1700
1768
|
};
|
|
1701
|
-
function Celebration({
|
|
1769
|
+
function Celebration({
|
|
1770
|
+
grade,
|
|
1771
|
+
title,
|
|
1772
|
+
ribbon,
|
|
1773
|
+
note,
|
|
1774
|
+
confetti,
|
|
1775
|
+
autoHideMs,
|
|
1776
|
+
className
|
|
1777
|
+
}) {
|
|
1702
1778
|
const config = GRADE_CONFIG[grade];
|
|
1703
1779
|
const withConfetti = confetti != null ? confetti : grade === "perfect" || grade === "great";
|
|
1780
|
+
const [hidden, setHidden] = useState8(false);
|
|
1781
|
+
useEffect5(() => {
|
|
1782
|
+
setHidden(false);
|
|
1783
|
+
if (!autoHideMs) return;
|
|
1784
|
+
const timer = window.setTimeout(() => setHidden(true), autoHideMs);
|
|
1785
|
+
return () => window.clearTimeout(timer);
|
|
1786
|
+
}, [autoHideMs, grade]);
|
|
1787
|
+
if (hidden) return null;
|
|
1704
1788
|
return /* @__PURE__ */ jsxs14("div", { className: classNames("rqk-celebrate", className), "data-grade": grade, role: "status", children: [
|
|
1705
1789
|
withConfetti ? /* @__PURE__ */ jsx21("div", { className: "rqk-confetti", "aria-hidden": true, children: Array.from({ length: CONFETTI_COUNT }).map((_, index) => {
|
|
1706
1790
|
const x = 4 + index * 37 % 93;
|
|
@@ -1736,8 +1820,8 @@ function Celebration({ grade, title, ribbon, note, confetti, className }) {
|
|
|
1736
1820
|
}
|
|
1737
1821
|
|
|
1738
1822
|
// src/primitives/record-cluster.tsx
|
|
1739
|
-
import { useEffect as
|
|
1740
|
-
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1823
|
+
import { useEffect as useEffect6, useRef as useRef6, useState as useState9 } from "react";
|
|
1824
|
+
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1741
1825
|
function formatClock(value) {
|
|
1742
1826
|
const total = Math.max(0, Math.floor(value));
|
|
1743
1827
|
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
@@ -1758,10 +1842,10 @@ function RecordCluster({
|
|
|
1758
1842
|
className
|
|
1759
1843
|
}) {
|
|
1760
1844
|
const toast = useQuestToast();
|
|
1761
|
-
const [activeSide, setActiveSide] =
|
|
1845
|
+
const [activeSide, setActiveSide] = useState9(null);
|
|
1762
1846
|
const activeTimer = useRef6(void 0);
|
|
1763
1847
|
const activeToken = useRef6(0);
|
|
1764
|
-
|
|
1848
|
+
useEffect6(
|
|
1765
1849
|
() => () => {
|
|
1766
1850
|
if (activeTimer.current) window.clearTimeout(activeTimer.current);
|
|
1767
1851
|
},
|
|
@@ -1794,26 +1878,13 @@ function RecordCluster({
|
|
|
1794
1878
|
if (!recording) return;
|
|
1795
1879
|
onRecordEnd == null ? void 0 : onRecordEnd();
|
|
1796
1880
|
};
|
|
1797
|
-
const
|
|
1798
|
-
if (
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
}
|
|
1802
|
-
};
|
|
1803
|
-
const handleKeyUp = (event) => {
|
|
1804
|
-
if (event.code === "Space") {
|
|
1805
|
-
event.preventDefault();
|
|
1806
|
-
end();
|
|
1807
|
-
}
|
|
1881
|
+
const toggle = () => {
|
|
1882
|
+
if (disabled || scoring) return;
|
|
1883
|
+
if (recording) end();
|
|
1884
|
+
else start();
|
|
1808
1885
|
};
|
|
1809
|
-
const statusText = hint != null ? hint : recording ? "\u6B63\u5728\u5F55\u97F3 \xB7 \
|
|
1886
|
+
const statusText = hint != null ? hint : recording ? "\u6B63\u5728\u5F55\u97F3 \xB7 \u70B9\u51FB\u7ED3\u675F" : scoring ? "\u8BC4\u5206\u4E2D\u2026" : state === "done" ? "\u91CD\u65B0\u5F55\u97F3" : "\u70B9\u51FB\u8DDF\u8BFB";
|
|
1810
1887
|
return /* @__PURE__ */ jsxs15("div", { className: classNames("rqk-record-cluster", className), children: [
|
|
1811
|
-
recording ? /* @__PURE__ */ jsxs15("div", { className: "rqk-record-timer", "aria-live": "polite", children: [
|
|
1812
|
-
formatClock(seconds),
|
|
1813
|
-
" / ",
|
|
1814
|
-
formatClock(maxSeconds)
|
|
1815
|
-
] }) : null,
|
|
1816
|
-
recording ? /* @__PURE__ */ jsx22("div", { className: "rqk-record-wave", "aria-hidden": true, children: Array.from({ length: 8 }).map((_, index) => /* @__PURE__ */ jsx22("span", { style: { animationDelay: `${index * 0.12}s` } }, index)) }) : null,
|
|
1817
1888
|
/* @__PURE__ */ jsxs15("div", { className: "rqk-record-row", children: [
|
|
1818
1889
|
/* @__PURE__ */ jsxs15(
|
|
1819
1890
|
"button",
|
|
@@ -1833,20 +1904,27 @@ function RecordCluster({
|
|
|
1833
1904
|
}
|
|
1834
1905
|
),
|
|
1835
1906
|
/* @__PURE__ */ jsxs15("div", { className: "rqk-record-main", children: [
|
|
1836
|
-
recording ? /* @__PURE__ */
|
|
1907
|
+
recording ? /* @__PURE__ */ jsxs15("svg", { className: "rqk-record-ring", viewBox: "0 0 100 100", "aria-hidden": true, children: [
|
|
1908
|
+
/* @__PURE__ */ jsx22(
|
|
1909
|
+
"circle",
|
|
1910
|
+
{
|
|
1911
|
+
className: "rqk-record-ring-track",
|
|
1912
|
+
cx: "50",
|
|
1913
|
+
cy: "50",
|
|
1914
|
+
r: "45",
|
|
1915
|
+
strokeDasharray: "283"
|
|
1916
|
+
}
|
|
1917
|
+
),
|
|
1918
|
+
/* @__PURE__ */ jsx22("circle", { cx: "50", cy: "50", r: "45", strokeDasharray: "283", strokeDashoffset: ringOffset })
|
|
1919
|
+
] }) : null,
|
|
1837
1920
|
/* @__PURE__ */ jsx22(
|
|
1838
1921
|
"button",
|
|
1839
1922
|
{
|
|
1840
1923
|
type: "button",
|
|
1841
1924
|
className: classNames("rqk-record", recording && "rqk-is-recording"),
|
|
1842
|
-
|
|
1843
|
-
onPointerUp: end,
|
|
1844
|
-
onPointerLeave: end,
|
|
1845
|
-
onPointerCancel: end,
|
|
1846
|
-
onKeyDown: handleKeyDown,
|
|
1847
|
-
onKeyUp: handleKeyUp,
|
|
1925
|
+
onClick: toggle,
|
|
1848
1926
|
disabled: disabled || scoring,
|
|
1849
|
-
"aria-label": recording ? "\
|
|
1927
|
+
"aria-label": recording ? "\u7ED3\u675F\u5F55\u97F3" : "\u5F00\u59CB\u5F55\u97F3",
|
|
1850
1928
|
"aria-pressed": recording,
|
|
1851
1929
|
children: recording ? /* @__PURE__ */ jsx22("span", { className: "rqk-record-stop", "aria-hidden": true }) : /* @__PURE__ */ jsx22(MicIcon, { size: 30 })
|
|
1852
1930
|
}
|
|
@@ -1870,11 +1948,21 @@ function RecordCluster({
|
|
|
1870
1948
|
}
|
|
1871
1949
|
)
|
|
1872
1950
|
] }),
|
|
1873
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ jsxs15(
|
|
1874
1952
|
"div",
|
|
1875
1953
|
{
|
|
1876
1954
|
className: classNames("rqk-record-status", hintTone !== "default" && `rqk-is-${hintTone}`),
|
|
1877
|
-
children:
|
|
1955
|
+
children: [
|
|
1956
|
+
recording ? /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
1957
|
+
/* @__PURE__ */ jsxs15("span", { className: "rqk-record-status-timer", children: [
|
|
1958
|
+
formatClock(seconds),
|
|
1959
|
+
" / ",
|
|
1960
|
+
formatClock(maxSeconds)
|
|
1961
|
+
] }),
|
|
1962
|
+
/* @__PURE__ */ jsx22("span", { className: "rqk-record-status-sep", "aria-hidden": true, children: "\xB7" })
|
|
1963
|
+
] }) : null,
|
|
1964
|
+
/* @__PURE__ */ jsx22("span", { children: statusText })
|
|
1965
|
+
]
|
|
1878
1966
|
}
|
|
1879
1967
|
),
|
|
1880
1968
|
detail ? /* @__PURE__ */ jsx22("div", { className: classNames("rqk-record-detail", detailTone === "bad" && "rqk-is-bad"), children: detail }) : null
|
|
@@ -1903,7 +1991,7 @@ function FollowControls({
|
|
|
1903
1991
|
}) {
|
|
1904
1992
|
const gradeValue = grade && grade !== "noise" ? grade : "again";
|
|
1905
1993
|
return /* @__PURE__ */ jsxs16("div", { className: "rqk-follow-bottom", children: [
|
|
1906
|
-
grade && grade !== "noise" ? /* @__PURE__ */ jsx23(Celebration, { grade: gradeValue, ribbon }) : null,
|
|
1994
|
+
grade && grade !== "noise" ? /* @__PURE__ */ jsx23(Celebration, { grade: gradeValue, ribbon, autoHideMs: 3200 }) : null,
|
|
1907
1995
|
/* @__PURE__ */ jsx23(
|
|
1908
1996
|
RecordCluster,
|
|
1909
1997
|
{
|
|
@@ -1952,22 +2040,22 @@ function detailHint({
|
|
|
1952
2040
|
}
|
|
1953
2041
|
|
|
1954
2042
|
// src/questions/follow-read/toast.tsx
|
|
1955
|
-
import { useEffect as
|
|
2043
|
+
import { useEffect as useEffect7 } from "react";
|
|
1956
2044
|
function FollowReadToast({ message }) {
|
|
1957
2045
|
const { show } = useQuestToast();
|
|
1958
|
-
|
|
2046
|
+
useEffect7(() => {
|
|
1959
2047
|
show(message);
|
|
1960
2048
|
}, [message, show]);
|
|
1961
2049
|
return null;
|
|
1962
2050
|
}
|
|
1963
2051
|
|
|
1964
2052
|
// src/questions/follow-read/use-follow-read.ts
|
|
1965
|
-
import { useRef as useRef8, useState as
|
|
2053
|
+
import { useRef as useRef8, useState as useState11 } from "react";
|
|
1966
2054
|
|
|
1967
2055
|
// src/questions/follow-read/use-follow-recorder.ts
|
|
1968
2056
|
import { AudioRecorder } from "@jswork/audio-recorder-kit";
|
|
1969
2057
|
import { AudioManager as AudioManager2 } from "@jswork/howler-audio-manager";
|
|
1970
|
-
import { useEffect as
|
|
2058
|
+
import { useEffect as useEffect8, useRef as useRef7, useState as useState10 } from "react";
|
|
1971
2059
|
function useFollowRecorder({
|
|
1972
2060
|
data,
|
|
1973
2061
|
maxSeconds,
|
|
@@ -1976,8 +2064,8 @@ function useFollowRecorder({
|
|
|
1976
2064
|
onRecordingChange
|
|
1977
2065
|
}) {
|
|
1978
2066
|
const config = useQuestConfig();
|
|
1979
|
-
const [seconds, setSeconds] =
|
|
1980
|
-
const [recordedUrl, setRecordedUrl] =
|
|
2067
|
+
const [seconds, setSeconds] = useState10(0);
|
|
2068
|
+
const [recordedUrl, setRecordedUrl] = useState10(null);
|
|
1981
2069
|
const timerRef = useRef7(null);
|
|
1982
2070
|
const recorderRef = useRef7(null);
|
|
1983
2071
|
const audioManagerRef = useRef7(null);
|
|
@@ -2076,7 +2164,7 @@ function useFollowRecorder({
|
|
|
2076
2164
|
void ((_d = config.speakText) != null ? _d : speakWithSynthesis)(data.sentence.words.join(" "));
|
|
2077
2165
|
}
|
|
2078
2166
|
};
|
|
2079
|
-
|
|
2167
|
+
useEffect8(() => {
|
|
2080
2168
|
return () => {
|
|
2081
2169
|
var _a, _b;
|
|
2082
2170
|
if (timerRef.current) window.clearInterval(timerRef.current);
|
|
@@ -2116,10 +2204,10 @@ function useFollowRead({
|
|
|
2116
2204
|
const presetGrade = preset === "noise" ? "noise" : preset === "limit" ? "great" : preset === "perfect" || preset === "great" || preset === "nobad" || preset === "again" ? preset : null;
|
|
2117
2205
|
const initialStage = presetGrade ? "result" : "ready";
|
|
2118
2206
|
const initialAttempts = preset === "limit" ? maxAttempts : presetGrade && preset !== "again" ? 1 : 0;
|
|
2119
|
-
const [stage, setStageState] =
|
|
2120
|
-
const [attemptsUsed, setAttemptsUsed] =
|
|
2121
|
-
const [grade, setGrade] =
|
|
2122
|
-
const [noise, setNoise] =
|
|
2207
|
+
const [stage, setStageState] = useState11(initialStage);
|
|
2208
|
+
const [attemptsUsed, setAttemptsUsed] = useState11(initialAttempts);
|
|
2209
|
+
const [grade, setGrade] = useState11(presetGrade);
|
|
2210
|
+
const [noise, setNoise] = useState11(preset === "noise");
|
|
2123
2211
|
const stageRef = useRef8(initialStage);
|
|
2124
2212
|
const text = data.kind === "word" ? (_d = (_c = data.word) == null ? void 0 : _c.text) != null ? _d : "" : (_f = (_e = data.sentence) == null ? void 0 : _e.words.join(" ")) != null ? _f : "";
|
|
2125
2213
|
const goStage = (next) => {
|
|
@@ -2200,7 +2288,7 @@ function useFollowRead({
|
|
|
2200
2288
|
}
|
|
2201
2289
|
|
|
2202
2290
|
// src/questions/follow-read/index.tsx
|
|
2203
|
-
import { Fragment as
|
|
2291
|
+
import { Fragment as Fragment4, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2204
2292
|
function FollowRead({
|
|
2205
2293
|
data,
|
|
2206
2294
|
mode = "answer",
|
|
@@ -2209,10 +2297,10 @@ function FollowRead({
|
|
|
2209
2297
|
title,
|
|
2210
2298
|
instruction,
|
|
2211
2299
|
onBack,
|
|
2300
|
+
onPrev,
|
|
2212
2301
|
onNext,
|
|
2213
2302
|
onSubmit,
|
|
2214
2303
|
sound,
|
|
2215
|
-
frame,
|
|
2216
2304
|
className,
|
|
2217
2305
|
demoState,
|
|
2218
2306
|
onScore,
|
|
@@ -2235,11 +2323,11 @@ function FollowRead({
|
|
|
2235
2323
|
onNext
|
|
2236
2324
|
});
|
|
2237
2325
|
const displayTitle = title != null ? title : data.kind === "word" ? "\u5355\u8BCD\u8DDF\u8BFB" : "\u53E5\u5B50\u8DDF\u8BFB";
|
|
2238
|
-
const instructionText = instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs17(
|
|
2326
|
+
const instructionText = instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
2239
2327
|
"\u542C\u5355\u8BCD\u793A\u8303\uFF0C\u70B9\u51FB\u9EA6\u514B\u98CE",
|
|
2240
2328
|
/* @__PURE__ */ jsx24("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
|
|
2241
2329
|
"\uFF0C\u81EA\u52A8\u8BC4\u5206"
|
|
2242
|
-
] }) : /* @__PURE__ */ jsxs17(
|
|
2330
|
+
] }) : /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
2243
2331
|
"\u542C\u53E5\u5B50\u793A\u8303\uFF0C\u70B9\u51FB\u9EA6\u514B\u98CE",
|
|
2244
2332
|
/* @__PURE__ */ jsx24("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
|
|
2245
2333
|
"\uFF0C\u9010\u8BCD\u8BC4\u5206"
|
|
@@ -2254,6 +2342,8 @@ function FollowRead({
|
|
|
2254
2342
|
maxAttempts: model.maxAttempts,
|
|
2255
2343
|
labels: model.labels
|
|
2256
2344
|
});
|
|
2345
|
+
const hasPrev = index > 1 && Boolean(onPrev);
|
|
2346
|
+
const hasFooter = actions.length > 0 || hasPrev;
|
|
2257
2347
|
return /* @__PURE__ */ jsxs17(
|
|
2258
2348
|
QuestShell,
|
|
2259
2349
|
{
|
|
@@ -2262,18 +2352,17 @@ function FollowRead({
|
|
|
2262
2352
|
index,
|
|
2263
2353
|
total,
|
|
2264
2354
|
onBack,
|
|
2265
|
-
frame,
|
|
2266
2355
|
className: classNames(
|
|
2267
2356
|
"rqk-quest",
|
|
2268
2357
|
"rqk-follow",
|
|
2269
2358
|
`rqk-stage-${model.stage}`,
|
|
2270
|
-
|
|
2359
|
+
hasFooter && "rqk-has-footer",
|
|
2271
2360
|
className
|
|
2272
2361
|
),
|
|
2273
2362
|
dataQuest: "follow-read",
|
|
2274
|
-
footer:
|
|
2363
|
+
footer: hasFooter ? /* @__PURE__ */ jsx24(ActionBar, { actions, index, onPrev }) : void 0,
|
|
2275
2364
|
children: [
|
|
2276
|
-
/* @__PURE__ */ jsxs17(
|
|
2365
|
+
/* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
2277
2366
|
/* @__PURE__ */ jsx24("div", { className: "rqk-follow-instr", children: instructionText }),
|
|
2278
2367
|
/* @__PURE__ */ jsx24(
|
|
2279
2368
|
FollowContent,
|
|
@@ -2322,16 +2411,12 @@ function linkMatchActions({
|
|
|
2322
2411
|
complete,
|
|
2323
2412
|
pairCount,
|
|
2324
2413
|
totalPairs,
|
|
2325
|
-
onPrev,
|
|
2326
2414
|
onNext,
|
|
2327
2415
|
onSubmit,
|
|
2328
2416
|
onRetry
|
|
2329
2417
|
}) {
|
|
2330
2418
|
const actions = [];
|
|
2331
2419
|
if (readonly) {
|
|
2332
|
-
if (onPrev) {
|
|
2333
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
2334
|
-
}
|
|
2335
2420
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
2336
2421
|
} else if (phase === "correct" || phase === "locked") {
|
|
2337
2422
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -2422,7 +2507,7 @@ function nodeOk(data, side, nodeIndex) {
|
|
|
2422
2507
|
}
|
|
2423
2508
|
|
|
2424
2509
|
// src/questions/link-match/link-node.tsx
|
|
2425
|
-
import { Fragment as
|
|
2510
|
+
import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2426
2511
|
var BARS = [8, 14, 20, 10, 24, 16, 9, 18, 12];
|
|
2427
2512
|
function LinkNode({
|
|
2428
2513
|
side,
|
|
@@ -2477,7 +2562,7 @@ function LinkNode({
|
|
|
2477
2562
|
] }) : kind === "audio" ? /* @__PURE__ */ jsxs18("span", { className: "rqk-link-node-audio", children: [
|
|
2478
2563
|
/* @__PURE__ */ jsx26("span", { className: "rqk-link-node-audio-icon", "aria-hidden": true, children: /* @__PURE__ */ jsx26("span", { className: "rqk-link-node-audio-triangle" }) }),
|
|
2479
2564
|
/* @__PURE__ */ jsx26("span", { className: "rqk-link-node-wave", "aria-hidden": true, children: BARS.map((height, barIndex) => /* @__PURE__ */ jsx26("span", { style: { height } }, barIndex)) })
|
|
2480
|
-
] }) : /* @__PURE__ */ jsxs18(
|
|
2565
|
+
] }) : /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
2481
2566
|
/* @__PURE__ */ jsx26("span", { className: "rqk-link-node-text", children: node.text }),
|
|
2482
2567
|
node.phonetic ? /* @__PURE__ */ jsx26("span", { className: "rqk-link-node-sub", children: node.phonetic }) : null,
|
|
2483
2568
|
node.speak || node.audio ? /* @__PURE__ */ jsxs18("span", { className: "rqk-link-node-sound", "aria-hidden": true, children: [
|
|
@@ -2579,10 +2664,10 @@ function LinkBoard({
|
|
|
2579
2664
|
}
|
|
2580
2665
|
|
|
2581
2666
|
// src/questions/link-match/use-link-audio.ts
|
|
2582
|
-
import { useEffect as
|
|
2667
|
+
import { useEffect as useEffect9, useRef as useRef9, useState as useState12 } from "react";
|
|
2583
2668
|
function useLinkAudio(data) {
|
|
2584
2669
|
const config = useQuestConfig();
|
|
2585
|
-
const [playing, setPlaying] =
|
|
2670
|
+
const [playing, setPlaying] = useState12(null);
|
|
2586
2671
|
const audioRef = useRef9(null);
|
|
2587
2672
|
const speakNode = (side, nodeIndex) => {
|
|
2588
2673
|
var _a, _b, _c;
|
|
@@ -2623,7 +2708,7 @@ function useLinkAudio(data) {
|
|
|
2623
2708
|
}
|
|
2624
2709
|
}
|
|
2625
2710
|
};
|
|
2626
|
-
|
|
2711
|
+
useEffect9(
|
|
2627
2712
|
() => () => {
|
|
2628
2713
|
var _a;
|
|
2629
2714
|
(_a = audioRef.current) == null ? void 0 : _a.pause();
|
|
@@ -2635,15 +2720,15 @@ function useLinkAudio(data) {
|
|
|
2635
2720
|
}
|
|
2636
2721
|
|
|
2637
2722
|
// src/questions/link-match/use-link-geometry.ts
|
|
2638
|
-
import { useCallback as useCallback5, useEffect as
|
|
2723
|
+
import { useCallback as useCallback5, useEffect as useEffect10, useLayoutEffect as useLayoutEffect2, useMemo as useMemo3, useRef as useRef10, useState as useState13 } from "react";
|
|
2639
2724
|
function useLinkGeometry({
|
|
2640
2725
|
data,
|
|
2641
2726
|
phase,
|
|
2642
2727
|
readonly,
|
|
2643
2728
|
pairs
|
|
2644
2729
|
}) {
|
|
2645
|
-
const [paths, setPaths] =
|
|
2646
|
-
const [size, setSize] =
|
|
2730
|
+
const [paths, setPaths] = useState13([]);
|
|
2731
|
+
const [size, setSize] = useState13({ width: 0, height: 0 });
|
|
2647
2732
|
const boardRef = useRef10(null);
|
|
2648
2733
|
const leftRefs = useRef10([]);
|
|
2649
2734
|
const rightRefs = useRef10([]);
|
|
@@ -2685,7 +2770,7 @@ function useLinkGeometry({
|
|
|
2685
2770
|
useLayoutEffect2(() => {
|
|
2686
2771
|
measure();
|
|
2687
2772
|
}, [measure]);
|
|
2688
|
-
|
|
2773
|
+
useEffect10(() => {
|
|
2689
2774
|
var _a, _b;
|
|
2690
2775
|
const board = boardRef.current;
|
|
2691
2776
|
if (!board || typeof ResizeObserver === "undefined") return void 0;
|
|
@@ -2702,7 +2787,7 @@ function useLinkGeometry({
|
|
|
2702
2787
|
}
|
|
2703
2788
|
|
|
2704
2789
|
// src/questions/link-match/use-link-pairs.ts
|
|
2705
|
-
import { useMemo as useMemo4, useState as
|
|
2790
|
+
import { useMemo as useMemo4, useState as useState14 } from "react";
|
|
2706
2791
|
function useLinkPairs({
|
|
2707
2792
|
data,
|
|
2708
2793
|
mode,
|
|
@@ -2719,8 +2804,8 @@ function useLinkPairs({
|
|
|
2719
2804
|
() => new Set(data.pairs.map(([left, right]) => pairKey(left, right))),
|
|
2720
2805
|
[data.pairs]
|
|
2721
2806
|
);
|
|
2722
|
-
const [pairs, setPairs] =
|
|
2723
|
-
const [selection, setSelection] =
|
|
2807
|
+
const [pairs, setPairs] = useState14([]);
|
|
2808
|
+
const [selection, setSelection] = useState14(null);
|
|
2724
2809
|
const judge = useJudge({
|
|
2725
2810
|
evaluate: () => pairs.length === data.pairs.length && pairs.every(([left, right]) => expected.has(pairKey(left, right))),
|
|
2726
2811
|
onFirstWrong: () => setPairs((current) => current.filter(([left, right]) => expected.has(pairKey(left, right)))),
|
|
@@ -2793,7 +2878,7 @@ function projectKind(side, leftKind, rightKind) {
|
|
|
2793
2878
|
}
|
|
2794
2879
|
|
|
2795
2880
|
// src/questions/link-match/index.tsx
|
|
2796
|
-
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2881
|
+
import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2797
2882
|
function LinkMatch({
|
|
2798
2883
|
data,
|
|
2799
2884
|
mode = "answer",
|
|
@@ -2806,7 +2891,6 @@ function LinkMatch({
|
|
|
2806
2891
|
onNext,
|
|
2807
2892
|
onSubmit,
|
|
2808
2893
|
sound,
|
|
2809
|
-
frame,
|
|
2810
2894
|
demoAttempt,
|
|
2811
2895
|
className
|
|
2812
2896
|
}) {
|
|
@@ -2839,7 +2923,6 @@ function LinkMatch({
|
|
|
2839
2923
|
complete: pairs.complete,
|
|
2840
2924
|
pairCount: pairs.pairs.length,
|
|
2841
2925
|
totalPairs: data.pairs.length,
|
|
2842
|
-
onPrev,
|
|
2843
2926
|
onNext,
|
|
2844
2927
|
onSubmit: pairs.handleSubmit,
|
|
2845
2928
|
onRetry: pairs.judge.retry
|
|
@@ -2853,7 +2936,6 @@ function LinkMatch({
|
|
|
2853
2936
|
total,
|
|
2854
2937
|
instruction,
|
|
2855
2938
|
onBack,
|
|
2856
|
-
frame,
|
|
2857
2939
|
className: classNames("rqk-quest", className),
|
|
2858
2940
|
dataQuest: "link-match",
|
|
2859
2941
|
feedback: /* @__PURE__ */ jsx28(
|
|
@@ -2866,8 +2948,8 @@ function LinkMatch({
|
|
|
2866
2948
|
answerText: pairs.answerText
|
|
2867
2949
|
}
|
|
2868
2950
|
),
|
|
2869
|
-
footer: /* @__PURE__ */ jsx28(ActionBar, { actions }),
|
|
2870
|
-
children: /* @__PURE__ */ jsxs20(
|
|
2951
|
+
footer: /* @__PURE__ */ jsx28(ActionBar, { actions, index, onPrev }),
|
|
2952
|
+
children: /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
2871
2953
|
data.hint ? /* @__PURE__ */ jsx28("div", { className: "rqk-link-hint", children: data.hint }) : null,
|
|
2872
2954
|
/* @__PURE__ */ jsx28(
|
|
2873
2955
|
LinkBoard,
|
|
@@ -2900,16 +2982,12 @@ function rearrangeActions({
|
|
|
2900
2982
|
phase,
|
|
2901
2983
|
labels,
|
|
2902
2984
|
full,
|
|
2903
|
-
onPrev,
|
|
2904
2985
|
onNext,
|
|
2905
2986
|
onSubmit,
|
|
2906
2987
|
onRetry
|
|
2907
2988
|
}) {
|
|
2908
2989
|
const actions = [];
|
|
2909
2990
|
if (readonly) {
|
|
2910
|
-
if (onPrev) {
|
|
2911
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
2912
|
-
}
|
|
2913
2991
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
2914
2992
|
} else if (phase === "correct" || phase === "locked") {
|
|
2915
2993
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -3077,7 +3155,7 @@ function RearrangeSlots({
|
|
|
3077
3155
|
}
|
|
3078
3156
|
|
|
3079
3157
|
// src/questions/rearrange/rearrange-page.tsx
|
|
3080
|
-
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3158
|
+
import { Fragment as Fragment7, jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3081
3159
|
function RearrangePage({
|
|
3082
3160
|
data,
|
|
3083
3161
|
slots,
|
|
@@ -3091,7 +3169,7 @@ function RearrangePage({
|
|
|
3091
3169
|
onSlot,
|
|
3092
3170
|
onPick
|
|
3093
3171
|
}) {
|
|
3094
|
-
return /* @__PURE__ */ jsxs24(
|
|
3172
|
+
return /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
3095
3173
|
/* @__PURE__ */ jsx33(
|
|
3096
3174
|
RearrangeSlots,
|
|
3097
3175
|
{
|
|
@@ -3146,7 +3224,7 @@ function targetAnswerText(data) {
|
|
|
3146
3224
|
}
|
|
3147
3225
|
|
|
3148
3226
|
// src/questions/rearrange/use-rearrange.ts
|
|
3149
|
-
import { useEffect as
|
|
3227
|
+
import { useEffect as useEffect11, useState as useState15 } from "react";
|
|
3150
3228
|
function useRearrange({
|
|
3151
3229
|
data,
|
|
3152
3230
|
mode,
|
|
@@ -3160,7 +3238,7 @@ function useRearrange({
|
|
|
3160
3238
|
const bank = bankTiles(data, slots);
|
|
3161
3239
|
const words = targetWords(data);
|
|
3162
3240
|
const expected = expectedText(data);
|
|
3163
|
-
const [filled, setFilled] =
|
|
3241
|
+
const [filled, setFilled] = useState15(
|
|
3164
3242
|
() => slots.map((slot, slotIndex) => {
|
|
3165
3243
|
if (slot.holder) return null;
|
|
3166
3244
|
if (demoAttempt === 2) {
|
|
@@ -3170,7 +3248,7 @@ function useRearrange({
|
|
|
3170
3248
|
return null;
|
|
3171
3249
|
})
|
|
3172
3250
|
);
|
|
3173
|
-
const [cursor, setCursor] =
|
|
3251
|
+
const [cursor, setCursor] = useState15(() => {
|
|
3174
3252
|
const firstEmpty = slots.findIndex((slot) => !slot.holder);
|
|
3175
3253
|
return firstEmpty >= 0 ? firstEmpty : 0;
|
|
3176
3254
|
});
|
|
@@ -3202,7 +3280,7 @@ function useRearrange({
|
|
|
3202
3280
|
demoAttempt
|
|
3203
3281
|
});
|
|
3204
3282
|
const frozen = readonly || judge.phase === "correct" || judge.phase === "locked";
|
|
3205
|
-
|
|
3283
|
+
useEffect11(() => {
|
|
3206
3284
|
if (readonly) {
|
|
3207
3285
|
setFilled(
|
|
3208
3286
|
(current) => current.map((_value, slotIndex) => slots[slotIndex].holder ? null : slots[slotIndex].char)
|
|
@@ -3284,7 +3362,7 @@ function useRearrange({
|
|
|
3284
3362
|
}
|
|
3285
3363
|
|
|
3286
3364
|
// src/questions/rearrange/index.tsx
|
|
3287
|
-
import { Fragment as
|
|
3365
|
+
import { Fragment as Fragment8, jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3288
3366
|
function Rearrange({
|
|
3289
3367
|
data,
|
|
3290
3368
|
mode = "answer",
|
|
@@ -3297,7 +3375,6 @@ function Rearrange({
|
|
|
3297
3375
|
onNext,
|
|
3298
3376
|
onSubmit,
|
|
3299
3377
|
sound,
|
|
3300
|
-
frame,
|
|
3301
3378
|
demoAttempt,
|
|
3302
3379
|
className
|
|
3303
3380
|
}) {
|
|
@@ -3307,7 +3384,6 @@ function Rearrange({
|
|
|
3307
3384
|
phase: model.judge.phase,
|
|
3308
3385
|
labels: model.labels,
|
|
3309
3386
|
full: model.full,
|
|
3310
|
-
onPrev,
|
|
3311
3387
|
onNext,
|
|
3312
3388
|
onSubmit: model.handleSubmit,
|
|
3313
3389
|
onRetry: model.judge.retry
|
|
@@ -3319,17 +3395,16 @@ function Rearrange({
|
|
|
3319
3395
|
title: title != null ? title : data.kind === "word" ? "\u5355\u8BCD\u91CD\u7EC4" : "\u53E5\u5B50\u91CD\u7EC4",
|
|
3320
3396
|
index,
|
|
3321
3397
|
total,
|
|
3322
|
-
instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs25(
|
|
3398
|
+
instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
3323
3399
|
"\u6309\u5B57\u6BCD\u987A\u5E8F\u586B\u5165",
|
|
3324
3400
|
/* @__PURE__ */ jsx34("b", { children: "\u6A2A\u7EBF" }),
|
|
3325
3401
|
"\uFF0C\u62FC\u51FA\u5355\u8BCD"
|
|
3326
|
-
] }) : /* @__PURE__ */ jsxs25(
|
|
3402
|
+
] }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
3327
3403
|
"\u6309\u6B63\u786E\u987A\u5E8F\u628A\u8BCD\u5757\u586B\u5165",
|
|
3328
3404
|
/* @__PURE__ */ jsx34("b", { children: "\u6A2A\u7EBF" }),
|
|
3329
3405
|
"\uFF0C\u62FC\u51FA\u53E5\u5B50"
|
|
3330
3406
|
] }),
|
|
3331
3407
|
onBack,
|
|
3332
|
-
frame,
|
|
3333
3408
|
className: classNames("rqk-quest", "rqk-rearrange", className),
|
|
3334
3409
|
dataQuest: "rearrange",
|
|
3335
3410
|
feedback: /* @__PURE__ */ jsx34(
|
|
@@ -3342,7 +3417,7 @@ function Rearrange({
|
|
|
3342
3417
|
answerText: targetAnswerText(data)
|
|
3343
3418
|
}
|
|
3344
3419
|
),
|
|
3345
|
-
footer: /* @__PURE__ */ jsx34(ActionBar, { actions }),
|
|
3420
|
+
footer: /* @__PURE__ */ jsx34(ActionBar, { actions, index, onPrev }),
|
|
3346
3421
|
children: /* @__PURE__ */ jsx34(
|
|
3347
3422
|
RearrangePage,
|
|
3348
3423
|
{
|
|
@@ -3369,16 +3444,12 @@ function classifyActions({
|
|
|
3369
3444
|
phase,
|
|
3370
3445
|
labels,
|
|
3371
3446
|
full,
|
|
3372
|
-
onPrev,
|
|
3373
3447
|
onNext,
|
|
3374
3448
|
onSubmit,
|
|
3375
3449
|
onRetry
|
|
3376
3450
|
}) {
|
|
3377
3451
|
const actions = [];
|
|
3378
3452
|
if (readonly) {
|
|
3379
|
-
if (onPrev) {
|
|
3380
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
3381
|
-
}
|
|
3382
3453
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
3383
3454
|
} else if (phase === "correct" || phase === "locked") {
|
|
3384
3455
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -3481,7 +3552,7 @@ function ClassifyCategory({
|
|
|
3481
3552
|
}
|
|
3482
3553
|
|
|
3483
3554
|
// src/questions/classify/classify-page.tsx
|
|
3484
|
-
import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3555
|
+
import { Fragment as Fragment9, jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3485
3556
|
function ClassifyPage({
|
|
3486
3557
|
data,
|
|
3487
3558
|
placed,
|
|
@@ -3493,7 +3564,7 @@ function ClassifyPage({
|
|
|
3493
3564
|
onUnplace,
|
|
3494
3565
|
onPick
|
|
3495
3566
|
}) {
|
|
3496
|
-
return /* @__PURE__ */ jsxs28(
|
|
3567
|
+
return /* @__PURE__ */ jsxs28(Fragment9, { children: [
|
|
3497
3568
|
data.categories.map((category, categoryIndex) => /* @__PURE__ */ jsx37(
|
|
3498
3569
|
ClassifyCategory,
|
|
3499
3570
|
{
|
|
@@ -3557,7 +3628,7 @@ function ClassifyFeedback({
|
|
|
3557
3628
|
}
|
|
3558
3629
|
|
|
3559
3630
|
// src/questions/classify/use-classify.ts
|
|
3560
|
-
import { useState as
|
|
3631
|
+
import { useState as useState16 } from "react";
|
|
3561
3632
|
function useClassify({
|
|
3562
3633
|
data,
|
|
3563
3634
|
mode,
|
|
@@ -3568,12 +3639,12 @@ function useClassify({
|
|
|
3568
3639
|
var _a;
|
|
3569
3640
|
const labels = useQuestLabels();
|
|
3570
3641
|
const readonly = isReadonly(mode);
|
|
3571
|
-
const [placed, setPlaced] =
|
|
3642
|
+
const [placed, setPlaced] = useState16(
|
|
3572
3643
|
() => data.items.map(
|
|
3573
3644
|
(item) => demoAttempt === 2 ? item.category === data.categories.length - 1 ? 0 : item.category : readonly ? item.category : null
|
|
3574
3645
|
)
|
|
3575
3646
|
);
|
|
3576
|
-
const [current, setCurrent] =
|
|
3647
|
+
const [current, setCurrent] = useState16(0);
|
|
3577
3648
|
const judge = useJudge({
|
|
3578
3649
|
evaluate: () => data.items.every((item, itemIndex) => placed[itemIndex] === item.category),
|
|
3579
3650
|
onFirstWrong: () => setPlaced(
|
|
@@ -3639,7 +3710,7 @@ function useClassify({
|
|
|
3639
3710
|
}
|
|
3640
3711
|
|
|
3641
3712
|
// src/questions/classify/index.tsx
|
|
3642
|
-
import { Fragment as
|
|
3713
|
+
import { Fragment as Fragment10, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3643
3714
|
function Classify({
|
|
3644
3715
|
data,
|
|
3645
3716
|
mode = "answer",
|
|
@@ -3652,7 +3723,6 @@ function Classify({
|
|
|
3652
3723
|
onNext,
|
|
3653
3724
|
onSubmit,
|
|
3654
3725
|
sound,
|
|
3655
|
-
frame,
|
|
3656
3726
|
demoAttempt,
|
|
3657
3727
|
className
|
|
3658
3728
|
}) {
|
|
@@ -3662,7 +3732,6 @@ function Classify({
|
|
|
3662
3732
|
phase: model.judge.phase,
|
|
3663
3733
|
labels: model.labels,
|
|
3664
3734
|
full: model.full,
|
|
3665
|
-
onPrev,
|
|
3666
3735
|
onNext,
|
|
3667
3736
|
onSubmit: model.handleSubmit,
|
|
3668
3737
|
onRetry: model.judge.retry
|
|
@@ -3674,12 +3743,11 @@ function Classify({
|
|
|
3674
3743
|
title: title != null ? title : "\u5206\u7C7B\u9898",
|
|
3675
3744
|
index,
|
|
3676
3745
|
total,
|
|
3677
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs29(
|
|
3746
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs29(Fragment10, { children: [
|
|
3678
3747
|
"\u628A\u5355\u8BCD\u70B9\u9009\u5230",
|
|
3679
3748
|
/* @__PURE__ */ jsx39("b", { children: "\u6B63\u786E\u7684\u7C7B\u522B" })
|
|
3680
3749
|
] }),
|
|
3681
3750
|
onBack,
|
|
3682
|
-
frame,
|
|
3683
3751
|
className: classNames("rqk-quest", "rqk-classify", className),
|
|
3684
3752
|
dataQuest: "classify",
|
|
3685
3753
|
feedback: /* @__PURE__ */ jsx39(
|
|
@@ -3692,7 +3760,7 @@ function Classify({
|
|
|
3692
3760
|
answerText: model.answerText
|
|
3693
3761
|
}
|
|
3694
3762
|
),
|
|
3695
|
-
footer: /* @__PURE__ */ jsx39(ActionBar, { actions }),
|
|
3763
|
+
footer: /* @__PURE__ */ jsx39(ActionBar, { actions, index, onPrev }),
|
|
3696
3764
|
children: /* @__PURE__ */ jsx39(
|
|
3697
3765
|
ClassifyPage,
|
|
3698
3766
|
{
|
|
@@ -3717,7 +3785,6 @@ function rewriteActions({
|
|
|
3717
3785
|
phase,
|
|
3718
3786
|
labels,
|
|
3719
3787
|
hasValue,
|
|
3720
|
-
onPrev,
|
|
3721
3788
|
onNext,
|
|
3722
3789
|
onSubmit,
|
|
3723
3790
|
onRetry
|
|
@@ -3725,9 +3792,6 @@ function rewriteActions({
|
|
|
3725
3792
|
const actions = [];
|
|
3726
3793
|
const graded = phase === "correct" || phase === "locked";
|
|
3727
3794
|
if (readonly) {
|
|
3728
|
-
if (onPrev) {
|
|
3729
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
3730
|
-
}
|
|
3731
3795
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
3732
3796
|
} else if (graded) {
|
|
3733
3797
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -3838,7 +3902,7 @@ function RewriteKbHint({ text }) {
|
|
|
3838
3902
|
}
|
|
3839
3903
|
|
|
3840
3904
|
// src/questions/rewrite/use-rewrite.ts
|
|
3841
|
-
import { useEffect as
|
|
3905
|
+
import { useEffect as useEffect12, useRef as useRef11, useState as useState17 } from "react";
|
|
3842
3906
|
function useRewrite({
|
|
3843
3907
|
data,
|
|
3844
3908
|
mode,
|
|
@@ -3849,7 +3913,7 @@ function useRewrite({
|
|
|
3849
3913
|
const labels = useQuestLabels();
|
|
3850
3914
|
const readonly = isReadonly(mode);
|
|
3851
3915
|
const areaRef = useRef11(null);
|
|
3852
|
-
const [value, setValue] =
|
|
3916
|
+
const [value, setValue] = useState17(
|
|
3853
3917
|
() => {
|
|
3854
3918
|
var _a;
|
|
3855
3919
|
return readonly || demoAttempt === 2 ? (_a = data.answers[0]) != null ? _a : "" : "";
|
|
@@ -3860,7 +3924,7 @@ function useRewrite({
|
|
|
3860
3924
|
sound,
|
|
3861
3925
|
demoAttempt
|
|
3862
3926
|
});
|
|
3863
|
-
|
|
3927
|
+
useEffect12(() => {
|
|
3864
3928
|
const area = areaRef.current;
|
|
3865
3929
|
if (!area) return;
|
|
3866
3930
|
area.style.height = "auto";
|
|
@@ -3894,7 +3958,7 @@ function useRewrite({
|
|
|
3894
3958
|
}
|
|
3895
3959
|
|
|
3896
3960
|
// src/questions/rewrite/index.tsx
|
|
3897
|
-
import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3961
|
+
import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3898
3962
|
function Rewrite({
|
|
3899
3963
|
data,
|
|
3900
3964
|
mode = "answer",
|
|
@@ -3907,7 +3971,6 @@ function Rewrite({
|
|
|
3907
3971
|
onNext,
|
|
3908
3972
|
onSubmit,
|
|
3909
3973
|
sound,
|
|
3910
|
-
frame,
|
|
3911
3974
|
demoAttempt,
|
|
3912
3975
|
className
|
|
3913
3976
|
}) {
|
|
@@ -3918,7 +3981,6 @@ function Rewrite({
|
|
|
3918
3981
|
phase: model.judge.phase,
|
|
3919
3982
|
labels: model.labels,
|
|
3920
3983
|
hasValue: Boolean(model.value.trim()),
|
|
3921
|
-
onPrev,
|
|
3922
3984
|
onNext,
|
|
3923
3985
|
onSubmit: model.handleSubmit,
|
|
3924
3986
|
onRetry: model.judge.retry
|
|
@@ -3932,7 +3994,6 @@ function Rewrite({
|
|
|
3932
3994
|
total,
|
|
3933
3995
|
instruction: (_a = instruction != null ? instruction : data.prompt) != null ? _a : "\u6539\u5199\u53E5\u5B50\uFF0C\u4FDD\u6301\u65F6\u6001\u4E0E\u8BED\u5E8F",
|
|
3934
3996
|
onBack,
|
|
3935
|
-
frame,
|
|
3936
3997
|
className: classNames("rqk-quest", "rqk-rewrite", className),
|
|
3937
3998
|
dataQuest: "rewrite",
|
|
3938
3999
|
feedback: /* @__PURE__ */ jsx43(
|
|
@@ -3944,8 +4005,8 @@ function Rewrite({
|
|
|
3944
4005
|
labels: model.labels
|
|
3945
4006
|
}
|
|
3946
4007
|
),
|
|
3947
|
-
footer: /* @__PURE__ */ jsx43(ActionBar, { actions }),
|
|
3948
|
-
children: /* @__PURE__ */ jsxs32(
|
|
4008
|
+
footer: /* @__PURE__ */ jsx43(ActionBar, { actions, index, onPrev }),
|
|
4009
|
+
children: /* @__PURE__ */ jsxs32(Fragment11, { children: [
|
|
3949
4010
|
/* @__PURE__ */ jsx43(
|
|
3950
4011
|
RewriteAnswerCard,
|
|
3951
4012
|
{
|
|
@@ -3971,7 +4032,6 @@ function fillBlankActions({
|
|
|
3971
4032
|
phase,
|
|
3972
4033
|
labels,
|
|
3973
4034
|
filled,
|
|
3974
|
-
onPrev,
|
|
3975
4035
|
onNext,
|
|
3976
4036
|
onSubmit,
|
|
3977
4037
|
onRetry
|
|
@@ -3979,9 +4039,6 @@ function fillBlankActions({
|
|
|
3979
4039
|
const actions = [];
|
|
3980
4040
|
const graded = phase === "correct" || phase === "locked";
|
|
3981
4041
|
if (readonly) {
|
|
3982
|
-
if (onPrev) {
|
|
3983
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
3984
|
-
}
|
|
3985
4042
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
3986
4043
|
} else if (graded) {
|
|
3987
4044
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -4114,7 +4171,7 @@ function FillBlankPassage({
|
|
|
4114
4171
|
}
|
|
4115
4172
|
|
|
4116
4173
|
// src/questions/fill-blank/use-fill-blank.ts
|
|
4117
|
-
import { useState as
|
|
4174
|
+
import { useState as useState18 } from "react";
|
|
4118
4175
|
function useFillBlank({
|
|
4119
4176
|
data,
|
|
4120
4177
|
mode,
|
|
@@ -4124,7 +4181,7 @@ function useFillBlank({
|
|
|
4124
4181
|
}) {
|
|
4125
4182
|
const labels = useQuestLabels();
|
|
4126
4183
|
const readonly = isReadonly(mode);
|
|
4127
|
-
const [values, setValues] =
|
|
4184
|
+
const [values, setValues] = useState18(
|
|
4128
4185
|
() => data.blanks.map((blank, blankIndex) => {
|
|
4129
4186
|
var _a, _b;
|
|
4130
4187
|
if (readonly) return (_a = blank.answers[0]) != null ? _a : "";
|
|
@@ -4186,7 +4243,7 @@ function useFillBlank({
|
|
|
4186
4243
|
}
|
|
4187
4244
|
|
|
4188
4245
|
// src/questions/fill-blank/index.tsx
|
|
4189
|
-
import { Fragment as
|
|
4246
|
+
import { Fragment as Fragment12, jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4190
4247
|
function FillBlank({
|
|
4191
4248
|
data,
|
|
4192
4249
|
mode = "answer",
|
|
@@ -4199,7 +4256,6 @@ function FillBlank({
|
|
|
4199
4256
|
onNext,
|
|
4200
4257
|
onSubmit,
|
|
4201
4258
|
sound,
|
|
4202
|
-
frame,
|
|
4203
4259
|
demoAttempt,
|
|
4204
4260
|
className
|
|
4205
4261
|
}) {
|
|
@@ -4209,7 +4265,6 @@ function FillBlank({
|
|
|
4209
4265
|
phase: model.judge.phase,
|
|
4210
4266
|
labels: model.labels,
|
|
4211
4267
|
filled: model.filled,
|
|
4212
|
-
onPrev,
|
|
4213
4268
|
onNext,
|
|
4214
4269
|
onSubmit: model.handleSubmit,
|
|
4215
4270
|
onRetry: model.judge.retry
|
|
@@ -4221,13 +4276,12 @@ function FillBlank({
|
|
|
4221
4276
|
title: title != null ? title : "\u586B\u7A7A\u9898",
|
|
4222
4277
|
index,
|
|
4223
4278
|
total,
|
|
4224
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs34(
|
|
4279
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
4225
4280
|
"\u8BFB\u77ED\u6587\uFF0C\u5728",
|
|
4226
4281
|
/* @__PURE__ */ jsx47("b", { children: "\u6A2A\u7EBF" }),
|
|
4227
4282
|
"\u5904\u8F93\u5165\u6B63\u786E\u7684\u8BCD"
|
|
4228
4283
|
] }),
|
|
4229
4284
|
onBack,
|
|
4230
|
-
frame,
|
|
4231
4285
|
className: classNames("rqk-quest", "rqk-fill-blank", className),
|
|
4232
4286
|
dataQuest: "fill-blank",
|
|
4233
4287
|
feedback: /* @__PURE__ */ jsx47(
|
|
@@ -4240,8 +4294,8 @@ function FillBlank({
|
|
|
4240
4294
|
answerText: model.answerText
|
|
4241
4295
|
}
|
|
4242
4296
|
),
|
|
4243
|
-
footer: /* @__PURE__ */ jsx47(ActionBar, { actions }),
|
|
4244
|
-
children: /* @__PURE__ */ jsxs34(
|
|
4297
|
+
footer: /* @__PURE__ */ jsx47(ActionBar, { actions, index, onPrev }),
|
|
4298
|
+
children: /* @__PURE__ */ jsxs34(Fragment12, { children: [
|
|
4245
4299
|
/* @__PURE__ */ jsx47(
|
|
4246
4300
|
FillBlankPassage,
|
|
4247
4301
|
{
|
|
@@ -4268,16 +4322,12 @@ function wordSelectActions({
|
|
|
4268
4322
|
phase,
|
|
4269
4323
|
labels,
|
|
4270
4324
|
full,
|
|
4271
|
-
onPrev,
|
|
4272
4325
|
onNext,
|
|
4273
4326
|
onSubmit,
|
|
4274
4327
|
onRetry
|
|
4275
4328
|
}) {
|
|
4276
4329
|
const actions = [];
|
|
4277
4330
|
if (readonly) {
|
|
4278
|
-
if (onPrev) {
|
|
4279
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
4280
|
-
}
|
|
4281
4331
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
4282
4332
|
} else if (phase === "correct" || phase === "locked") {
|
|
4283
4333
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -4404,7 +4454,7 @@ function WordSelectPassage({
|
|
|
4404
4454
|
}
|
|
4405
4455
|
|
|
4406
4456
|
// src/questions/word-select/use-word-select.ts
|
|
4407
|
-
import { useEffect as
|
|
4457
|
+
import { useEffect as useEffect13, useState as useState19 } from "react";
|
|
4408
4458
|
|
|
4409
4459
|
// src/questions/word-select/word-select-model.ts
|
|
4410
4460
|
function buildBank(words) {
|
|
@@ -4429,16 +4479,16 @@ function useWordSelect({
|
|
|
4429
4479
|
const labels = useQuestLabels();
|
|
4430
4480
|
const readonly = isReadonly(mode);
|
|
4431
4481
|
const interaction = (_a = data.interaction) != null ? _a : "sequence";
|
|
4432
|
-
const [filled, setFilled] =
|
|
4482
|
+
const [filled, setFilled] = useState19(
|
|
4433
4483
|
() => data.blanks.map((blank, blankIndex) => {
|
|
4434
4484
|
if (readonly) return blank.answer;
|
|
4435
4485
|
if (demoAttempt === 2) return blankIndex === 1 ? "banana" : blank.answer;
|
|
4436
4486
|
return null;
|
|
4437
4487
|
})
|
|
4438
4488
|
);
|
|
4439
|
-
const [selected, setSelected] =
|
|
4440
|
-
const [notice, setNotice] =
|
|
4441
|
-
|
|
4489
|
+
const [selected, setSelected] = useState19(0);
|
|
4490
|
+
const [notice, setNotice] = useState19("");
|
|
4491
|
+
useEffect13(() => {
|
|
4442
4492
|
if (!notice) return void 0;
|
|
4443
4493
|
const timer = window.setTimeout(() => setNotice(""), 2400);
|
|
4444
4494
|
return () => window.clearTimeout(timer);
|
|
@@ -4524,7 +4574,7 @@ function useWordSelect({
|
|
|
4524
4574
|
}
|
|
4525
4575
|
|
|
4526
4576
|
// src/questions/word-select/index.tsx
|
|
4527
|
-
import { Fragment as
|
|
4577
|
+
import { Fragment as Fragment13, jsx as jsx51, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4528
4578
|
function WordSelect({
|
|
4529
4579
|
data,
|
|
4530
4580
|
mode = "answer",
|
|
@@ -4537,7 +4587,6 @@ function WordSelect({
|
|
|
4537
4587
|
onNext,
|
|
4538
4588
|
onSubmit,
|
|
4539
4589
|
sound,
|
|
4540
|
-
frame,
|
|
4541
4590
|
demoAttempt,
|
|
4542
4591
|
className
|
|
4543
4592
|
}) {
|
|
@@ -4547,7 +4596,6 @@ function WordSelect({
|
|
|
4547
4596
|
phase: model.judge.phase,
|
|
4548
4597
|
labels: model.labels,
|
|
4549
4598
|
full: model.full,
|
|
4550
|
-
onPrev,
|
|
4551
4599
|
onNext,
|
|
4552
4600
|
onSubmit: model.handleSubmit,
|
|
4553
4601
|
onRetry: model.judge.retry
|
|
@@ -4559,13 +4607,12 @@ function WordSelect({
|
|
|
4559
4607
|
title: title != null ? title : "\u9009\u8BCD\u586B\u7A7A",
|
|
4560
4608
|
index,
|
|
4561
4609
|
total,
|
|
4562
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs37(
|
|
4610
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs37(Fragment13, { children: [
|
|
4563
4611
|
"\u4ECE\u9009\u9879\u5E93",
|
|
4564
4612
|
/* @__PURE__ */ jsx51("b", { children: "\u9009\u8BCD" }),
|
|
4565
4613
|
"\uFF0C\u8865\u5168\u77ED\u6587"
|
|
4566
4614
|
] }),
|
|
4567
4615
|
onBack,
|
|
4568
|
-
frame,
|
|
4569
4616
|
className: classNames("rqk-quest", "rqk-word-select", className),
|
|
4570
4617
|
dataQuest: "word-select",
|
|
4571
4618
|
feedback: /* @__PURE__ */ jsx51(
|
|
@@ -4578,8 +4625,8 @@ function WordSelect({
|
|
|
4578
4625
|
answerText: model.answerText
|
|
4579
4626
|
}
|
|
4580
4627
|
),
|
|
4581
|
-
footer: /* @__PURE__ */ jsx51(ActionBar, { actions }),
|
|
4582
|
-
children: /* @__PURE__ */ jsxs37(
|
|
4628
|
+
footer: /* @__PURE__ */ jsx51(ActionBar, { actions, index, onPrev }),
|
|
4629
|
+
children: /* @__PURE__ */ jsxs37(Fragment13, { children: [
|
|
4583
4630
|
/* @__PURE__ */ jsx51(
|
|
4584
4631
|
WordSelectPassage,
|
|
4585
4632
|
{
|
|
@@ -4613,23 +4660,24 @@ function sortSentencesActions({
|
|
|
4613
4660
|
phase,
|
|
4614
4661
|
labels,
|
|
4615
4662
|
full,
|
|
4616
|
-
onPrev,
|
|
4617
4663
|
onNext,
|
|
4618
4664
|
onSubmit,
|
|
4619
4665
|
onRetry
|
|
4620
4666
|
}) {
|
|
4621
4667
|
const actions = [];
|
|
4622
4668
|
if (readonly) {
|
|
4623
|
-
if (onPrev) {
|
|
4624
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
4625
|
-
}
|
|
4626
4669
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
4627
4670
|
} else if (phase === "correct" || phase === "locked") {
|
|
4628
4671
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
4629
4672
|
} else if (phase === "retry") {
|
|
4630
4673
|
actions.push({ key: "retry", label: labels.retry, onClick: onRetry });
|
|
4631
|
-
} else
|
|
4632
|
-
actions.push({
|
|
4674
|
+
} else {
|
|
4675
|
+
actions.push({
|
|
4676
|
+
key: "submit",
|
|
4677
|
+
label: labels.submit,
|
|
4678
|
+
onClick: onSubmit,
|
|
4679
|
+
disabled: !full
|
|
4680
|
+
});
|
|
4633
4681
|
}
|
|
4634
4682
|
return actions;
|
|
4635
4683
|
}
|
|
@@ -4741,7 +4789,7 @@ function SortRows({
|
|
|
4741
4789
|
}
|
|
4742
4790
|
|
|
4743
4791
|
// src/questions/sort-sentences/use-sort-sentences.ts
|
|
4744
|
-
import { useEffect as
|
|
4792
|
+
import { useEffect as useEffect14, useState as useState20 } from "react";
|
|
4745
4793
|
|
|
4746
4794
|
// src/questions/sort-sentences/sort-model.ts
|
|
4747
4795
|
function buildBank2(sentences) {
|
|
@@ -4764,7 +4812,7 @@ function useSortSentences({
|
|
|
4764
4812
|
}) {
|
|
4765
4813
|
const labels = useQuestLabels();
|
|
4766
4814
|
const readonly = isReadonly(mode);
|
|
4767
|
-
const [rows, setRows] =
|
|
4815
|
+
const [rows, setRows] = useState20(
|
|
4768
4816
|
() => data.order.map((sentence, rowIndex) => {
|
|
4769
4817
|
var _a;
|
|
4770
4818
|
if (readonly) return sentence;
|
|
@@ -4772,7 +4820,7 @@ function useSortSentences({
|
|
|
4772
4820
|
return null;
|
|
4773
4821
|
})
|
|
4774
4822
|
);
|
|
4775
|
-
const [notice, setNotice] =
|
|
4823
|
+
const [notice, setNotice] = useState20("");
|
|
4776
4824
|
const judge = useJudge({
|
|
4777
4825
|
evaluate: () => data.order.every((sentence, rowIndex) => rows[rowIndex] === sentence),
|
|
4778
4826
|
onFirstWrong: () => setRows(
|
|
@@ -4782,7 +4830,7 @@ function useSortSentences({
|
|
|
4782
4830
|
demoAttempt
|
|
4783
4831
|
});
|
|
4784
4832
|
const frozen = readonly || judge.phase === "correct" || judge.phase === "locked";
|
|
4785
|
-
|
|
4833
|
+
useEffect14(() => {
|
|
4786
4834
|
if (!notice) return void 0;
|
|
4787
4835
|
const timer = window.setTimeout(() => setNotice(""), 2400);
|
|
4788
4836
|
return () => window.clearTimeout(timer);
|
|
@@ -4836,7 +4884,7 @@ function useSortSentences({
|
|
|
4836
4884
|
}
|
|
4837
4885
|
|
|
4838
4886
|
// src/questions/sort-sentences/index.tsx
|
|
4839
|
-
import { Fragment as
|
|
4887
|
+
import { Fragment as Fragment14, jsx as jsx55, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4840
4888
|
function SortSentences({
|
|
4841
4889
|
data,
|
|
4842
4890
|
mode = "answer",
|
|
@@ -4849,7 +4897,6 @@ function SortSentences({
|
|
|
4849
4897
|
onNext,
|
|
4850
4898
|
onSubmit,
|
|
4851
4899
|
sound,
|
|
4852
|
-
frame,
|
|
4853
4900
|
demoAttempt,
|
|
4854
4901
|
className
|
|
4855
4902
|
}) {
|
|
@@ -4859,7 +4906,6 @@ function SortSentences({
|
|
|
4859
4906
|
phase: model.judge.phase,
|
|
4860
4907
|
labels: model.labels,
|
|
4861
4908
|
full: model.full,
|
|
4862
|
-
onPrev,
|
|
4863
4909
|
onNext,
|
|
4864
4910
|
onSubmit: model.handleSubmit,
|
|
4865
4911
|
onRetry: model.judge.retry
|
|
@@ -4871,13 +4917,12 @@ function SortSentences({
|
|
|
4871
4917
|
title: title != null ? title : "\u53E5\u5B50\u6392\u5E8F",
|
|
4872
4918
|
index,
|
|
4873
4919
|
total,
|
|
4874
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs40(
|
|
4920
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
4875
4921
|
"\u6309\u6B63\u786E",
|
|
4876
4922
|
/* @__PURE__ */ jsx55("b", { children: "\u987A\u5E8F" }),
|
|
4877
4923
|
"\u6392\u5217\u53E5\u5B50\uFF0C\u70B9\u51FB\u7A7A\u884C\u653E\u5165"
|
|
4878
4924
|
] }),
|
|
4879
4925
|
onBack,
|
|
4880
|
-
frame,
|
|
4881
4926
|
className: classNames("rqk-quest", "rqk-sort", className),
|
|
4882
4927
|
dataQuest: "sort-sentences",
|
|
4883
4928
|
feedback: /* @__PURE__ */ jsx55(
|
|
@@ -4889,8 +4934,8 @@ function SortSentences({
|
|
|
4889
4934
|
labels: model.labels
|
|
4890
4935
|
}
|
|
4891
4936
|
),
|
|
4892
|
-
footer: actions.length ? /* @__PURE__ */ jsx55(ActionBar, { actions }) : void 0,
|
|
4893
|
-
children: /* @__PURE__ */ jsxs40(
|
|
4937
|
+
footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ jsx55(ActionBar, { actions, index, onPrev }) : void 0,
|
|
4938
|
+
children: /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
4894
4939
|
/* @__PURE__ */ jsx55(
|
|
4895
4940
|
SortRows,
|
|
4896
4941
|
{
|
|
@@ -4923,16 +4968,12 @@ function clozeActions({
|
|
|
4923
4968
|
phase,
|
|
4924
4969
|
labels,
|
|
4925
4970
|
full,
|
|
4926
|
-
onPrev,
|
|
4927
4971
|
onNext,
|
|
4928
4972
|
onSubmit,
|
|
4929
4973
|
onRetry
|
|
4930
4974
|
}) {
|
|
4931
4975
|
const actions = [];
|
|
4932
4976
|
if (readonly) {
|
|
4933
|
-
if (onPrev) {
|
|
4934
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
4935
|
-
}
|
|
4936
4977
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
4937
4978
|
} else if (phase === "correct" || phase === "locked") {
|
|
4938
4979
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
@@ -5077,7 +5118,7 @@ function ClozePassage({
|
|
|
5077
5118
|
}
|
|
5078
5119
|
|
|
5079
5120
|
// src/questions/cloze/use-cloze.ts
|
|
5080
|
-
import { useState as
|
|
5121
|
+
import { useState as useState21 } from "react";
|
|
5081
5122
|
|
|
5082
5123
|
// src/questions/cloze/cloze-model.ts
|
|
5083
5124
|
function answerIndex(options, answer) {
|
|
@@ -5095,7 +5136,7 @@ function useCloze({
|
|
|
5095
5136
|
}) {
|
|
5096
5137
|
const labels = useQuestLabels();
|
|
5097
5138
|
const readonly = isReadonly(mode);
|
|
5098
|
-
const [selected, setSelected] =
|
|
5139
|
+
const [selected, setSelected] = useState21(
|
|
5099
5140
|
() => data.gaps.map((gap, gapIndex) => {
|
|
5100
5141
|
var _a, _b, _c;
|
|
5101
5142
|
if (readonly) return answerIndex((_a = data.options[gapIndex]) != null ? _a : [], gap.answer);
|
|
@@ -5105,7 +5146,7 @@ function useCloze({
|
|
|
5105
5146
|
return null;
|
|
5106
5147
|
})
|
|
5107
5148
|
);
|
|
5108
|
-
const [current, setCurrent] =
|
|
5149
|
+
const [current, setCurrent] = useState21(0);
|
|
5109
5150
|
const judge = useJudge({
|
|
5110
5151
|
evaluate: () => data.gaps.every(
|
|
5111
5152
|
(gap, gapIndex) => {
|
|
@@ -5173,7 +5214,7 @@ function useCloze({
|
|
|
5173
5214
|
}
|
|
5174
5215
|
|
|
5175
5216
|
// src/questions/cloze/index.tsx
|
|
5176
|
-
import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5217
|
+
import { Fragment as Fragment15, jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5177
5218
|
function Cloze({
|
|
5178
5219
|
data,
|
|
5179
5220
|
mode = "answer",
|
|
@@ -5186,7 +5227,6 @@ function Cloze({
|
|
|
5186
5227
|
onNext,
|
|
5187
5228
|
onSubmit,
|
|
5188
5229
|
sound,
|
|
5189
|
-
frame,
|
|
5190
5230
|
demoAttempt,
|
|
5191
5231
|
className
|
|
5192
5232
|
}) {
|
|
@@ -5196,7 +5236,6 @@ function Cloze({
|
|
|
5196
5236
|
phase: model.judge.phase,
|
|
5197
5237
|
labels: model.labels,
|
|
5198
5238
|
full: model.full,
|
|
5199
|
-
onPrev,
|
|
5200
5239
|
onNext,
|
|
5201
5240
|
onSubmit: model.handleSubmit,
|
|
5202
5241
|
onRetry: model.judge.retry
|
|
@@ -5210,7 +5249,6 @@ function Cloze({
|
|
|
5210
5249
|
total,
|
|
5211
5250
|
instruction: instruction != null ? instruction : "\u901A\u8BFB\u77ED\u6587\uFF0C\u4E3A\u6BCF\u7A7A\u9009\u62E9\u6700\u4F73\u7B54\u6848",
|
|
5212
5251
|
onBack,
|
|
5213
|
-
frame,
|
|
5214
5252
|
className: classNames("rqk-quest", "rqk-cloze", className),
|
|
5215
5253
|
dataQuest: "cloze",
|
|
5216
5254
|
feedback: /* @__PURE__ */ jsx59(
|
|
@@ -5223,8 +5261,8 @@ function Cloze({
|
|
|
5223
5261
|
answerText: model.answerText
|
|
5224
5262
|
}
|
|
5225
5263
|
),
|
|
5226
|
-
footer: /* @__PURE__ */ jsx59(ActionBar, { actions }),
|
|
5227
|
-
children: /* @__PURE__ */ jsxs43(
|
|
5264
|
+
footer: /* @__PURE__ */ jsx59(ActionBar, { actions, index, onPrev }),
|
|
5265
|
+
children: /* @__PURE__ */ jsxs43(Fragment15, { children: [
|
|
5228
5266
|
/* @__PURE__ */ jsx59(
|
|
5229
5267
|
ClozePassage,
|
|
5230
5268
|
{
|
|
@@ -5258,23 +5296,24 @@ function readingActions({
|
|
|
5258
5296
|
phase,
|
|
5259
5297
|
labels,
|
|
5260
5298
|
full,
|
|
5261
|
-
onPrev,
|
|
5262
5299
|
onNext,
|
|
5263
5300
|
onSubmit,
|
|
5264
5301
|
onRetry
|
|
5265
5302
|
}) {
|
|
5266
5303
|
const actions = [];
|
|
5267
5304
|
if (readonly) {
|
|
5268
|
-
if (onPrev) {
|
|
5269
|
-
actions.push({ key: "prev", label: labels.prev, variant: "ghost", onClick: onPrev });
|
|
5270
|
-
}
|
|
5271
5305
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
5272
5306
|
} else if (phase === "correct" || phase === "locked") {
|
|
5273
5307
|
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
5274
5308
|
} else if (phase === "retry") {
|
|
5275
5309
|
actions.push({ key: "retry", label: labels.retry, onClick: onRetry });
|
|
5276
|
-
} else
|
|
5277
|
-
actions.push({
|
|
5310
|
+
} else {
|
|
5311
|
+
actions.push({
|
|
5312
|
+
key: "submit",
|
|
5313
|
+
label: labels.submit,
|
|
5314
|
+
onClick: onSubmit,
|
|
5315
|
+
disabled: !full
|
|
5316
|
+
});
|
|
5278
5317
|
}
|
|
5279
5318
|
return actions;
|
|
5280
5319
|
}
|
|
@@ -5461,7 +5500,7 @@ function ReadingQuestion({
|
|
|
5461
5500
|
}
|
|
5462
5501
|
|
|
5463
5502
|
// src/questions/reading-comprehension/reading-page.tsx
|
|
5464
|
-
import { jsx as jsx64, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5503
|
+
import { Fragment as Fragment16, jsx as jsx64, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5465
5504
|
function ReadingPage({
|
|
5466
5505
|
data,
|
|
5467
5506
|
collapsible,
|
|
@@ -5477,7 +5516,7 @@ function ReadingPage({
|
|
|
5477
5516
|
onChip,
|
|
5478
5517
|
onPick
|
|
5479
5518
|
}) {
|
|
5480
|
-
return /* @__PURE__ */ jsxs47(
|
|
5519
|
+
return /* @__PURE__ */ jsxs47(Fragment16, { children: [
|
|
5481
5520
|
/* @__PURE__ */ jsx64(
|
|
5482
5521
|
ReadingPassage,
|
|
5483
5522
|
{
|
|
@@ -5517,7 +5556,7 @@ function ReadingPage({
|
|
|
5517
5556
|
}
|
|
5518
5557
|
|
|
5519
5558
|
// src/questions/reading-comprehension/use-passage-fold.ts
|
|
5520
|
-
import { useEffect as
|
|
5559
|
+
import { useEffect as useEffect15, useRef as useRef12, useState as useState22 } from "react";
|
|
5521
5560
|
function usePassageFold({
|
|
5522
5561
|
passage,
|
|
5523
5562
|
collapsible,
|
|
@@ -5525,9 +5564,9 @@ function usePassageFold({
|
|
|
5525
5564
|
sound
|
|
5526
5565
|
}) {
|
|
5527
5566
|
const textRef = useRef12(null);
|
|
5528
|
-
const [folded, setFolded] =
|
|
5529
|
-
const [fullHeight, setFullHeight] =
|
|
5530
|
-
|
|
5567
|
+
const [folded, setFolded] = useState22(collapsible && defaultCollapsed);
|
|
5568
|
+
const [fullHeight, setFullHeight] = useState22(0);
|
|
5569
|
+
useEffect15(() => {
|
|
5531
5570
|
const element = textRef.current;
|
|
5532
5571
|
if (!element) return void 0;
|
|
5533
5572
|
const measure = () => setFullHeight(element.scrollHeight);
|
|
@@ -5548,7 +5587,7 @@ function usePassageFold({
|
|
|
5548
5587
|
}
|
|
5549
5588
|
|
|
5550
5589
|
// src/questions/reading-comprehension/use-reading-comprehension.ts
|
|
5551
|
-
import { useEffect as
|
|
5590
|
+
import { useEffect as useEffect16, useState as useState23 } from "react";
|
|
5552
5591
|
function useReadingComprehension({
|
|
5553
5592
|
data,
|
|
5554
5593
|
mode,
|
|
@@ -5559,7 +5598,7 @@ function useReadingComprehension({
|
|
|
5559
5598
|
var _a;
|
|
5560
5599
|
const labels = useQuestLabels();
|
|
5561
5600
|
const readonly = isReadonly(mode);
|
|
5562
|
-
const [answers, setAnswers] =
|
|
5601
|
+
const [answers, setAnswers] = useState23(
|
|
5563
5602
|
() => data.questions.map((question, questionIndex) => {
|
|
5564
5603
|
if (readonly) return question.answer;
|
|
5565
5604
|
if (demoAttempt === 2) {
|
|
@@ -5568,13 +5607,13 @@ function useReadingComprehension({
|
|
|
5568
5607
|
return null;
|
|
5569
5608
|
})
|
|
5570
5609
|
);
|
|
5571
|
-
const [locked, setLocked] =
|
|
5610
|
+
const [locked, setLocked] = useState23(
|
|
5572
5611
|
() => data.questions.map(
|
|
5573
5612
|
(question, questionIndex) => demoAttempt === 2 && answers[questionIndex] === question.answer
|
|
5574
5613
|
)
|
|
5575
5614
|
);
|
|
5576
|
-
const [current, setCurrent] =
|
|
5577
|
-
const [notice, setNotice] =
|
|
5615
|
+
const [current, setCurrent] = useState23(0);
|
|
5616
|
+
const [notice, setNotice] = useState23("");
|
|
5578
5617
|
const judge = useJudge({
|
|
5579
5618
|
evaluate: () => data.questions.every((question, questionIndex) => answers[questionIndex] === question.answer),
|
|
5580
5619
|
onFirstWrong: () => {
|
|
@@ -5597,7 +5636,7 @@ function useReadingComprehension({
|
|
|
5597
5636
|
demoAttempt
|
|
5598
5637
|
});
|
|
5599
5638
|
const judged = judge.phase === "correct" || judge.phase === "locked" || readonly;
|
|
5600
|
-
|
|
5639
|
+
useEffect16(() => {
|
|
5601
5640
|
if (!notice) return void 0;
|
|
5602
5641
|
const timer = window.setTimeout(() => setNotice(""), 2400);
|
|
5603
5642
|
return () => window.clearTimeout(timer);
|
|
@@ -5668,7 +5707,7 @@ function useReadingComprehension({
|
|
|
5668
5707
|
}
|
|
5669
5708
|
|
|
5670
5709
|
// src/questions/reading-comprehension/index.tsx
|
|
5671
|
-
import { Fragment as
|
|
5710
|
+
import { Fragment as Fragment17, jsx as jsx65, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5672
5711
|
function ReadingComprehension({
|
|
5673
5712
|
data,
|
|
5674
5713
|
mode = "answer",
|
|
@@ -5681,7 +5720,6 @@ function ReadingComprehension({
|
|
|
5681
5720
|
onNext,
|
|
5682
5721
|
onSubmit,
|
|
5683
5722
|
sound,
|
|
5684
|
-
frame,
|
|
5685
5723
|
demoAttempt,
|
|
5686
5724
|
className
|
|
5687
5725
|
}) {
|
|
@@ -5699,7 +5737,6 @@ function ReadingComprehension({
|
|
|
5699
5737
|
phase: model.judge.phase,
|
|
5700
5738
|
labels: model.labels,
|
|
5701
5739
|
full: model.full,
|
|
5702
|
-
onPrev,
|
|
5703
5740
|
onNext,
|
|
5704
5741
|
onSubmit: model.handleSubmit,
|
|
5705
5742
|
onRetry: model.judge.retry
|
|
@@ -5711,13 +5748,12 @@ function ReadingComprehension({
|
|
|
5711
5748
|
title: title != null ? title : "\u9605\u8BFB\u7406\u89E3",
|
|
5712
5749
|
index,
|
|
5713
5750
|
total,
|
|
5714
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs48(
|
|
5751
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs48(Fragment17, { children: [
|
|
5715
5752
|
"\u9605\u8BFB\u77ED\u6587\uFF0C\u5B8C\u6210 ",
|
|
5716
5753
|
/* @__PURE__ */ jsx65("b", { children: data.questions.length }),
|
|
5717
5754
|
" \u9053\u5C0F\u9898"
|
|
5718
5755
|
] }),
|
|
5719
5756
|
onBack,
|
|
5720
|
-
frame,
|
|
5721
5757
|
className: classNames("rqk-quest", "rqk-reading", className),
|
|
5722
5758
|
dataQuest: "reading-comprehension",
|
|
5723
5759
|
feedback: /* @__PURE__ */ jsx65(
|
|
@@ -5730,7 +5766,7 @@ function ReadingComprehension({
|
|
|
5730
5766
|
answerText: model.answerText
|
|
5731
5767
|
}
|
|
5732
5768
|
),
|
|
5733
|
-
footer: actions.length ? /* @__PURE__ */ jsx65(ActionBar, { actions }) : void 0,
|
|
5769
|
+
footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ jsx65(ActionBar, { actions, index, onPrev }) : void 0,
|
|
5734
5770
|
children: [
|
|
5735
5771
|
/* @__PURE__ */ jsx65(
|
|
5736
5772
|
ReadingPage,
|
|
@@ -5768,14 +5804,19 @@ function listenTaskActions({
|
|
|
5768
5804
|
if (feedback) {
|
|
5769
5805
|
actions.push({ key: "again", label: "\u518D\u542C\u4E00\u904D", variant: "ghost", onClick: onReplay });
|
|
5770
5806
|
actions.push({ key: "next", label: "\u5B8C\u6210\u5E76\u8FD4\u56DE", onClick: onNext });
|
|
5771
|
-
} else
|
|
5772
|
-
actions.push({
|
|
5807
|
+
} else {
|
|
5808
|
+
actions.push({
|
|
5809
|
+
key: "submit",
|
|
5810
|
+
label: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
|
|
5811
|
+
onClick: onSubmit,
|
|
5812
|
+
disabled: !completed
|
|
5813
|
+
});
|
|
5773
5814
|
}
|
|
5774
5815
|
return actions;
|
|
5775
5816
|
}
|
|
5776
5817
|
|
|
5777
5818
|
// src/questions/listen-task/feedback.tsx
|
|
5778
|
-
import { Fragment as
|
|
5819
|
+
import { Fragment as Fragment18, jsx as jsx66, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5779
5820
|
function ListenFeedback({
|
|
5780
5821
|
data,
|
|
5781
5822
|
progress,
|
|
@@ -5785,21 +5826,21 @@ function ListenFeedback({
|
|
|
5785
5826
|
const stats = (_a = data.stats) != null ? _a : [
|
|
5786
5827
|
{
|
|
5787
5828
|
label: "\u542C\u97F3\u9891\u65F6\u957F",
|
|
5788
|
-
value: /* @__PURE__ */ jsxs49(
|
|
5829
|
+
value: /* @__PURE__ */ jsxs49(Fragment18, { children: [
|
|
5789
5830
|
(progress.timeOnTask / 60).toFixed(1),
|
|
5790
5831
|
/* @__PURE__ */ jsx66("small", { children: "min" })
|
|
5791
5832
|
] })
|
|
5792
5833
|
},
|
|
5793
5834
|
{
|
|
5794
5835
|
label: "\u97F3\u9891\u6570\u91CF",
|
|
5795
|
-
value: /* @__PURE__ */ jsxs49(
|
|
5836
|
+
value: /* @__PURE__ */ jsxs49(Fragment18, { children: [
|
|
5796
5837
|
"1",
|
|
5797
5838
|
/* @__PURE__ */ jsx66("small", { children: "\u6BB5" })
|
|
5798
5839
|
] })
|
|
5799
5840
|
},
|
|
5800
5841
|
{
|
|
5801
5842
|
label: "\u5B8C\u6210\u5EA6",
|
|
5802
|
-
value: /* @__PURE__ */ jsxs49(
|
|
5843
|
+
value: /* @__PURE__ */ jsxs49(Fragment18, { children: [
|
|
5803
5844
|
percent,
|
|
5804
5845
|
/* @__PURE__ */ jsx66("small", { children: "%" })
|
|
5805
5846
|
] })
|
|
@@ -5869,7 +5910,7 @@ function ListenRing({ percent }) {
|
|
|
5869
5910
|
}
|
|
5870
5911
|
|
|
5871
5912
|
// src/questions/listen-task/listen-player.tsx
|
|
5872
|
-
import { Fragment as
|
|
5913
|
+
import { Fragment as Fragment19, jsx as jsx69, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5873
5914
|
function ListenPlayer({
|
|
5874
5915
|
data,
|
|
5875
5916
|
progress,
|
|
@@ -5950,7 +5991,7 @@ function ListenPlayer({
|
|
|
5950
5991
|
] }),
|
|
5951
5992
|
/* @__PURE__ */ jsxs52("div", { className: "rqk-listen-progress", children: [
|
|
5952
5993
|
/* @__PURE__ */ jsx69(ListenRing, { percent }),
|
|
5953
|
-
/* @__PURE__ */ jsx69("div", { className: "rqk-listen-credit", children: Math.abs(progress.position - progress.credited) > 0.75 ? /* @__PURE__ */ jsxs52(
|
|
5994
|
+
/* @__PURE__ */ jsx69("div", { className: "rqk-listen-credit", children: Math.abs(progress.position - progress.credited) > 0.75 ? /* @__PURE__ */ jsxs52(Fragment19, { children: [
|
|
5954
5995
|
"\u64AD\u653E ",
|
|
5955
5996
|
/* @__PURE__ */ jsx69("b", { children: formatTime(progress.position) }),
|
|
5956
5997
|
" / ",
|
|
@@ -5958,7 +5999,7 @@ function ListenPlayer({
|
|
|
5958
5999
|
/* @__PURE__ */ jsx69("span", { className: "rqk-listen-credit-sep", children: "\xB7" }),
|
|
5959
6000
|
"\u6709\u6548 ",
|
|
5960
6001
|
/* @__PURE__ */ jsx69("b", { children: formatTime(progress.credited) })
|
|
5961
|
-
] }) : /* @__PURE__ */ jsxs52(
|
|
6002
|
+
] }) : /* @__PURE__ */ jsxs52(Fragment19, { children: [
|
|
5962
6003
|
"\u6709\u6548\u64AD\u653E ",
|
|
5963
6004
|
/* @__PURE__ */ jsx69("b", { children: formatTime(progress.credited) }),
|
|
5964
6005
|
" / ",
|
|
@@ -5977,9 +6018,9 @@ function ListenPlayer({
|
|
|
5977
6018
|
}
|
|
5978
6019
|
|
|
5979
6020
|
// src/questions/listen-task/use-listen-task.ts
|
|
5980
|
-
import { useState as
|
|
6021
|
+
import { useState as useState24 } from "react";
|
|
5981
6022
|
function useListenTask({ data, onSubmit }) {
|
|
5982
|
-
const [view, setView] =
|
|
6023
|
+
const [view, setView] = useState24("task");
|
|
5983
6024
|
const progress = useMediaProgress({
|
|
5984
6025
|
duration: data.duration,
|
|
5985
6026
|
src: data.audio,
|
|
@@ -6003,7 +6044,7 @@ function useListenTask({ data, onSubmit }) {
|
|
|
6003
6044
|
}
|
|
6004
6045
|
|
|
6005
6046
|
// src/questions/listen-task/index.tsx
|
|
6006
|
-
import { Fragment as
|
|
6047
|
+
import { Fragment as Fragment20, jsx as jsx70, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
6007
6048
|
function ListenTask({
|
|
6008
6049
|
data,
|
|
6009
6050
|
mode = "answer",
|
|
@@ -6012,9 +6053,9 @@ function ListenTask({
|
|
|
6012
6053
|
title,
|
|
6013
6054
|
instruction,
|
|
6014
6055
|
onBack,
|
|
6056
|
+
onPrev,
|
|
6015
6057
|
onNext,
|
|
6016
6058
|
onSubmit,
|
|
6017
|
-
frame,
|
|
6018
6059
|
className
|
|
6019
6060
|
}) {
|
|
6020
6061
|
const model = useListenTask({ data, onSubmit });
|
|
@@ -6032,18 +6073,16 @@ function ListenTask({
|
|
|
6032
6073
|
title: title != null ? title : model.view === "feedback" ? "\u542C\u529B\u7EDF\u8BA1" : "\u542C\u529B\u4EFB\u52A1",
|
|
6033
6074
|
index,
|
|
6034
6075
|
total,
|
|
6035
|
-
|
|
6036
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs53(Fragment12, { children: [
|
|
6076
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs53(Fragment20, { children: [
|
|
6037
6077
|
"\u542C\u5B8C\u97F3\u9891\uFF0C\u6709\u6548\u64AD\u653E ",
|
|
6038
6078
|
/* @__PURE__ */ jsx70("b", { children: "\u226590%" }),
|
|
6039
6079
|
" \u89C6\u4E3A\u5B8C\u6210"
|
|
6040
6080
|
] }),
|
|
6041
6081
|
onBack,
|
|
6042
|
-
frame,
|
|
6043
6082
|
className: classNames("rqk-quest", "rqk-listen", className),
|
|
6044
6083
|
dataQuest: "listen-task",
|
|
6045
|
-
footer: /* @__PURE__ */ jsx70(ActionBar, { actions }),
|
|
6046
|
-
children: model.view === "feedback" ? /* @__PURE__ */ jsx70(ListenFeedback, { data, progress: model.progress, percent: model.percent }) : /* @__PURE__ */ jsxs53(
|
|
6084
|
+
footer: /* @__PURE__ */ jsx70(ActionBar, { actions, index, onPrev }),
|
|
6085
|
+
children: model.view === "feedback" ? /* @__PURE__ */ jsx70(ListenFeedback, { data, progress: model.progress, percent: model.percent }) : /* @__PURE__ */ jsxs53(Fragment20, { children: [
|
|
6047
6086
|
/* @__PURE__ */ jsx70(ListenHero, { data }),
|
|
6048
6087
|
/* @__PURE__ */ jsx70(ListenPlayer, { data, progress: model.progress, percent: model.percent })
|
|
6049
6088
|
] })
|
|
@@ -6063,14 +6102,19 @@ function videoTaskActions({
|
|
|
6063
6102
|
if (feedback) {
|
|
6064
6103
|
actions.push({ key: "again", label: "\u518D\u770B\u4E00\u904D", variant: "ghost", onClick: onReplay });
|
|
6065
6104
|
actions.push({ key: "next", label: "\u5B8C\u6210\u5E76\u8FD4\u56DE", onClick: onNext });
|
|
6066
|
-
} else
|
|
6067
|
-
actions.push({
|
|
6105
|
+
} else {
|
|
6106
|
+
actions.push({
|
|
6107
|
+
key: "submit",
|
|
6108
|
+
label: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
|
|
6109
|
+
onClick: onSubmit,
|
|
6110
|
+
disabled: !allDone
|
|
6111
|
+
});
|
|
6068
6112
|
}
|
|
6069
6113
|
return actions;
|
|
6070
6114
|
}
|
|
6071
6115
|
|
|
6072
6116
|
// src/questions/video-task/feedback.tsx
|
|
6073
|
-
import { Fragment as
|
|
6117
|
+
import { Fragment as Fragment21, jsx as jsx71, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
6074
6118
|
function VideoFeedback({
|
|
6075
6119
|
data,
|
|
6076
6120
|
overall,
|
|
@@ -6080,21 +6124,21 @@ function VideoFeedback({
|
|
|
6080
6124
|
const stats = (_a = data.stats) != null ? _a : [
|
|
6081
6125
|
{
|
|
6082
6126
|
label: "\u89C2\u770B\u65F6\u957F",
|
|
6083
|
-
value: /* @__PURE__ */ jsxs54(
|
|
6127
|
+
value: /* @__PURE__ */ jsxs54(Fragment21, { children: [
|
|
6084
6128
|
(timeOnTask / 60).toFixed(1),
|
|
6085
6129
|
/* @__PURE__ */ jsx71("small", { children: "min" })
|
|
6086
6130
|
] })
|
|
6087
6131
|
},
|
|
6088
6132
|
{
|
|
6089
6133
|
label: "\u89C6\u9891\u6570\u91CF",
|
|
6090
|
-
value: /* @__PURE__ */ jsxs54(
|
|
6134
|
+
value: /* @__PURE__ */ jsxs54(Fragment21, { children: [
|
|
6091
6135
|
data.videos.length,
|
|
6092
6136
|
/* @__PURE__ */ jsx71("small", { children: "\u4E2A" })
|
|
6093
6137
|
] })
|
|
6094
6138
|
},
|
|
6095
6139
|
{
|
|
6096
6140
|
label: "\u5B8C\u6210\u5EA6",
|
|
6097
|
-
value: /* @__PURE__ */ jsxs54(
|
|
6141
|
+
value: /* @__PURE__ */ jsxs54(Fragment21, { children: [
|
|
6098
6142
|
overall,
|
|
6099
6143
|
/* @__PURE__ */ jsx71("small", { children: "%" })
|
|
6100
6144
|
] })
|
|
@@ -6156,6 +6200,7 @@ function VideoRing({ percent }) {
|
|
|
6156
6200
|
cx: "24",
|
|
6157
6201
|
cy: "24",
|
|
6158
6202
|
r: "20",
|
|
6203
|
+
pathLength: 100,
|
|
6159
6204
|
strokeDasharray: 100,
|
|
6160
6205
|
strokeDashoffset: 100 - percent
|
|
6161
6206
|
}
|
|
@@ -6169,7 +6214,7 @@ function VideoRing({ percent }) {
|
|
|
6169
6214
|
}
|
|
6170
6215
|
|
|
6171
6216
|
// src/questions/video-task/video-controls.tsx
|
|
6172
|
-
import { Fragment as
|
|
6217
|
+
import { Fragment as Fragment22, jsx as jsx74, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
6173
6218
|
function VideoControls({
|
|
6174
6219
|
data,
|
|
6175
6220
|
video,
|
|
@@ -6244,7 +6289,7 @@ function VideoControls({
|
|
|
6244
6289
|
] }),
|
|
6245
6290
|
/* @__PURE__ */ jsxs57("div", { className: "rqk-video-progress", children: [
|
|
6246
6291
|
/* @__PURE__ */ jsx74(VideoRing, { percent: percentFor(current) }),
|
|
6247
|
-
/* @__PURE__ */ jsx74("div", { className: "rqk-video-credit", children: Math.abs(position - ((_a = credits[current]) != null ? _a : 0)) > 0.75 ? /* @__PURE__ */ jsxs57(
|
|
6292
|
+
/* @__PURE__ */ jsx74("div", { className: "rqk-video-credit", children: Math.abs(position - ((_a = credits[current]) != null ? _a : 0)) > 0.75 ? /* @__PURE__ */ jsxs57(Fragment22, { children: [
|
|
6248
6293
|
"\u64AD\u653E ",
|
|
6249
6294
|
/* @__PURE__ */ jsx74("b", { children: formatTime(position) }),
|
|
6250
6295
|
" / ",
|
|
@@ -6252,7 +6297,7 @@ function VideoControls({
|
|
|
6252
6297
|
/* @__PURE__ */ jsx74("span", { className: "rqk-video-credit-sep", children: "\xB7" }),
|
|
6253
6298
|
"\u6709\u6548 ",
|
|
6254
6299
|
/* @__PURE__ */ jsx74("b", { children: formatTime((_b = credits[current]) != null ? _b : 0) })
|
|
6255
|
-
] }) : /* @__PURE__ */ jsxs57(
|
|
6300
|
+
] }) : /* @__PURE__ */ jsxs57(Fragment22, { children: [
|
|
6256
6301
|
"\u6709\u6548\u89C2\u770B ",
|
|
6257
6302
|
/* @__PURE__ */ jsx74("b", { children: formatTime((_c = credits[current]) != null ? _c : 0) }),
|
|
6258
6303
|
" / ",
|
|
@@ -6298,10 +6343,10 @@ function VideoStage({
|
|
|
6298
6343
|
}
|
|
6299
6344
|
|
|
6300
6345
|
// src/questions/video-task/use-video-task.ts
|
|
6301
|
-
import { useRef as useRef13, useState as
|
|
6346
|
+
import { useRef as useRef13, useState as useState25 } from "react";
|
|
6302
6347
|
|
|
6303
6348
|
// src/questions/video-task/use-video-clock.ts
|
|
6304
|
-
import { useEffect as
|
|
6349
|
+
import { useEffect as useEffect17 } from "react";
|
|
6305
6350
|
|
|
6306
6351
|
// src/questions/video-task/constants.ts
|
|
6307
6352
|
var TICK_MS2 = 100;
|
|
@@ -6321,13 +6366,13 @@ function useVideoClock({
|
|
|
6321
6366
|
setPosition,
|
|
6322
6367
|
setTimeOnTask
|
|
6323
6368
|
}) {
|
|
6324
|
-
|
|
6369
|
+
useEffect17(() => {
|
|
6325
6370
|
positionRef.current = 0;
|
|
6326
6371
|
setPosition(0);
|
|
6327
6372
|
setPlaying(false);
|
|
6328
6373
|
playingRef.current = false;
|
|
6329
6374
|
}, [current]);
|
|
6330
|
-
|
|
6375
|
+
useEffect17(() => {
|
|
6331
6376
|
if (video.src || !playing) return void 0;
|
|
6332
6377
|
const timer = window.setInterval(() => {
|
|
6333
6378
|
if (!playingRef.current) return;
|
|
@@ -6343,7 +6388,7 @@ function useVideoClock({
|
|
|
6343
6388
|
}, TICK_MS2);
|
|
6344
6389
|
return () => window.clearInterval(timer);
|
|
6345
6390
|
}, [playing, video.duration, video.src]);
|
|
6346
|
-
|
|
6391
|
+
useEffect17(() => {
|
|
6347
6392
|
const element = videoRef.current;
|
|
6348
6393
|
if (!element || !video.src) return void 0;
|
|
6349
6394
|
const handleTime = () => {
|
|
@@ -6371,13 +6416,13 @@ function useVideoClock({
|
|
|
6371
6416
|
// src/questions/video-task/use-video-task.ts
|
|
6372
6417
|
function useVideoTask({ data, onSubmit }) {
|
|
6373
6418
|
var _a;
|
|
6374
|
-
const [view, setView] =
|
|
6375
|
-
const [current, setCurrent] =
|
|
6376
|
-
const [position, setPosition] =
|
|
6377
|
-
const [credits, setCredits] =
|
|
6378
|
-
const [playing, setPlaying] =
|
|
6379
|
-
const [timeOnTask, setTimeOnTask] =
|
|
6380
|
-
const [fullscreen, setFullscreen] =
|
|
6419
|
+
const [view, setView] = useState25("task");
|
|
6420
|
+
const [current, setCurrent] = useState25(0);
|
|
6421
|
+
const [position, setPosition] = useState25(0);
|
|
6422
|
+
const [credits, setCredits] = useState25(() => data.videos.map(() => 0));
|
|
6423
|
+
const [playing, setPlaying] = useState25(false);
|
|
6424
|
+
const [timeOnTask, setTimeOnTask] = useState25(0);
|
|
6425
|
+
const [fullscreen, setFullscreen] = useState25(false);
|
|
6381
6426
|
const videoRef = useRef13(null);
|
|
6382
6427
|
const positionRef = useRef13(0);
|
|
6383
6428
|
const creditRef = useRef13(0);
|
|
@@ -6494,7 +6539,7 @@ function useVideoTask({ data, onSubmit }) {
|
|
|
6494
6539
|
}
|
|
6495
6540
|
|
|
6496
6541
|
// src/questions/video-task/index.tsx
|
|
6497
|
-
import { Fragment as
|
|
6542
|
+
import { Fragment as Fragment23, jsx as jsx76, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6498
6543
|
function VideoTask({
|
|
6499
6544
|
data,
|
|
6500
6545
|
mode = "answer",
|
|
@@ -6503,9 +6548,9 @@ function VideoTask({
|
|
|
6503
6548
|
title,
|
|
6504
6549
|
instruction,
|
|
6505
6550
|
onBack,
|
|
6551
|
+
onPrev,
|
|
6506
6552
|
onNext,
|
|
6507
6553
|
onSubmit,
|
|
6508
|
-
frame,
|
|
6509
6554
|
className
|
|
6510
6555
|
}) {
|
|
6511
6556
|
const model = useVideoTask({ data, onSubmit });
|
|
@@ -6523,18 +6568,16 @@ function VideoTask({
|
|
|
6523
6568
|
title: title != null ? title : model.view === "feedback" ? "\u89C6\u9891\u7EDF\u8BA1" : "\u89C6\u9891\u4EFB\u52A1",
|
|
6524
6569
|
index,
|
|
6525
6570
|
total,
|
|
6526
|
-
|
|
6527
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs59(Fragment15, { children: [
|
|
6571
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs59(Fragment23, { children: [
|
|
6528
6572
|
"\u89C2\u770B\u89C6\u9891\uFF0C\u6709\u6548\u89C2\u770B ",
|
|
6529
6573
|
/* @__PURE__ */ jsx76("b", { children: "\u226590%" }),
|
|
6530
6574
|
" \u89C6\u4E3A\u5B8C\u6210"
|
|
6531
6575
|
] }),
|
|
6532
6576
|
onBack,
|
|
6533
|
-
frame,
|
|
6534
6577
|
className: classNames("rqk-quest", "rqk-video", className),
|
|
6535
6578
|
dataQuest: "video-task",
|
|
6536
|
-
footer: /* @__PURE__ */ jsx76(ActionBar, { actions }),
|
|
6537
|
-
children: model.view === "feedback" ? /* @__PURE__ */ jsx76(VideoFeedback, { data, overall: model.overall, timeOnTask: model.timeOnTask }) : /* @__PURE__ */ jsxs59(
|
|
6579
|
+
footer: /* @__PURE__ */ jsx76(ActionBar, { actions, index, onPrev }),
|
|
6580
|
+
children: model.view === "feedback" ? /* @__PURE__ */ jsx76(VideoFeedback, { data, overall: model.overall, timeOnTask: model.timeOnTask }) : /* @__PURE__ */ jsxs59(Fragment23, { children: [
|
|
6538
6581
|
/* @__PURE__ */ jsx76(
|
|
6539
6582
|
VideoStage,
|
|
6540
6583
|
{
|
|
@@ -6609,7 +6652,7 @@ function BlankInput2({
|
|
|
6609
6652
|
}
|
|
6610
6653
|
|
|
6611
6654
|
// src/index.tsx
|
|
6612
|
-
var version = "1.0.
|
|
6655
|
+
var version = "1.0.3";
|
|
6613
6656
|
var questkit = {
|
|
6614
6657
|
version,
|
|
6615
6658
|
QuestShell,
|