@jswork/react-questkit 1.0.3 → 1.0.5
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 +1207 -919
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +67 -12
- package/dist/index.d.ts +67 -12
- package/dist/index.mjs +1200 -913
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -355,6 +355,7 @@ function QuestShell({
|
|
|
355
355
|
instructionVariant = "card",
|
|
356
356
|
footer,
|
|
357
357
|
feedback,
|
|
358
|
+
bare = false,
|
|
358
359
|
dataQuest,
|
|
359
360
|
className,
|
|
360
361
|
children
|
|
@@ -364,28 +365,269 @@ function QuestShell({
|
|
|
364
365
|
"div",
|
|
365
366
|
{
|
|
366
367
|
className: classNames(
|
|
367
|
-
"rqk-shell relative isolate flex
|
|
368
|
+
"rqk-shell relative isolate flex w-full min-h-0 flex-col",
|
|
369
|
+
bare && "rqk-bare h-auto overflow-visible",
|
|
370
|
+
!bare && "h-full overflow-hidden",
|
|
371
|
+
"bg-[var(--rqk-screen-bg)]",
|
|
368
372
|
className
|
|
369
373
|
),
|
|
370
374
|
"data-component": "react-questkit",
|
|
371
375
|
"data-mode": mode,
|
|
372
376
|
"data-quest": dataQuest,
|
|
373
377
|
children: [
|
|
374
|
-
/* @__PURE__ */ jsxs3(
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
378
|
+
/* @__PURE__ */ jsxs3(
|
|
379
|
+
"div",
|
|
380
|
+
{
|
|
381
|
+
className: classNames(
|
|
382
|
+
"rqk-body relative flex min-h-0 flex-col",
|
|
383
|
+
!bare && "flex-1"
|
|
384
|
+
),
|
|
385
|
+
children: [
|
|
386
|
+
/* @__PURE__ */ jsxs3("div", { className: "rqk-page", children: [
|
|
387
|
+
!bare ? /* @__PURE__ */ jsx4(Progress, { value: index, total }) : null,
|
|
388
|
+
!bare ? /* @__PURE__ */ jsx4(Instruction, { variant: instructionVariant, children: instruction }) : null,
|
|
389
|
+
children
|
|
390
|
+
] }),
|
|
391
|
+
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,
|
|
392
|
+
/* @__PURE__ */ jsx4(Toast, { align: toast == null ? void 0 : toast.align, children: toast == null ? void 0 : toast.message })
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
footer && !bare ? /* @__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
|
|
384
397
|
]
|
|
385
398
|
}
|
|
386
399
|
) });
|
|
387
400
|
}
|
|
388
401
|
|
|
402
|
+
// src/art/illustrations.tsx
|
|
403
|
+
import { useId } from "react";
|
|
404
|
+
|
|
405
|
+
// src/assets/svg/art-apple.svg
|
|
406
|
+
var art_apple_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="#FF8A8A"></stop><stop offset="1" stop-color="#E5484D"></stop></linearGradient></defs><circle cx="57" cy="66" r="32" fill="url(#rqk-grad)"></circle><circle cx="72" cy="70" r="25" fill="url(#rqk-grad)" opacity="0.92"></circle><ellipse cx="47" cy="52" rx="7" ry="10" fill="#FFFFFF" opacity="0.4" transform="rotate(-24 47 52)"></ellipse><path d="M64 36c0-6 3-10 8-12" stroke="#8B5E34" stroke-width="3" stroke-linecap="round" fill="none"></path><path d="M68 34c2-8 12-11 20-7-2 8-12 11-20 7z" fill="#3ED598"></path></svg>\n';
|
|
407
|
+
|
|
408
|
+
// src/assets/svg/art-balloon.svg
|
|
409
|
+
var art_balloon_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.2" y1="0" x2="0.8" y2="1"><stop offset="0" stop-color="#7FB0FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><ellipse cx="60" cy="50" rx="28" ry="32" fill="url(#rqk-grad)"></ellipse><ellipse cx="50" cy="38" rx="7" ry="9" fill="#FFFFFF" opacity="0.45"></ellipse><path d="M60 82l3 6h-6z" fill="#0147CC"></path><path d="M60 88c8 6-8 10 0 16s-8 8 0 12" stroke="#0147CC" stroke-width="2.2" fill="none" stroke-linecap="round"></path><circle cx="94" cy="30" r="4" fill="#FFD166"></circle><circle cx="22" cy="86" r="3" fill="#7C5CFF" opacity="0.6"></circle></svg>\n';
|
|
410
|
+
|
|
411
|
+
// src/assets/svg/art-books.svg
|
|
412
|
+
var art_books_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><rect x="20" y="80" width="80" height="16" rx="5" fill="#0158FD"></rect><rect x="26" y="62" width="68" height="16" rx="5" fill="#3ED598"></rect><rect x="22" y="44" width="72" height="16" rx="5" fill="#FFB020"></rect><rect x="32" y="26" width="58" height="16" rx="5" fill="#7C5CFF"></rect><path d="M34 34h54M28 52h60M32 70h56M26 88h68" stroke="#FFFFFF" stroke-width="2.4" opacity="0.35" stroke-linecap="round"></path><circle cx="88" cy="22" r="5" fill="#9CBFFF" opacity="0.7"></circle></svg>\n';
|
|
413
|
+
|
|
414
|
+
// src/assets/svg/art-cat.svg
|
|
415
|
+
var art_cat_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="0" y2="1"><stop offset="0" stop-color="#FFC48A"></stop><stop offset="1" stop-color="#F09A4F"></stop></linearGradient></defs><path d="M36 42l-6-20 18 8zM84 42l6-20-18 8z" fill="url(#rqk-grad)"></path><circle cx="60" cy="66" r="34" fill="url(#rqk-grad)"></circle><ellipse cx="60" cy="82" rx="18" ry="13" fill="#FFF3E4"></ellipse><circle cx="48" cy="62" r="3.4" fill="#5B3A22"></circle><circle cx="72" cy="62" r="3.4" fill="#5B3A22"></circle><path d="M55 74h10l-5 5z" fill="#F08A8A"></path><path d="M56 83c1.6 1.8 6.4 1.8 8 0" stroke="#5B3A22" stroke-width="1.8" fill="none"></path><path d="M22 68h14M24 76h12M98 68h-14M96 76h-12" stroke="#E7C39F" stroke-width="2" stroke-linecap="round"></path></svg>\n';
|
|
416
|
+
|
|
417
|
+
// src/assets/svg/art-coffee.svg
|
|
418
|
+
var art_coffee_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="0" y2="1"><stop offset="0" stop-color="#FFFFFF"></stop><stop offset="1" stop-color="#E7EEFA"></stop></linearGradient></defs><ellipse cx="58" cy="90" rx="34" ry="6" fill="#DCE6F7"></ellipse><path d="M30 50h50l-5 34c-.6 4-4 7-8 7H43c-4 0-7.4-3-8-7z" fill="url(#rqk-grad)"></path><path d="M80 58h6a9 9 0 010 18h-3" stroke="#C3D2E8" stroke-width="4" fill="none"></path><rect x="34" y="58" width="42" height="14" rx="4" fill="#D6E2F5"></rect><path d="M48 42c-4-7 4-9 0-16M62 42c-4-7 4-9 0-16" stroke="#9CBFFF" stroke-width="3" fill="none" stroke-linecap="round" opacity="0.8"></path><circle cx="88" cy="34" r="4" fill="#FFB020" opacity="0.7"></circle></svg>\n';
|
|
419
|
+
|
|
420
|
+
// src/assets/svg/art-headphones.svg
|
|
421
|
+
var art_headphones_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-b" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3D7BFF"></stop><stop offset="1" stop-color="#013AA6"></stop></linearGradient></defs><ellipse cx="120" cy="162" rx="48" ry="8" fill="#0B1220" opacity="0.07"></ellipse><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="url(#rqk-grad-a)" stroke-width="15" stroke-linecap="round"></path><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="#fff" stroke-width="4" stroke-linecap="round" opacity="0.35"></path><rect x="46" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="160" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="54" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><rect x="168" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><g stroke="#0158FD" stroke-width="3" stroke-linecap="round" opacity="0.5"><path d="M198 74c8 6 12 14 12 22M206 62c12 9 18 21 18 34"></path></g></svg>\n';
|
|
422
|
+
|
|
423
|
+
// src/assets/svg/art-kid.svg
|
|
424
|
+
var art_kid_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="0" y2="1"><stop offset="0" stop-color="#4F8BFF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><circle cx="60" cy="58" r="46" fill="#EAF1FF"></circle><path d="M22 104c0-15 17-24 38-24s38 9 38 24z" fill="url(#rqk-grad)"></path><circle cx="60" cy="52" r="25" fill="#FFD3B6"></circle><path d="M36 47c0-13 10-21 24-21s24 8 24 21c-6-4-13-6-24-6s-18 2-24 6z" fill="#1F2A44"></path><circle cx="51" cy="53" r="2.6" fill="#1F2A44"></circle><circle cx="69" cy="53" r="2.6" fill="#1F2A44"></circle><path d="M54 62c2.6 3 9.4 3 12 0" stroke="#C96A5A" stroke-width="2.4" stroke-linecap="round" fill="none"></path><circle cx="43" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle><circle cx="77" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle></svg>\n';
|
|
425
|
+
|
|
426
|
+
// src/assets/svg/art-screen.svg
|
|
427
|
+
var art_screen_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-play" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-screen" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#EAF2FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><ellipse cx="120" cy="166" rx="52" ry="8" fill="#0B1220" opacity="0.07"></ellipse><rect x="42" y="32" width="156" height="104" rx="16" fill="url(#rqk-grad-screen)" stroke="#B9D0FF" stroke-width="2"></rect><rect x="52" y="42" width="136" height="84" rx="10" fill="#0B1220" opacity="0.06"></rect><circle cx="120" cy="84" r="26" fill="url(#rqk-grad-play)"></circle><path d="M113 73l20 11-20 11V73z" fill="#fff"></path><rect x="106" y="136" width="28" height="16" fill="#C6DBFF"></rect><rect x="84" y="150" width="72" height="8" rx="4" fill="#B9D0FF"></rect><g fill="#0158FD" opacity="0.5"><circle cx="62" cy="52" r="2.6"></circle><circle cx="70" cy="52" r="2.6"></circle><circle cx="78" cy="52" r="2.6"></circle></g></svg>\n';
|
|
428
|
+
|
|
429
|
+
// src/assets/svg/art-speech.svg
|
|
430
|
+
var art_speech_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="#EAF1FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><path d="M24 34h72a8 8 0 018 8v34a8 8 0 01-8 8H60l-16 14v-14H24a8 8 0 01-8-8V42a8 8 0 018-8z" fill="url(#rqk-grad)"></path><rect x="38" y="52" width="7" height="18" rx="3.5" fill="#0158FD"></rect><rect x="51" y="44" width="7" height="34" rx="3.5" fill="#4F8BFF"></rect><rect x="64" y="48" width="7" height="26" rx="3.5" fill="#4F8BFF"></rect><rect x="77" y="58" width="7" height="10" rx="3.5" fill="#9CBFFF"></rect></svg>\n';
|
|
431
|
+
|
|
432
|
+
// src/assets/svg/art-trophy.svg
|
|
433
|
+
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';
|
|
434
|
+
|
|
435
|
+
// src/art/illustrations.tsx
|
|
436
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
437
|
+
var ART_SOURCES = {
|
|
438
|
+
kid: art_kid_default,
|
|
439
|
+
balloon: art_balloon_default,
|
|
440
|
+
apple: art_apple_default,
|
|
441
|
+
coffee: art_coffee_default,
|
|
442
|
+
cat: art_cat_default,
|
|
443
|
+
books: art_books_default,
|
|
444
|
+
headphones: art_headphones_default,
|
|
445
|
+
screen: art_screen_default,
|
|
446
|
+
trophy: art_trophy_default,
|
|
447
|
+
speech: art_speech_default
|
|
448
|
+
};
|
|
449
|
+
function Art({ name, className, size }) {
|
|
450
|
+
var _a;
|
|
451
|
+
const unique = useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
452
|
+
const source = ((_a = ART_SOURCES[name]) != null ? _a : art_speech_default).replace(
|
|
453
|
+
/rqk-grad/g,
|
|
454
|
+
`rqk-grad-${unique}`
|
|
455
|
+
);
|
|
456
|
+
return /* @__PURE__ */ jsx5(
|
|
457
|
+
"span",
|
|
458
|
+
{
|
|
459
|
+
className: ["rqk-art", className].filter(Boolean).join(" "),
|
|
460
|
+
style: size ? { width: size, height: size } : void 0,
|
|
461
|
+
"aria-hidden": true,
|
|
462
|
+
dangerouslySetInnerHTML: { __html: source }
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// src/core/quest-config.tsx
|
|
468
|
+
import { createContext as createContext2, useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
469
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
470
|
+
var defaultQuestLabels = {
|
|
471
|
+
submit: "\u63D0\u4EA4\u7B54\u6848",
|
|
472
|
+
submitCount: "\u63D0\u4EA4\u7B54\u6848",
|
|
473
|
+
retry: "\u91CD\u8BD5\u4E00\u6B21",
|
|
474
|
+
next: "\u5207\u9898",
|
|
475
|
+
prev: "\u4E0A\u4E00\u9898",
|
|
476
|
+
back: "\u8FD4\u56DE",
|
|
477
|
+
answer: "\u6B63\u786E\u7B54\u6848",
|
|
478
|
+
analysis: "\u89E3\u6790",
|
|
479
|
+
correctAll: "\u5168\u90E8\u7B54\u5BF9",
|
|
480
|
+
wrongAnswer: "\u7B54\u6848\u8FD8\u4E0D\u6B63\u786E",
|
|
481
|
+
tapToRead: "\u70B9\u51FB\u6717\u8BFB",
|
|
482
|
+
readAloud: "\u8303\u8BFB",
|
|
483
|
+
recording: "\u5F55\u97F3\u4E2D",
|
|
484
|
+
scoring: "\u8BC4\u5206\u4E2D",
|
|
485
|
+
releaseToSend: "\u677E\u624B\u5373\u63D0\u4EA4",
|
|
486
|
+
holdToRecord: "\u70B9\u51FB\u5F00\u59CB\u5F55\u97F3",
|
|
487
|
+
tapToFollow: "\u70B9\u51FB\u8DDF\u8BFB",
|
|
488
|
+
recordingHint: "\u6B63\u5728\u5F55\u97F3 \xB7 \u70B9\u51FB\u7ED3\u675F",
|
|
489
|
+
rescore: "\u91CD\u65B0\u5F55\u97F3",
|
|
490
|
+
submitted: "\u5DF2\u63D0\u4EA4 \xB7 \u53EF\u91CD\u5F55",
|
|
491
|
+
noiseHint: "\u97F3\u8D28\u4E0D\u5408\u683C\uFF1A\u4E0D\u51FA\u5206\uFF0C\u8BF7\u6362\u5B89\u9759\u73AF\u5883\u91CD\u8BD5",
|
|
492
|
+
againHint: "\u672A\u83B7\u53D6\u5206\u6570\uFF0C\u8BF7\u518D\u8BD5\u4E00\u6B21",
|
|
493
|
+
attemptsLeft: "\u8FD8\u6709 {n} \u6B21\u5F55\u97F3\u673A\u4F1A",
|
|
494
|
+
attemptsUsedUp: "\u673A\u4F1A\u5DF2\u7528\u5B8C",
|
|
495
|
+
play: "\u64AD\u653E",
|
|
496
|
+
pause: "\u6682\u505C",
|
|
497
|
+
replay: "\u518D\u542C\u4E00\u904D",
|
|
498
|
+
loop: "\u5FAA\u73AF",
|
|
499
|
+
speed: "\u500D\u901F",
|
|
500
|
+
finish: "\u5B8C\u6210\u5E76\u8FD4\u56DE",
|
|
501
|
+
submitAndStats: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
|
|
502
|
+
effectivePlay: "\u6709\u6548\u64AD\u653E",
|
|
503
|
+
totalTime: "\u603B\u65F6\u957F",
|
|
504
|
+
reading: "\u9605\u8BFB",
|
|
505
|
+
expand: "\u5C55\u5F00\u5168\u6587",
|
|
506
|
+
collapse: "\u6536\u8D77",
|
|
507
|
+
notAnswered: "\u672A\u4F5C\u7B54",
|
|
508
|
+
fullscreen: "\u5168\u5C4F"
|
|
509
|
+
};
|
|
510
|
+
var QuestConfigContext = createContext2({});
|
|
511
|
+
function QuestConfigProvider({
|
|
512
|
+
config,
|
|
513
|
+
children
|
|
514
|
+
}) {
|
|
515
|
+
const parent = useContext2(QuestConfigContext);
|
|
516
|
+
const value = useMemo2(
|
|
517
|
+
() => {
|
|
518
|
+
var _a, _b;
|
|
519
|
+
return {
|
|
520
|
+
sound: (_a = config == null ? void 0 : config.sound) != null ? _a : parent.sound,
|
|
521
|
+
speakText: (_b = config == null ? void 0 : config.speakText) != null ? _b : parent.speakText,
|
|
522
|
+
labels: __spreadValues(__spreadValues({}, parent.labels), config == null ? void 0 : config.labels)
|
|
523
|
+
};
|
|
524
|
+
},
|
|
525
|
+
[config, parent]
|
|
526
|
+
);
|
|
527
|
+
return /* @__PURE__ */ jsx6(QuestConfigContext.Provider, { value, children });
|
|
528
|
+
}
|
|
529
|
+
function useQuestConfig() {
|
|
530
|
+
return useContext2(QuestConfigContext);
|
|
531
|
+
}
|
|
532
|
+
function useQuestLabels(override) {
|
|
533
|
+
const config = useQuestConfig();
|
|
534
|
+
return useMemo2(
|
|
535
|
+
() => __spreadValues(__spreadValues(__spreadValues({}, defaultQuestLabels), config.labels), override),
|
|
536
|
+
[config.labels, override]
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// src/primitives/action-bar.tsx
|
|
541
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
542
|
+
function ActionBar({ actions, index = 1, total, onPrev, className }) {
|
|
543
|
+
const labels = useQuestLabels();
|
|
544
|
+
const autoPrev = Boolean(onPrev) && index > 1;
|
|
545
|
+
const isLast = total !== void 0 && total > 0 && index >= total;
|
|
546
|
+
const resolved = isLast ? actions.map(
|
|
547
|
+
(action) => action.key === "next" ? __spreadProps(__spreadValues({}, action), { label: labels.finish }) : action
|
|
548
|
+
) : actions;
|
|
549
|
+
const body = autoPrev ? resolved.filter((action) => action.key !== "prev") : resolved;
|
|
550
|
+
const visibleActions = autoPrev ? [
|
|
551
|
+
{
|
|
552
|
+
key: "prev",
|
|
553
|
+
label: labels.prev,
|
|
554
|
+
variant: "ghost",
|
|
555
|
+
onClick: onPrev,
|
|
556
|
+
ariaLabel: labels.prev
|
|
557
|
+
},
|
|
558
|
+
...body
|
|
559
|
+
] : body;
|
|
560
|
+
if (!visibleActions.length) return null;
|
|
561
|
+
return /* @__PURE__ */ jsx7("div", { className: classNames("rqk-action-bar flex gap-2.5", className), children: visibleActions.map((action) => /* @__PURE__ */ jsxs4(
|
|
562
|
+
"button",
|
|
563
|
+
{
|
|
564
|
+
type: "button",
|
|
565
|
+
className: classNames(
|
|
566
|
+
"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",
|
|
567
|
+
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"
|
|
568
|
+
),
|
|
569
|
+
onClick: action.onClick,
|
|
570
|
+
disabled: action.disabled,
|
|
571
|
+
"aria-label": action.ariaLabel,
|
|
572
|
+
children: [
|
|
573
|
+
action.icon ? /* @__PURE__ */ jsx7("span", { className: "rqk-action-icon inline-flex items-center justify-center", children: action.icon }) : null,
|
|
574
|
+
/* @__PURE__ */ jsx7("span", { className: "rqk-action-label", children: action.label })
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
action.key
|
|
578
|
+
)) });
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// src/primitives/quest-complete.tsx
|
|
582
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
583
|
+
function QuestComplete({
|
|
584
|
+
total = 1,
|
|
585
|
+
index,
|
|
586
|
+
title,
|
|
587
|
+
subtitle,
|
|
588
|
+
art = "trophy",
|
|
589
|
+
stats,
|
|
590
|
+
onFinish,
|
|
591
|
+
finishLabel,
|
|
592
|
+
className
|
|
593
|
+
}) {
|
|
594
|
+
const labels = useQuestLabels();
|
|
595
|
+
const current = index != null ? index : total;
|
|
596
|
+
const statItems = stats != null ? stats : [
|
|
597
|
+
{ value: total, unit: "\u9898", label: "\u5B8C\u6210\u9898\u76EE" },
|
|
598
|
+
{ value: 100, unit: "%", label: "\u5B8C\u6210\u5EA6" }
|
|
599
|
+
];
|
|
600
|
+
const actions = [];
|
|
601
|
+
if (onFinish) {
|
|
602
|
+
actions.push({
|
|
603
|
+
key: "finish",
|
|
604
|
+
label: finishLabel != null ? finishLabel : labels.finish,
|
|
605
|
+
onClick: onFinish
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
return /* @__PURE__ */ jsx8(
|
|
609
|
+
QuestShell,
|
|
610
|
+
{
|
|
611
|
+
index: current,
|
|
612
|
+
total,
|
|
613
|
+
className: classNames("rqk-complete", className),
|
|
614
|
+
footer: actions.length ? /* @__PURE__ */ jsx8(ActionBar, { actions }) : void 0,
|
|
615
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "rqk-complete-body", children: [
|
|
616
|
+
/* @__PURE__ */ jsx8("div", { className: "rqk-complete-art", "aria-hidden": true, children: /* @__PURE__ */ jsx8(Art, { name: art }) }),
|
|
617
|
+
/* @__PURE__ */ jsx8("div", { className: "rqk-complete-title", role: "heading", "aria-level": 1, children: title != null ? title : "\u9898\u5305\u5B8C\u6210\u5566" }),
|
|
618
|
+
/* @__PURE__ */ jsx8("div", { className: "rqk-complete-subtitle", children: subtitle != null ? subtitle : `\u5171 ${total} \u9053\u9898\u5DF2\u5168\u90E8\u5B8C\u6210` }),
|
|
619
|
+
statItems.length ? /* @__PURE__ */ jsx8("div", { className: "rqk-complete-stats", "aria-label": "\u9898\u5305\u7EDF\u8BA1", children: statItems.map((stat, statIndex) => /* @__PURE__ */ jsxs5("div", { className: "rqk-complete-stat", children: [
|
|
620
|
+
/* @__PURE__ */ jsxs5("div", { className: "rqk-complete-stat-value", children: [
|
|
621
|
+
stat.value,
|
|
622
|
+
stat.unit ? /* @__PURE__ */ jsx8("small", { children: stat.unit }) : null
|
|
623
|
+
] }),
|
|
624
|
+
/* @__PURE__ */ jsx8("div", { className: "rqk-complete-stat-label", children: stat.label })
|
|
625
|
+
] }, statIndex)) }) : null
|
|
626
|
+
] })
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
}
|
|
630
|
+
|
|
389
631
|
// src/core/icons.tsx
|
|
390
632
|
import classnames2 from "classnames";
|
|
391
633
|
|
|
@@ -420,7 +662,7 @@ var icon_play_default = '<svg width="22" height="22" viewBox="0 0 24 24" fill="n
|
|
|
420
662
|
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
663
|
|
|
422
664
|
// src/core/icons.tsx
|
|
423
|
-
import { jsx as
|
|
665
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
424
666
|
function SvgIcon(_a) {
|
|
425
667
|
var _b = _a, {
|
|
426
668
|
source,
|
|
@@ -434,7 +676,7 @@ function SvgIcon(_a) {
|
|
|
434
676
|
"style"
|
|
435
677
|
]);
|
|
436
678
|
const html = size ? source.replace("<svg", '<svg style="width:100%;height:100%"') : source;
|
|
437
|
-
return /* @__PURE__ */
|
|
679
|
+
return /* @__PURE__ */ jsx9(
|
|
438
680
|
"span",
|
|
439
681
|
__spreadProps(__spreadValues({
|
|
440
682
|
className: classnames2("rqk-icon", className),
|
|
@@ -446,38 +688,38 @@ function SvgIcon(_a) {
|
|
|
446
688
|
);
|
|
447
689
|
}
|
|
448
690
|
function CheckIcon(props) {
|
|
449
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_check_default }, props));
|
|
450
692
|
}
|
|
451
693
|
function CrossIcon(props) {
|
|
452
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_cross_default }, props));
|
|
453
695
|
}
|
|
454
696
|
function AlertIcon(props) {
|
|
455
|
-
return /* @__PURE__ */
|
|
697
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_alert_default }, props));
|
|
456
698
|
}
|
|
457
699
|
function PlayIcon(props) {
|
|
458
|
-
return /* @__PURE__ */
|
|
700
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_play_default }, props));
|
|
459
701
|
}
|
|
460
702
|
function PauseIcon(props) {
|
|
461
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_pause_default }, props));
|
|
462
704
|
}
|
|
463
705
|
function MicIcon(props) {
|
|
464
|
-
return /* @__PURE__ */
|
|
706
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_mic_default }, props));
|
|
465
707
|
}
|
|
466
708
|
function SpeakerIcon(props) {
|
|
467
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_speaker_default }, props));
|
|
468
710
|
}
|
|
469
711
|
function LoopIcon(props) {
|
|
470
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_loop_default }, props));
|
|
471
713
|
}
|
|
472
714
|
function FullscreenIcon(props) {
|
|
473
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_fullscreen_default }, props));
|
|
474
716
|
}
|
|
475
717
|
function KeyboardIcon(props) {
|
|
476
|
-
return /* @__PURE__ */
|
|
718
|
+
return /* @__PURE__ */ jsx9(SvgIcon, __spreadValues({ source: icon_keyboard_default }, props));
|
|
477
719
|
}
|
|
478
720
|
|
|
479
721
|
// src/primitives/option-item.tsx
|
|
480
|
-
import { jsx as
|
|
722
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
481
723
|
function OptionItem({
|
|
482
724
|
label,
|
|
483
725
|
children,
|
|
@@ -491,7 +733,7 @@ function OptionItem({
|
|
|
491
733
|
className
|
|
492
734
|
}) {
|
|
493
735
|
const marked = state === "correct" || state === "wrong";
|
|
494
|
-
return /* @__PURE__ */
|
|
736
|
+
return /* @__PURE__ */ jsxs6(
|
|
495
737
|
"button",
|
|
496
738
|
{
|
|
497
739
|
type: "button",
|
|
@@ -505,21 +747,21 @@ function OptionItem({
|
|
|
505
747
|
disabled: disabled || state === "disabled",
|
|
506
748
|
"aria-pressed": state === "selected",
|
|
507
749
|
children: [
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
media ? /* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
-
/* @__PURE__ */
|
|
512
|
-
sub ? /* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ jsx10("span", { className: "rqk-option-marker", children: label }),
|
|
751
|
+
media ? /* @__PURE__ */ jsx10("span", { className: "rqk-option-media", children: media }) : null,
|
|
752
|
+
/* @__PURE__ */ jsxs6("span", { className: "rqk-option-content", children: [
|
|
753
|
+
/* @__PURE__ */ jsx10("span", { className: "rqk-option-text", children }),
|
|
754
|
+
sub ? /* @__PURE__ */ jsx10("span", { className: "rqk-option-sub", children: sub }) : null
|
|
513
755
|
] }),
|
|
514
|
-
audioIndicator ? /* @__PURE__ */
|
|
515
|
-
marked ? /* @__PURE__ */
|
|
756
|
+
audioIndicator ? /* @__PURE__ */ jsx10("span", { className: "rqk-option-audio", "aria-hidden": true, children: /* @__PURE__ */ jsx10(SpeakerIcon, { size: 16 }) }) : null,
|
|
757
|
+
marked ? /* @__PURE__ */ jsx10("span", { className: "rqk-option-status", "aria-hidden": true, children: state === "correct" ? /* @__PURE__ */ jsx10(CheckIcon, { size: 18 }) : /* @__PURE__ */ jsx10(CrossIcon, { size: 18 }) }) : null
|
|
516
758
|
]
|
|
517
759
|
}
|
|
518
760
|
);
|
|
519
761
|
}
|
|
520
762
|
|
|
521
763
|
// src/primitives/star-rating.tsx
|
|
522
|
-
import { jsx as
|
|
764
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
523
765
|
function StarRating({
|
|
524
766
|
value,
|
|
525
767
|
size = 18,
|
|
@@ -528,13 +770,13 @@ function StarRating({
|
|
|
528
770
|
label
|
|
529
771
|
}) {
|
|
530
772
|
const count = Math.max(0, Math.min(3, value));
|
|
531
|
-
return /* @__PURE__ */
|
|
773
|
+
return /* @__PURE__ */ jsx11(
|
|
532
774
|
"span",
|
|
533
775
|
{
|
|
534
776
|
className: classNames("rqk-stars", className),
|
|
535
777
|
role: "img",
|
|
536
778
|
"aria-label": label != null ? label : `${count} / 3`,
|
|
537
|
-
children: [0, 1, 2].map((index) => /* @__PURE__ */
|
|
779
|
+
children: [0, 1, 2].map((index) => /* @__PURE__ */ jsx11(
|
|
538
780
|
"span",
|
|
539
781
|
{
|
|
540
782
|
className: classNames(
|
|
@@ -543,7 +785,7 @@ function StarRating({
|
|
|
543
785
|
animate && index < count && "rqk-star-animate"
|
|
544
786
|
),
|
|
545
787
|
style: { animationDelay: `${index * 0.08}s`, fontSize: `${size}px` },
|
|
546
|
-
children: /* @__PURE__ */
|
|
788
|
+
children: /* @__PURE__ */ jsx11("span", { className: "rqk-star-glyph", "aria-hidden": "true", children: "\u2605" })
|
|
547
789
|
},
|
|
548
790
|
index
|
|
549
791
|
))
|
|
@@ -552,11 +794,11 @@ function StarRating({
|
|
|
552
794
|
}
|
|
553
795
|
|
|
554
796
|
// src/primitives/feedback-sheet.tsx
|
|
555
|
-
import { jsx as
|
|
797
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
556
798
|
var TONE_ICONS = {
|
|
557
|
-
ok: /* @__PURE__ */
|
|
558
|
-
bad: /* @__PURE__ */
|
|
559
|
-
warn: /* @__PURE__ */
|
|
799
|
+
ok: /* @__PURE__ */ jsx12(CheckIcon, { size: 18 }),
|
|
800
|
+
bad: /* @__PURE__ */ jsx12(CrossIcon, { size: 16 }),
|
|
801
|
+
warn: /* @__PURE__ */ jsx12(AlertIcon, { size: 18 })
|
|
560
802
|
};
|
|
561
803
|
function FeedbackSheet({
|
|
562
804
|
tone = "ok",
|
|
@@ -569,28 +811,28 @@ function FeedbackSheet({
|
|
|
569
811
|
analysisLabel = "\u89E3\u6790",
|
|
570
812
|
className
|
|
571
813
|
}) {
|
|
572
|
-
return /* @__PURE__ */
|
|
814
|
+
return /* @__PURE__ */ jsxs7(
|
|
573
815
|
"div",
|
|
574
816
|
{
|
|
575
817
|
className: classNames("rqk-feedback", `rqk-feedback-${tone}`, className),
|
|
576
818
|
role: "status",
|
|
577
819
|
"aria-live": "polite",
|
|
578
820
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
detail ? /* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ jsxs7("div", { className: "rqk-feedback-head", children: [
|
|
822
|
+
/* @__PURE__ */ jsx12("span", { className: "rqk-feedback-icon", "aria-hidden": true, children: TONE_ICONS[tone] }),
|
|
823
|
+
/* @__PURE__ */ jsxs7("div", { className: "rqk-feedback-copy", children: [
|
|
824
|
+
/* @__PURE__ */ jsx12("div", { className: "rqk-feedback-title", children: title }),
|
|
825
|
+
detail ? /* @__PURE__ */ jsx12("div", { className: "rqk-feedback-detail", children: detail }) : null
|
|
584
826
|
] }),
|
|
585
|
-
typeof stars === "number" ? /* @__PURE__ */
|
|
827
|
+
typeof stars === "number" ? /* @__PURE__ */ jsx12(StarRating, { value: stars, size: 16, animate: true }) : null
|
|
586
828
|
] }),
|
|
587
|
-
answer ? /* @__PURE__ */
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
/* @__PURE__ */
|
|
829
|
+
answer ? /* @__PURE__ */ jsxs7("div", { className: "rqk-feedback-answer", children: [
|
|
830
|
+
/* @__PURE__ */ jsx12("span", { className: "rqk-feedback-answer-label", children: answerLabel }),
|
|
831
|
+
/* @__PURE__ */ jsx12("span", { className: "rqk-feedback-answer-value", children: answer })
|
|
590
832
|
] }) : null,
|
|
591
|
-
analysis ? /* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
833
|
+
analysis ? /* @__PURE__ */ jsxs7("div", { className: "rqk-feedback-analysis", children: [
|
|
834
|
+
/* @__PURE__ */ jsx12("span", { className: "rqk-feedback-analysis-label", children: analysisLabel }),
|
|
835
|
+
/* @__PURE__ */ jsx12("div", { children: analysis })
|
|
594
836
|
] }) : null
|
|
595
837
|
]
|
|
596
838
|
}
|
|
@@ -599,7 +841,7 @@ function FeedbackSheet({
|
|
|
599
841
|
|
|
600
842
|
// src/primitives/segmented-control.tsx
|
|
601
843
|
import { useLayoutEffect, useRef as useRef3, useState as useState3 } from "react";
|
|
602
|
-
import { jsx as
|
|
844
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
603
845
|
function SegmentedControl({
|
|
604
846
|
options,
|
|
605
847
|
value,
|
|
@@ -626,13 +868,11 @@ function SegmentedControl({
|
|
|
626
868
|
return current.x === next.x && current.width === next.width && current.ready ? current : next;
|
|
627
869
|
});
|
|
628
870
|
};
|
|
629
|
-
let timer;
|
|
630
871
|
if (!mountedRef.current) {
|
|
631
872
|
mountedRef.current = true;
|
|
632
873
|
sync();
|
|
633
|
-
} else {
|
|
634
|
-
timer = setTimeout(sync, 0);
|
|
635
874
|
}
|
|
875
|
+
const timer = setTimeout(sync, 0);
|
|
636
876
|
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
637
877
|
observer == null ? void 0 : observer.observe(root);
|
|
638
878
|
if (active) observer == null ? void 0 : observer.observe(active);
|
|
@@ -645,9 +885,10 @@ function SegmentedControl({
|
|
|
645
885
|
}, [value, options.length]);
|
|
646
886
|
const thumbStyle = {
|
|
647
887
|
"--rqk-seg-x": `${thumb.x}px`,
|
|
648
|
-
"--rqk-seg-w": `${thumb.width}px
|
|
888
|
+
"--rqk-seg-w": `${thumb.width}px`,
|
|
889
|
+
opacity: thumb.ready ? 1 : 0
|
|
649
890
|
};
|
|
650
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ jsxs8(
|
|
651
892
|
"div",
|
|
652
893
|
{
|
|
653
894
|
ref: rootRef,
|
|
@@ -656,10 +897,10 @@ function SegmentedControl({
|
|
|
656
897
|
"aria-label": ariaLabel,
|
|
657
898
|
"data-ready": thumb.ready,
|
|
658
899
|
children: [
|
|
659
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ jsx13("span", { className: "rqk-segmented-thumb", style: thumbStyle, "aria-hidden": "true" }),
|
|
660
901
|
options.map((option) => {
|
|
661
902
|
const active = option.value === value;
|
|
662
|
-
return /* @__PURE__ */
|
|
903
|
+
return /* @__PURE__ */ jsx13(
|
|
663
904
|
"button",
|
|
664
905
|
{
|
|
665
906
|
type: "button",
|
|
@@ -679,116 +920,6 @@ function SegmentedControl({
|
|
|
679
920
|
);
|
|
680
921
|
}
|
|
681
922
|
|
|
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
|
-
|
|
755
|
-
// src/primitives/action-bar.tsx
|
|
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
|
-
)) });
|
|
790
|
-
}
|
|
791
|
-
|
|
792
923
|
// src/questions/single-choice/actions.ts
|
|
793
924
|
function singleChoiceActions({
|
|
794
925
|
readonly,
|
|
@@ -818,7 +949,7 @@ function singleChoiceActions({
|
|
|
818
949
|
}
|
|
819
950
|
|
|
820
951
|
// src/questions/single-choice/feedback.tsx
|
|
821
|
-
import { jsx as
|
|
952
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
822
953
|
function SingleChoiceFeedback({
|
|
823
954
|
readonly,
|
|
824
955
|
phase,
|
|
@@ -827,7 +958,7 @@ function SingleChoiceFeedback({
|
|
|
827
958
|
answerLabel
|
|
828
959
|
}) {
|
|
829
960
|
if (readonly) {
|
|
830
|
-
return /* @__PURE__ */
|
|
961
|
+
return /* @__PURE__ */ jsx14(
|
|
831
962
|
FeedbackSheet,
|
|
832
963
|
{
|
|
833
964
|
tone: "ok",
|
|
@@ -839,10 +970,10 @@ function SingleChoiceFeedback({
|
|
|
839
970
|
);
|
|
840
971
|
}
|
|
841
972
|
if (phase === "retry") {
|
|
842
|
-
return /* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ jsx14(FeedbackSheet, { tone: "bad", title: labels.wrongAnswer, detail: "\u518D\u68C0\u67E5\u4E00\u6B21\uFF0C\u8FD8\u6709\u4E00\u6B21\u673A\u4F1A" });
|
|
843
974
|
}
|
|
844
975
|
if (phase === "correct") {
|
|
845
|
-
return /* @__PURE__ */
|
|
976
|
+
return /* @__PURE__ */ jsx14(
|
|
846
977
|
FeedbackSheet,
|
|
847
978
|
{
|
|
848
979
|
tone: "ok",
|
|
@@ -853,7 +984,7 @@ function SingleChoiceFeedback({
|
|
|
853
984
|
);
|
|
854
985
|
}
|
|
855
986
|
if (phase === "locked") {
|
|
856
|
-
return /* @__PURE__ */
|
|
987
|
+
return /* @__PURE__ */ jsx14(
|
|
857
988
|
FeedbackSheet,
|
|
858
989
|
{
|
|
859
990
|
tone: "bad",
|
|
@@ -885,7 +1016,7 @@ function matchesAny(value, answers) {
|
|
|
885
1016
|
}
|
|
886
1017
|
|
|
887
1018
|
// src/questions/single-choice/option-list.tsx
|
|
888
|
-
import { jsx as
|
|
1019
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
889
1020
|
function SingleChoiceOptions({
|
|
890
1021
|
data,
|
|
891
1022
|
canPick,
|
|
@@ -893,7 +1024,7 @@ function SingleChoiceOptions({
|
|
|
893
1024
|
onPick
|
|
894
1025
|
}) {
|
|
895
1026
|
const hasImages = data.options.some((option) => option.image);
|
|
896
|
-
return /* @__PURE__ */
|
|
1027
|
+
return /* @__PURE__ */ jsx15("div", { className: classNames("rqk-option-list", hasImages && "rqk-option-list-grid"), children: data.options.map((option, optionIndex) => /* @__PURE__ */ jsx15(
|
|
897
1028
|
OptionItem,
|
|
898
1029
|
{
|
|
899
1030
|
label: optionLetter(optionIndex),
|
|
@@ -901,7 +1032,7 @@ function SingleChoiceOptions({
|
|
|
901
1032
|
state: stateOf(optionIndex),
|
|
902
1033
|
layout: hasImages ? "grid" : "row",
|
|
903
1034
|
disabled: !canPick,
|
|
904
|
-
media: option.image ? /* @__PURE__ */
|
|
1035
|
+
media: option.image ? /* @__PURE__ */ jsx15("img", { className: "rqk-option-image", src: option.image, alt: "" }) : void 0,
|
|
905
1036
|
audioIndicator: Boolean(option.audio || option.speak),
|
|
906
1037
|
onClick: () => onPick(optionIndex),
|
|
907
1038
|
children: option.text
|
|
@@ -911,9 +1042,9 @@ function SingleChoiceOptions({
|
|
|
911
1042
|
}
|
|
912
1043
|
|
|
913
1044
|
// src/primitives/card.tsx
|
|
914
|
-
import { jsx as
|
|
1045
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
915
1046
|
function Card({ children, flush, tint, className }) {
|
|
916
|
-
return /* @__PURE__ */
|
|
1047
|
+
return /* @__PURE__ */ jsx16(
|
|
917
1048
|
"div",
|
|
918
1049
|
{
|
|
919
1050
|
className: classNames(
|
|
@@ -1122,7 +1253,7 @@ function useMediaProgress({
|
|
|
1122
1253
|
}
|
|
1123
1254
|
|
|
1124
1255
|
// src/primitives/audio-bar.tsx
|
|
1125
|
-
import { jsx as
|
|
1256
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1126
1257
|
var WAVE_BARS = [
|
|
1127
1258
|
10,
|
|
1128
1259
|
16,
|
|
@@ -1234,111 +1365,44 @@ function AudioBar({
|
|
|
1234
1365
|
setPlaying(true);
|
|
1235
1366
|
} else {
|
|
1236
1367
|
(_a = audioRef.current) == null ? void 0 : _a.pause();
|
|
1237
|
-
setPlaying(false);
|
|
1238
|
-
}
|
|
1239
|
-
};
|
|
1240
|
-
const total = src ? sourceDuration != null ? sourceDuration : duration : duration;
|
|
1241
|
-
return /* @__PURE__ */
|
|
1242
|
-
"div",
|
|
1243
|
-
{
|
|
1244
|
-
className: classNames(
|
|
1245
|
-
"rqk-audio-bar",
|
|
1246
|
-
compact && "rqk-audio-bar-compact",
|
|
1247
|
-
isPlaying && "rqk-is-playing",
|
|
1248
|
-
className
|
|
1249
|
-
),
|
|
1250
|
-
children: [
|
|
1251
|
-
/* @__PURE__ */ jsx15(
|
|
1252
|
-
"button",
|
|
1253
|
-
{
|
|
1254
|
-
type: "button",
|
|
1255
|
-
className: "rqk-audio-bar-play",
|
|
1256
|
-
onClick: handleToggle,
|
|
1257
|
-
"aria-label": isPlaying ? "\u6682\u505C" : "\u64AD\u653E",
|
|
1258
|
-
children: isPlaying ? /* @__PURE__ */ jsx15(PauseIcon, { size: 18 }) : /* @__PURE__ */ jsx15(PlayIcon, { size: 18 })
|
|
1259
|
-
}
|
|
1260
|
-
),
|
|
1261
|
-
/* @__PURE__ */ jsxs8("div", { className: "rqk-audio-bar-main", children: [
|
|
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)) })
|
|
1264
|
-
] }),
|
|
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
|
|
1267
|
-
]
|
|
1268
|
-
}
|
|
1269
|
-
);
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
// src/primitives/picture-box.tsx
|
|
1273
|
-
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1274
|
-
|
|
1275
|
-
// src/art/illustrations.tsx
|
|
1276
|
-
import { useId } from "react";
|
|
1277
|
-
|
|
1278
|
-
// src/assets/svg/art-apple.svg
|
|
1279
|
-
var art_apple_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="#FF8A8A"></stop><stop offset="1" stop-color="#E5484D"></stop></linearGradient></defs><circle cx="57" cy="66" r="32" fill="url(#rqk-grad)"></circle><circle cx="72" cy="70" r="25" fill="url(#rqk-grad)" opacity="0.92"></circle><ellipse cx="47" cy="52" rx="7" ry="10" fill="#FFFFFF" opacity="0.4" transform="rotate(-24 47 52)"></ellipse><path d="M64 36c0-6 3-10 8-12" stroke="#8B5E34" stroke-width="3" stroke-linecap="round" fill="none"></path><path d="M68 34c2-8 12-11 20-7-2 8-12 11-20 7z" fill="#3ED598"></path></svg>\n';
|
|
1280
|
-
|
|
1281
|
-
// src/assets/svg/art-balloon.svg
|
|
1282
|
-
var art_balloon_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.2" y1="0" x2="0.8" y2="1"><stop offset="0" stop-color="#7FB0FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><ellipse cx="60" cy="50" rx="28" ry="32" fill="url(#rqk-grad)"></ellipse><ellipse cx="50" cy="38" rx="7" ry="9" fill="#FFFFFF" opacity="0.45"></ellipse><path d="M60 82l3 6h-6z" fill="#0147CC"></path><path d="M60 88c8 6-8 10 0 16s-8 8 0 12" stroke="#0147CC" stroke-width="2.2" fill="none" stroke-linecap="round"></path><circle cx="94" cy="30" r="4" fill="#FFD166"></circle><circle cx="22" cy="86" r="3" fill="#7C5CFF" opacity="0.6"></circle></svg>\n';
|
|
1283
|
-
|
|
1284
|
-
// src/assets/svg/art-books.svg
|
|
1285
|
-
var art_books_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" class="rqk-art-svg" aria-hidden="true" focusable="false"><rect x="20" y="80" width="80" height="16" rx="5" fill="#0158FD"></rect><rect x="26" y="62" width="68" height="16" rx="5" fill="#3ED598"></rect><rect x="22" y="44" width="72" height="16" rx="5" fill="#FFB020"></rect><rect x="32" y="26" width="58" height="16" rx="5" fill="#7C5CFF"></rect><path d="M34 34h54M28 52h60M32 70h56M26 88h68" stroke="#FFFFFF" stroke-width="2.4" opacity="0.35" stroke-linecap="round"></path><circle cx="88" cy="22" r="5" fill="#9CBFFF" opacity="0.7"></circle></svg>\n';
|
|
1286
|
-
|
|
1287
|
-
// src/assets/svg/art-cat.svg
|
|
1288
|
-
var art_cat_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="0" y2="1"><stop offset="0" stop-color="#FFC48A"></stop><stop offset="1" stop-color="#F09A4F"></stop></linearGradient></defs><path d="M36 42l-6-20 18 8zM84 42l6-20-18 8z" fill="url(#rqk-grad)"></path><circle cx="60" cy="66" r="34" fill="url(#rqk-grad)"></circle><ellipse cx="60" cy="82" rx="18" ry="13" fill="#FFF3E4"></ellipse><circle cx="48" cy="62" r="3.4" fill="#5B3A22"></circle><circle cx="72" cy="62" r="3.4" fill="#5B3A22"></circle><path d="M55 74h10l-5 5z" fill="#F08A8A"></path><path d="M56 83c1.6 1.8 6.4 1.8 8 0" stroke="#5B3A22" stroke-width="1.8" fill="none"></path><path d="M22 68h14M24 76h12M98 68h-14M96 76h-12" stroke="#E7C39F" stroke-width="2" stroke-linecap="round"></path></svg>\n';
|
|
1289
|
-
|
|
1290
|
-
// src/assets/svg/art-coffee.svg
|
|
1291
|
-
var art_coffee_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="0" y2="1"><stop offset="0" stop-color="#FFFFFF"></stop><stop offset="1" stop-color="#E7EEFA"></stop></linearGradient></defs><ellipse cx="58" cy="90" rx="34" ry="6" fill="#DCE6F7"></ellipse><path d="M30 50h50l-5 34c-.6 4-4 7-8 7H43c-4 0-7.4-3-8-7z" fill="url(#rqk-grad)"></path><path d="M80 58h6a9 9 0 010 18h-3" stroke="#C3D2E8" stroke-width="4" fill="none"></path><rect x="34" y="58" width="42" height="14" rx="4" fill="#D6E2F5"></rect><path d="M48 42c-4-7 4-9 0-16M62 42c-4-7 4-9 0-16" stroke="#9CBFFF" stroke-width="3" fill="none" stroke-linecap="round" opacity="0.8"></path><circle cx="88" cy="34" r="4" fill="#FFB020" opacity="0.7"></circle></svg>\n';
|
|
1292
|
-
|
|
1293
|
-
// src/assets/svg/art-headphones.svg
|
|
1294
|
-
var art_headphones_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-b" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3D7BFF"></stop><stop offset="1" stop-color="#013AA6"></stop></linearGradient></defs><ellipse cx="120" cy="162" rx="48" ry="8" fill="#0B1220" opacity="0.07"></ellipse><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="url(#rqk-grad-a)" stroke-width="15" stroke-linecap="round"></path><path d="M62 112V94c0-32 26-56 58-56s58 24 58 56v18" stroke="#fff" stroke-width="4" stroke-linecap="round" opacity="0.35"></path><rect x="46" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="160" y="102" width="34" height="52" rx="17" fill="url(#rqk-grad-b)"></rect><rect x="54" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><rect x="168" y="112" width="18" height="32" rx="9" fill="#fff" opacity="0.25"></rect><g stroke="#0158FD" stroke-width="3" stroke-linecap="round" opacity="0.5"><path d="M198 74c8 6 12 14 12 22M206 62c12 9 18 21 18 34"></path></g></svg>\n';
|
|
1295
|
-
|
|
1296
|
-
// src/assets/svg/art-kid.svg
|
|
1297
|
-
var art_kid_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="0" y2="1"><stop offset="0" stop-color="#4F8BFF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient></defs><circle cx="60" cy="58" r="46" fill="#EAF1FF"></circle><path d="M22 104c0-15 17-24 38-24s38 9 38 24z" fill="url(#rqk-grad)"></path><circle cx="60" cy="52" r="25" fill="#FFD3B6"></circle><path d="M36 47c0-13 10-21 24-21s24 8 24 21c-6-4-13-6-24-6s-18 2-24 6z" fill="#1F2A44"></path><circle cx="51" cy="53" r="2.6" fill="#1F2A44"></circle><circle cx="69" cy="53" r="2.6" fill="#1F2A44"></circle><path d="M54 62c2.6 3 9.4 3 12 0" stroke="#C96A5A" stroke-width="2.4" stroke-linecap="round" fill="none"></path><circle cx="43" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle><circle cx="77" cy="60" r="3.4" fill="#FFB4A8" opacity="0.6"></circle></svg>\n';
|
|
1298
|
-
|
|
1299
|
-
// src/assets/svg/art-screen.svg
|
|
1300
|
-
var art_screen_default = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 186" fill="none" class="rqk-art-svg" aria-hidden="true" focusable="false"><defs><linearGradient id="rqk-grad-play" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#5C96FF"></stop><stop offset="1" stop-color="#0158FD"></stop></linearGradient><linearGradient id="rqk-grad-screen" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#EAF2FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><ellipse cx="120" cy="166" rx="52" ry="8" fill="#0B1220" opacity="0.07"></ellipse><rect x="42" y="32" width="156" height="104" rx="16" fill="url(#rqk-grad-screen)" stroke="#B9D0FF" stroke-width="2"></rect><rect x="52" y="42" width="136" height="84" rx="10" fill="#0B1220" opacity="0.06"></rect><circle cx="120" cy="84" r="26" fill="url(#rqk-grad-play)"></circle><path d="M113 73l20 11-20 11V73z" fill="#fff"></path><rect x="106" y="136" width="28" height="16" fill="#C6DBFF"></rect><rect x="84" y="150" width="72" height="8" rx="4" fill="#B9D0FF"></rect><g fill="#0158FD" opacity="0.5"><circle cx="62" cy="52" r="2.6"></circle><circle cx="70" cy="52" r="2.6"></circle><circle cx="78" cy="52" r="2.6"></circle></g></svg>\n';
|
|
1301
|
-
|
|
1302
|
-
// src/assets/svg/art-speech.svg
|
|
1303
|
-
var art_speech_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="#EAF1FF"></stop><stop offset="1" stop-color="#C6DBFF"></stop></linearGradient></defs><path d="M24 34h72a8 8 0 018 8v34a8 8 0 01-8 8H60l-16 14v-14H24a8 8 0 01-8-8V42a8 8 0 018-8z" fill="url(#rqk-grad)"></path><rect x="38" y="52" width="7" height="18" rx="3.5" fill="#0158FD"></rect><rect x="51" y="44" width="7" height="34" rx="3.5" fill="#4F8BFF"></rect><rect x="64" y="48" width="7" height="26" rx="3.5" fill="#4F8BFF"></rect><rect x="77" y="58" width="7" height="10" rx="3.5" fill="#9CBFFF"></rect></svg>\n';
|
|
1304
|
-
|
|
1305
|
-
// src/assets/svg/art-trophy.svg
|
|
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';
|
|
1307
|
-
|
|
1308
|
-
// src/art/illustrations.tsx
|
|
1309
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1310
|
-
var ART_SOURCES = {
|
|
1311
|
-
kid: art_kid_default,
|
|
1312
|
-
balloon: art_balloon_default,
|
|
1313
|
-
apple: art_apple_default,
|
|
1314
|
-
coffee: art_coffee_default,
|
|
1315
|
-
cat: art_cat_default,
|
|
1316
|
-
books: art_books_default,
|
|
1317
|
-
headphones: art_headphones_default,
|
|
1318
|
-
screen: art_screen_default,
|
|
1319
|
-
trophy: art_trophy_default,
|
|
1320
|
-
speech: art_speech_default
|
|
1321
|
-
};
|
|
1322
|
-
function Art({ name, className, size }) {
|
|
1323
|
-
var _a;
|
|
1324
|
-
const unique = useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
1325
|
-
const source = ((_a = ART_SOURCES[name]) != null ? _a : art_speech_default).replace(
|
|
1326
|
-
/rqk-grad/g,
|
|
1327
|
-
`rqk-grad-${unique}`
|
|
1328
|
-
);
|
|
1329
|
-
return /* @__PURE__ */ jsx16(
|
|
1330
|
-
"span",
|
|
1368
|
+
setPlaying(false);
|
|
1369
|
+
}
|
|
1370
|
+
};
|
|
1371
|
+
const total = src ? sourceDuration != null ? sourceDuration : duration : duration;
|
|
1372
|
+
return /* @__PURE__ */ jsxs9(
|
|
1373
|
+
"div",
|
|
1331
1374
|
{
|
|
1332
|
-
className:
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1375
|
+
className: classNames(
|
|
1376
|
+
"rqk-audio-bar",
|
|
1377
|
+
compact && "rqk-audio-bar-compact",
|
|
1378
|
+
isPlaying && "rqk-is-playing",
|
|
1379
|
+
className
|
|
1380
|
+
),
|
|
1381
|
+
children: [
|
|
1382
|
+
/* @__PURE__ */ jsx17(
|
|
1383
|
+
"button",
|
|
1384
|
+
{
|
|
1385
|
+
type: "button",
|
|
1386
|
+
className: "rqk-audio-bar-play",
|
|
1387
|
+
onClick: handleToggle,
|
|
1388
|
+
"aria-label": isPlaying ? "\u6682\u505C" : "\u64AD\u653E",
|
|
1389
|
+
children: isPlaying ? /* @__PURE__ */ jsx17(PauseIcon, { size: 18 }) : /* @__PURE__ */ jsx17(PlayIcon, { size: 18 })
|
|
1390
|
+
}
|
|
1391
|
+
),
|
|
1392
|
+
/* @__PURE__ */ jsxs9("div", { className: "rqk-audio-bar-main", children: [
|
|
1393
|
+
label ? /* @__PURE__ */ jsx17("div", { className: "rqk-audio-bar-label", children: label }) : null,
|
|
1394
|
+
/* @__PURE__ */ jsx17("div", { className: "rqk-audio-bar-wave", "aria-hidden": true, children: WAVE_BARS.map((height, barIndex) => /* @__PURE__ */ jsx17("span", { style: { height: `${height}px` } }, barIndex)) })
|
|
1395
|
+
] }),
|
|
1396
|
+
/* @__PURE__ */ jsx17("span", { className: "rqk-audio-bar-time", children: formatTime(isPlaying ? position : total) }),
|
|
1397
|
+
src ? /* @__PURE__ */ jsx17("audio", { ref: audioRef, src, preload: "metadata" }) : null
|
|
1398
|
+
]
|
|
1336
1399
|
}
|
|
1337
1400
|
);
|
|
1338
1401
|
}
|
|
1339
1402
|
|
|
1340
1403
|
// src/primitives/picture-box.tsx
|
|
1341
|
-
import {
|
|
1404
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1405
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1342
1406
|
function PictureBox({
|
|
1343
1407
|
src,
|
|
1344
1408
|
alt = "",
|
|
@@ -1356,7 +1420,7 @@ function PictureBox({
|
|
|
1356
1420
|
setLoaded(false);
|
|
1357
1421
|
}, [src]);
|
|
1358
1422
|
const resolved = state != null ? state : src ? failed ? "fail" : loaded ? "ok" : "loading" : "default";
|
|
1359
|
-
return /* @__PURE__ */
|
|
1423
|
+
return /* @__PURE__ */ jsxs10(
|
|
1360
1424
|
"div",
|
|
1361
1425
|
{
|
|
1362
1426
|
className: classNames(
|
|
@@ -1367,7 +1431,7 @@ function PictureBox({
|
|
|
1367
1431
|
style: { aspectRatio: ratio },
|
|
1368
1432
|
"data-state": resolved,
|
|
1369
1433
|
children: [
|
|
1370
|
-
src && resolved !== "fail" ? /* @__PURE__ */
|
|
1434
|
+
src && resolved !== "fail" ? /* @__PURE__ */ jsx18(
|
|
1371
1435
|
"img",
|
|
1372
1436
|
{
|
|
1373
1437
|
src,
|
|
@@ -1376,9 +1440,9 @@ function PictureBox({
|
|
|
1376
1440
|
onError: () => setFailed(true)
|
|
1377
1441
|
}
|
|
1378
1442
|
) : null,
|
|
1379
|
-
resolved === "loading" ? /* @__PURE__ */
|
|
1380
|
-
resolved === "default" || resolved === "fail" ? /* @__PURE__ */
|
|
1381
|
-
resolved === "fail" ? /* @__PURE__ */
|
|
1443
|
+
resolved === "loading" ? /* @__PURE__ */ jsx18("span", { className: "rqk-picture-skeleton", "aria-hidden": true }) : null,
|
|
1444
|
+
resolved === "default" || resolved === "fail" ? /* @__PURE__ */ jsx18("span", { className: "rqk-picture-fallback", children: /* @__PURE__ */ jsx18(Art, { name: art }) }) : null,
|
|
1445
|
+
resolved === "fail" ? /* @__PURE__ */ jsx18(
|
|
1382
1446
|
"button",
|
|
1383
1447
|
{
|
|
1384
1448
|
type: "button",
|
|
@@ -1387,19 +1451,19 @@ function PictureBox({
|
|
|
1387
1451
|
children: "\u91CD\u65B0\u52A0\u8F7D"
|
|
1388
1452
|
}
|
|
1389
1453
|
) : null,
|
|
1390
|
-
caption ? /* @__PURE__ */
|
|
1454
|
+
caption ? /* @__PURE__ */ jsx18("span", { className: "rqk-picture-caption", children: caption }) : null
|
|
1391
1455
|
]
|
|
1392
1456
|
}
|
|
1393
1457
|
);
|
|
1394
1458
|
}
|
|
1395
1459
|
|
|
1396
1460
|
// src/questions/single-choice/stem-card.tsx
|
|
1397
|
-
import { jsx as
|
|
1461
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1398
1462
|
function SingleChoiceStem({ data }) {
|
|
1399
|
-
return /* @__PURE__ */
|
|
1400
|
-
data.stemImage ? /* @__PURE__ */
|
|
1401
|
-
data.stemAudio ? /* @__PURE__ */
|
|
1402
|
-
/* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ jsxs11(Card, { className: "rqk-stem-card", children: [
|
|
1464
|
+
data.stemImage ? /* @__PURE__ */ jsx19(PictureBox, { src: data.stemImage, art: "books", ratio: "16 / 9", alt: "\u9898\u5E72\u914D\u56FE" }) : null,
|
|
1465
|
+
data.stemAudio ? /* @__PURE__ */ jsx19(AudioBar, { src: data.stemAudio }) : null,
|
|
1466
|
+
/* @__PURE__ */ jsx19("div", { className: "rqk-stem", children: data.stem })
|
|
1403
1467
|
] });
|
|
1404
1468
|
}
|
|
1405
1469
|
|
|
@@ -1434,7 +1498,7 @@ var speakWithSynthesis = (text, opts) => {
|
|
|
1434
1498
|
};
|
|
1435
1499
|
|
|
1436
1500
|
// src/questions/single-choice/use-single-choice.tsx
|
|
1437
|
-
import { Fragment, jsxs as
|
|
1501
|
+
import { Fragment, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1438
1502
|
function useSingleChoice({
|
|
1439
1503
|
data,
|
|
1440
1504
|
mode,
|
|
@@ -1485,7 +1549,7 @@ function useSingleChoice({
|
|
|
1485
1549
|
answer: selected
|
|
1486
1550
|
});
|
|
1487
1551
|
}, [judge, onSubmit, selected]);
|
|
1488
|
-
const answerLabel = (_b = data.answerLabel) != null ? _b : /* @__PURE__ */
|
|
1552
|
+
const answerLabel = (_b = data.answerLabel) != null ? _b : /* @__PURE__ */ jsxs12(Fragment, { children: [
|
|
1489
1553
|
optionLetter(data.answer),
|
|
1490
1554
|
". ",
|
|
1491
1555
|
(_a = data.options[data.answer]) == null ? void 0 : _a.text
|
|
@@ -1521,7 +1585,7 @@ function useSingleChoice({
|
|
|
1521
1585
|
}
|
|
1522
1586
|
|
|
1523
1587
|
// src/questions/single-choice/index.tsx
|
|
1524
|
-
import { Fragment as Fragment2, jsx as
|
|
1588
|
+
import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1525
1589
|
function SingleChoice({
|
|
1526
1590
|
data,
|
|
1527
1591
|
mode = "answer",
|
|
@@ -1547,7 +1611,7 @@ function SingleChoice({
|
|
|
1547
1611
|
onSubmit: model.handleSubmit,
|
|
1548
1612
|
onRetry: model.judge.retry
|
|
1549
1613
|
});
|
|
1550
|
-
return /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ jsx20(
|
|
1551
1615
|
QuestShell,
|
|
1552
1616
|
{
|
|
1553
1617
|
mode,
|
|
@@ -1558,7 +1622,7 @@ function SingleChoice({
|
|
|
1558
1622
|
onBack,
|
|
1559
1623
|
className: classNames("rqk-quest", className),
|
|
1560
1624
|
dataQuest: "single-choice",
|
|
1561
|
-
feedback: /* @__PURE__ */
|
|
1625
|
+
feedback: /* @__PURE__ */ jsx20(
|
|
1562
1626
|
SingleChoiceFeedback,
|
|
1563
1627
|
{
|
|
1564
1628
|
readonly: model.readonly,
|
|
@@ -1568,10 +1632,10 @@ function SingleChoice({
|
|
|
1568
1632
|
answerLabel: model.answerLabel
|
|
1569
1633
|
}
|
|
1570
1634
|
),
|
|
1571
|
-
footer: /* @__PURE__ */
|
|
1572
|
-
children: /* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1635
|
+
footer: /* @__PURE__ */ jsx20(ActionBar, { actions, index, total, onPrev }),
|
|
1636
|
+
children: /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
1637
|
+
/* @__PURE__ */ jsx20(SingleChoiceStem, { data }),
|
|
1638
|
+
/* @__PURE__ */ jsx20(
|
|
1575
1639
|
SingleChoiceOptions,
|
|
1576
1640
|
{
|
|
1577
1641
|
data,
|
|
@@ -1640,7 +1704,7 @@ function followArt(data) {
|
|
|
1640
1704
|
}
|
|
1641
1705
|
|
|
1642
1706
|
// src/questions/follow-read/follow-content.tsx
|
|
1643
|
-
import { jsx as
|
|
1707
|
+
import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1644
1708
|
function FollowContent({
|
|
1645
1709
|
data,
|
|
1646
1710
|
stage,
|
|
@@ -1650,10 +1714,10 @@ function FollowContent({
|
|
|
1650
1714
|
startBadgeVisible
|
|
1651
1715
|
}) {
|
|
1652
1716
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1653
|
-
return /* @__PURE__ */
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
art ? /* @__PURE__ */
|
|
1656
|
-
/* @__PURE__ */
|
|
1717
|
+
return /* @__PURE__ */ jsxs14("div", { className: "rqk-follow-card flex flex-col gap-3", children: [
|
|
1718
|
+
/* @__PURE__ */ jsxs14("div", { className: "rqk-follow-stage", children: [
|
|
1719
|
+
art ? /* @__PURE__ */ jsx21(Art, { name: art, className: "rqk-follow-art" }) : /* @__PURE__ */ jsxs14("span", { className: "rqk-follow-no-image", role: "img", "aria-label": "No image", children: [
|
|
1720
|
+
/* @__PURE__ */ jsxs14(
|
|
1657
1721
|
"svg",
|
|
1658
1722
|
{
|
|
1659
1723
|
className: "rqk-follow-no-image-icon",
|
|
@@ -1661,7 +1725,7 @@ function FollowContent({
|
|
|
1661
1725
|
fill: "none",
|
|
1662
1726
|
"aria-hidden": true,
|
|
1663
1727
|
children: [
|
|
1664
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ jsx21(
|
|
1665
1729
|
"rect",
|
|
1666
1730
|
{
|
|
1667
1731
|
x: "7",
|
|
@@ -1673,8 +1737,8 @@ function FollowContent({
|
|
|
1673
1737
|
strokeWidth: "2"
|
|
1674
1738
|
}
|
|
1675
1739
|
),
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ jsx21("circle", { cx: "17", cy: "19", r: "3", fill: "currentColor", opacity: "0.45" }),
|
|
1741
|
+
/* @__PURE__ */ jsx21(
|
|
1678
1742
|
"path",
|
|
1679
1743
|
{
|
|
1680
1744
|
d: "M10 34l9-9 7 7 6-6 8 8",
|
|
@@ -1684,7 +1748,7 @@ function FollowContent({
|
|
|
1684
1748
|
strokeLinejoin: "round"
|
|
1685
1749
|
}
|
|
1686
1750
|
),
|
|
1687
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsx21(
|
|
1688
1752
|
"path",
|
|
1689
1753
|
{
|
|
1690
1754
|
d: "M11 8l27 32",
|
|
@@ -1696,24 +1760,24 @@ function FollowContent({
|
|
|
1696
1760
|
]
|
|
1697
1761
|
}
|
|
1698
1762
|
),
|
|
1699
|
-
/* @__PURE__ */
|
|
1763
|
+
/* @__PURE__ */ jsx21("span", { className: "rqk-follow-no-image-text", children: "No image" })
|
|
1700
1764
|
] }),
|
|
1701
|
-
startBadgeVisible ? /* @__PURE__ */
|
|
1765
|
+
startBadgeVisible ? /* @__PURE__ */ jsx21("span", { className: "rqk-follow-start", children: "\u51C6\u5907\u5F00\u59CB\u8DDF\u8BFB" }) : null
|
|
1702
1766
|
] }),
|
|
1703
|
-
data.kind === "word" ? /* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1706
|
-
((_b = data.word) == null ? void 0 : _b.phonetic) ? /* @__PURE__ */
|
|
1707
|
-
((_c = data.word) == null ? void 0 : _c.partOfSpeech) || ((_d = data.word) == null ? void 0 : _d.meaning) ? /* @__PURE__ */
|
|
1708
|
-
((_e = data.word) == null ? void 0 : _e.partOfSpeech) ? /* @__PURE__ */
|
|
1709
|
-
((_f = data.word) == null ? void 0 : _f.meaning) ? /* @__PURE__ */
|
|
1767
|
+
data.kind === "word" ? /* @__PURE__ */ jsxs14(Card, { className: "rqk-follow-word", children: [
|
|
1768
|
+
/* @__PURE__ */ jsx21("div", { className: "rqk-follow-word-text", children: (_a = data.word) == null ? void 0 : _a.text }),
|
|
1769
|
+
/* @__PURE__ */ jsxs14("div", { className: "rqk-follow-word-meta", children: [
|
|
1770
|
+
((_b = data.word) == null ? void 0 : _b.phonetic) ? /* @__PURE__ */ jsx21("span", { className: "rqk-follow-phonetic", children: data.word.phonetic }) : null,
|
|
1771
|
+
((_c = data.word) == null ? void 0 : _c.partOfSpeech) || ((_d = data.word) == null ? void 0 : _d.meaning) ? /* @__PURE__ */ jsxs14("div", { className: "rqk-follow-pos-line", children: [
|
|
1772
|
+
((_e = data.word) == null ? void 0 : _e.partOfSpeech) ? /* @__PURE__ */ jsx21("span", { className: "rqk-follow-pos", children: data.word.partOfSpeech }) : null,
|
|
1773
|
+
((_f = data.word) == null ? void 0 : _f.meaning) ? /* @__PURE__ */ jsx21("span", { className: "rqk-follow-meaning", children: data.word.meaning }) : null
|
|
1710
1774
|
] }) : null
|
|
1711
1775
|
] })
|
|
1712
|
-
] }) : /* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1776
|
+
] }) : /* @__PURE__ */ jsxs14("div", { className: "rqk-follow-word rqk-follow-sentence-box", children: [
|
|
1777
|
+
/* @__PURE__ */ jsx21("div", { className: "rqk-follow-sentence", children: (_g = data.sentence) == null ? void 0 : _g.words.map((word, wordIndex) => {
|
|
1714
1778
|
var _a2;
|
|
1715
1779
|
const score = (_a2 = wordScores[wordIndex]) == null ? void 0 : _a2.score;
|
|
1716
|
-
return /* @__PURE__ */
|
|
1780
|
+
return /* @__PURE__ */ jsx21(
|
|
1717
1781
|
"span",
|
|
1718
1782
|
{
|
|
1719
1783
|
className: classNames(
|
|
@@ -1725,32 +1789,32 @@ function FollowContent({
|
|
|
1725
1789
|
`${word}-${wordIndex}`
|
|
1726
1790
|
);
|
|
1727
1791
|
}) }),
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1792
|
+
/* @__PURE__ */ jsxs14("div", { className: "rqk-follow-legend", children: [
|
|
1793
|
+
/* @__PURE__ */ jsxs14("span", { children: [
|
|
1794
|
+
/* @__PURE__ */ jsx21("i", { className: "rqk-follow-legend-ok", children: "\u7EFF" }),
|
|
1731
1795
|
" \u226580"
|
|
1732
1796
|
] }),
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
1797
|
+
/* @__PURE__ */ jsxs14("span", { children: [
|
|
1798
|
+
/* @__PURE__ */ jsx21("i", { className: "rqk-follow-legend-warn", children: "\u9EC4" }),
|
|
1735
1799
|
" 60\u201380"
|
|
1736
1800
|
] }),
|
|
1737
|
-
/* @__PURE__ */
|
|
1738
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ jsxs14("span", { children: [
|
|
1802
|
+
/* @__PURE__ */ jsx21("i", { className: "rqk-follow-legend-bad", children: "\u7EA2" }),
|
|
1739
1803
|
" <60"
|
|
1740
1804
|
] })
|
|
1741
1805
|
] }),
|
|
1742
|
-
((_h = data.sentence) == null ? void 0 : _h.translation) ? /* @__PURE__ */
|
|
1806
|
+
((_h = data.sentence) == null ? void 0 : _h.translation) ? /* @__PURE__ */ jsx21("div", { className: "rqk-follow-translation", children: data.sentence.translation }) : null
|
|
1743
1807
|
] }),
|
|
1744
|
-
stage === "scoring" && !readonly ? /* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1746
|
-
/* @__PURE__ */
|
|
1808
|
+
stage === "scoring" && !readonly ? /* @__PURE__ */ jsxs14("div", { className: "rqk-follow-scoring", "aria-live": "polite", children: [
|
|
1809
|
+
/* @__PURE__ */ jsx21("span", { className: "rqk-follow-spinner", "aria-hidden": true }),
|
|
1810
|
+
/* @__PURE__ */ jsx21("span", { children: "\u8BC4\u5206\u4E2D\u2026" })
|
|
1747
1811
|
] }) : null
|
|
1748
1812
|
] });
|
|
1749
1813
|
}
|
|
1750
1814
|
|
|
1751
1815
|
// src/primitives/celebration.tsx
|
|
1752
1816
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1753
|
-
import { jsx as
|
|
1817
|
+
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1754
1818
|
var CONFETTI_COLORS = [
|
|
1755
1819
|
"var(--rqk-gold)",
|
|
1756
1820
|
"#ff6b6b",
|
|
@@ -1785,15 +1849,15 @@ function Celebration({
|
|
|
1785
1849
|
return () => window.clearTimeout(timer);
|
|
1786
1850
|
}, [autoHideMs, grade]);
|
|
1787
1851
|
if (hidden) return null;
|
|
1788
|
-
return /* @__PURE__ */
|
|
1789
|
-
withConfetti ? /* @__PURE__ */
|
|
1852
|
+
return /* @__PURE__ */ jsxs15("div", { className: classNames("rqk-celebrate", className), "data-grade": grade, role: "status", children: [
|
|
1853
|
+
withConfetti ? /* @__PURE__ */ jsx22("div", { className: "rqk-confetti", "aria-hidden": true, children: Array.from({ length: CONFETTI_COUNT }).map((_, index) => {
|
|
1790
1854
|
const x = 4 + index * 37 % 93;
|
|
1791
1855
|
const y = 8 + index * 11 % 26;
|
|
1792
1856
|
const delay = index * 7 % 6 * 0.07;
|
|
1793
1857
|
const duration = 1.1 + index * 5 % 7 * 0.1;
|
|
1794
1858
|
const spin = 180 + index * 41 % 180;
|
|
1795
1859
|
const drift = index * 13 % 48 - 24;
|
|
1796
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ jsx22(
|
|
1797
1861
|
"span",
|
|
1798
1862
|
{
|
|
1799
1863
|
className: "rqk-confetti-piece",
|
|
@@ -1812,16 +1876,16 @@ function Celebration({
|
|
|
1812
1876
|
index
|
|
1813
1877
|
);
|
|
1814
1878
|
}) }) : null,
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1817
|
-
/* @__PURE__ */
|
|
1818
|
-
note ? /* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx22(StarRating, { value: config.stars, size: 26, animate: true }),
|
|
1880
|
+
/* @__PURE__ */ jsx22("div", { className: "rqk-celebrate-title", children: title != null ? title : config.title }),
|
|
1881
|
+
/* @__PURE__ */ jsx22("div", { className: "rqk-celebrate-ribbon", children: ribbon != null ? ribbon : config.ribbon }),
|
|
1882
|
+
note ? /* @__PURE__ */ jsx22("div", { className: "rqk-celebrate-note", children: note }) : null
|
|
1819
1883
|
] });
|
|
1820
1884
|
}
|
|
1821
1885
|
|
|
1822
1886
|
// src/primitives/record-cluster.tsx
|
|
1823
1887
|
import { useEffect as useEffect6, useRef as useRef6, useState as useState9 } from "react";
|
|
1824
|
-
import { Fragment as Fragment3, jsx as
|
|
1888
|
+
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1825
1889
|
function formatClock(value) {
|
|
1826
1890
|
const total = Math.max(0, Math.floor(value));
|
|
1827
1891
|
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
@@ -1884,9 +1948,9 @@ function RecordCluster({
|
|
|
1884
1948
|
else start();
|
|
1885
1949
|
};
|
|
1886
1950
|
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";
|
|
1887
|
-
return /* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
1889
|
-
/* @__PURE__ */
|
|
1951
|
+
return /* @__PURE__ */ jsxs16("div", { className: classNames("rqk-record-cluster", className), children: [
|
|
1952
|
+
/* @__PURE__ */ jsxs16("div", { className: "rqk-record-row", children: [
|
|
1953
|
+
/* @__PURE__ */ jsxs16(
|
|
1890
1954
|
"button",
|
|
1891
1955
|
{
|
|
1892
1956
|
type: "button",
|
|
@@ -1898,14 +1962,14 @@ function RecordCluster({
|
|
|
1898
1962
|
"aria-label": "\u64AD\u653E\u8303\u8BFB",
|
|
1899
1963
|
"aria-pressed": activeSide === "demo",
|
|
1900
1964
|
children: [
|
|
1901
|
-
/* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ jsx23("span", { className: "rqk-record-side-icon", children: /* @__PURE__ */ jsx23(SpeakerIcon, { size: 22 }) }),
|
|
1966
|
+
/* @__PURE__ */ jsx23("span", { className: "rqk-record-side-label", children: "\u53D1\u97F3" })
|
|
1903
1967
|
]
|
|
1904
1968
|
}
|
|
1905
1969
|
),
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
recording ? /* @__PURE__ */
|
|
1908
|
-
/* @__PURE__ */
|
|
1970
|
+
/* @__PURE__ */ jsxs16("div", { className: "rqk-record-main", children: [
|
|
1971
|
+
recording ? /* @__PURE__ */ jsxs16("svg", { className: "rqk-record-ring", viewBox: "0 0 100 100", "aria-hidden": true, children: [
|
|
1972
|
+
/* @__PURE__ */ jsx23(
|
|
1909
1973
|
"circle",
|
|
1910
1974
|
{
|
|
1911
1975
|
className: "rqk-record-ring-track",
|
|
@@ -1915,9 +1979,9 @@ function RecordCluster({
|
|
|
1915
1979
|
strokeDasharray: "283"
|
|
1916
1980
|
}
|
|
1917
1981
|
),
|
|
1918
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ jsx23("circle", { cx: "50", cy: "50", r: "45", strokeDasharray: "283", strokeDashoffset: ringOffset })
|
|
1919
1983
|
] }) : null,
|
|
1920
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx23(
|
|
1921
1985
|
"button",
|
|
1922
1986
|
{
|
|
1923
1987
|
type: "button",
|
|
@@ -1926,11 +1990,11 @@ function RecordCluster({
|
|
|
1926
1990
|
disabled: disabled || scoring,
|
|
1927
1991
|
"aria-label": recording ? "\u7ED3\u675F\u5F55\u97F3" : "\u5F00\u59CB\u5F55\u97F3",
|
|
1928
1992
|
"aria-pressed": recording,
|
|
1929
|
-
children: recording ? /* @__PURE__ */
|
|
1993
|
+
children: recording ? /* @__PURE__ */ jsx23("span", { className: "rqk-record-stop", "aria-hidden": true }) : /* @__PURE__ */ jsx23(MicIcon, { size: 30 })
|
|
1930
1994
|
}
|
|
1931
1995
|
)
|
|
1932
1996
|
] }),
|
|
1933
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ jsxs16(
|
|
1934
1998
|
"button",
|
|
1935
1999
|
{
|
|
1936
2000
|
type: "button",
|
|
@@ -1942,35 +2006,35 @@ function RecordCluster({
|
|
|
1942
2006
|
"aria-label": "\u64AD\u653E\u6211\u7684\u5F55\u97F3",
|
|
1943
2007
|
"aria-pressed": activeSide === "mine",
|
|
1944
2008
|
children: [
|
|
1945
|
-
/* @__PURE__ */
|
|
1946
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ jsx23("span", { className: "rqk-record-side-icon", children: /* @__PURE__ */ jsx23(PlayIcon, { size: 20 }) }),
|
|
2010
|
+
/* @__PURE__ */ jsx23("span", { className: "rqk-record-side-label", children: "\u6211\u7684" })
|
|
1947
2011
|
]
|
|
1948
2012
|
}
|
|
1949
2013
|
)
|
|
1950
2014
|
] }),
|
|
1951
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ jsxs16(
|
|
1952
2016
|
"div",
|
|
1953
2017
|
{
|
|
1954
2018
|
className: classNames("rqk-record-status", hintTone !== "default" && `rqk-is-${hintTone}`),
|
|
1955
2019
|
children: [
|
|
1956
|
-
recording ? /* @__PURE__ */
|
|
1957
|
-
/* @__PURE__ */
|
|
2020
|
+
recording ? /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
2021
|
+
/* @__PURE__ */ jsxs16("span", { className: "rqk-record-status-timer", children: [
|
|
1958
2022
|
formatClock(seconds),
|
|
1959
2023
|
" / ",
|
|
1960
2024
|
formatClock(maxSeconds)
|
|
1961
2025
|
] }),
|
|
1962
|
-
/* @__PURE__ */
|
|
2026
|
+
/* @__PURE__ */ jsx23("span", { className: "rqk-record-status-sep", "aria-hidden": true, children: "\xB7" })
|
|
1963
2027
|
] }) : null,
|
|
1964
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ jsx23("span", { children: statusText })
|
|
1965
2029
|
]
|
|
1966
2030
|
}
|
|
1967
2031
|
),
|
|
1968
|
-
detail ? /* @__PURE__ */
|
|
2032
|
+
detail ? /* @__PURE__ */ jsx23("div", { className: classNames("rqk-record-detail", detailTone === "bad" && "rqk-is-bad"), children: detail }) : null
|
|
1969
2033
|
] });
|
|
1970
2034
|
}
|
|
1971
2035
|
|
|
1972
2036
|
// src/questions/follow-read/follow-controls.tsx
|
|
1973
|
-
import { jsx as
|
|
2037
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1974
2038
|
function FollowControls({
|
|
1975
2039
|
grade,
|
|
1976
2040
|
ribbon,
|
|
@@ -1990,9 +2054,9 @@ function FollowControls({
|
|
|
1990
2054
|
onPlayDemo
|
|
1991
2055
|
}) {
|
|
1992
2056
|
const gradeValue = grade && grade !== "noise" ? grade : "again";
|
|
1993
|
-
return /* @__PURE__ */
|
|
1994
|
-
grade && grade !== "noise" ? /* @__PURE__ */
|
|
1995
|
-
/* @__PURE__ */
|
|
2057
|
+
return /* @__PURE__ */ jsxs17("div", { className: "rqk-follow-bottom", children: [
|
|
2058
|
+
grade && grade !== "noise" ? /* @__PURE__ */ jsx24(Celebration, { grade: gradeValue, ribbon, autoHideMs: 3200 }) : null,
|
|
2059
|
+
/* @__PURE__ */ jsx24(
|
|
1996
2060
|
RecordCluster,
|
|
1997
2061
|
{
|
|
1998
2062
|
state: readonly ? "idle" : recordState2,
|
|
@@ -2288,7 +2352,7 @@ function useFollowRead({
|
|
|
2288
2352
|
}
|
|
2289
2353
|
|
|
2290
2354
|
// src/questions/follow-read/index.tsx
|
|
2291
|
-
import { Fragment as Fragment4, jsx as
|
|
2355
|
+
import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2292
2356
|
function FollowRead({
|
|
2293
2357
|
data,
|
|
2294
2358
|
mode = "answer",
|
|
@@ -2323,13 +2387,13 @@ function FollowRead({
|
|
|
2323
2387
|
onNext
|
|
2324
2388
|
});
|
|
2325
2389
|
const displayTitle = title != null ? title : data.kind === "word" ? "\u5355\u8BCD\u8DDF\u8BFB" : "\u53E5\u5B50\u8DDF\u8BFB";
|
|
2326
|
-
const instructionText = instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */
|
|
2390
|
+
const instructionText = instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
2327
2391
|
"\u542C\u5355\u8BCD\u793A\u8303\uFF0C\u70B9\u51FB\u9EA6\u514B\u98CE",
|
|
2328
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ jsx25("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
|
|
2329
2393
|
"\uFF0C\u81EA\u52A8\u8BC4\u5206"
|
|
2330
|
-
] }) : /* @__PURE__ */
|
|
2394
|
+
] }) : /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
2331
2395
|
"\u542C\u53E5\u5B50\u793A\u8303\uFF0C\u70B9\u51FB\u9EA6\u514B\u98CE",
|
|
2332
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ jsx25("b", { children: "\u5927\u58F0\u8DDF\u8BFB" }),
|
|
2333
2397
|
"\uFF0C\u9010\u8BCD\u8BC4\u5206"
|
|
2334
2398
|
] });
|
|
2335
2399
|
const detail = detailHint({
|
|
@@ -2344,7 +2408,7 @@ function FollowRead({
|
|
|
2344
2408
|
});
|
|
2345
2409
|
const hasPrev = index > 1 && Boolean(onPrev);
|
|
2346
2410
|
const hasFooter = actions.length > 0 || hasPrev;
|
|
2347
|
-
return /* @__PURE__ */
|
|
2411
|
+
return /* @__PURE__ */ jsxs18(
|
|
2348
2412
|
QuestShell,
|
|
2349
2413
|
{
|
|
2350
2414
|
mode,
|
|
@@ -2360,11 +2424,11 @@ function FollowRead({
|
|
|
2360
2424
|
className
|
|
2361
2425
|
),
|
|
2362
2426
|
dataQuest: "follow-read",
|
|
2363
|
-
footer: hasFooter ? /* @__PURE__ */
|
|
2427
|
+
footer: hasFooter ? /* @__PURE__ */ jsx25(ActionBar, { actions, index, total, onPrev }) : void 0,
|
|
2364
2428
|
children: [
|
|
2365
|
-
/* @__PURE__ */
|
|
2366
|
-
/* @__PURE__ */
|
|
2367
|
-
/* @__PURE__ */
|
|
2429
|
+
/* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
2430
|
+
/* @__PURE__ */ jsx25("div", { className: "rqk-follow-instr", children: instructionText }),
|
|
2431
|
+
/* @__PURE__ */ jsx25(
|
|
2368
2432
|
FollowContent,
|
|
2369
2433
|
{
|
|
2370
2434
|
data,
|
|
@@ -2375,7 +2439,7 @@ function FollowRead({
|
|
|
2375
2439
|
startBadgeVisible: !model.readonly && model.stage === "ready"
|
|
2376
2440
|
}
|
|
2377
2441
|
),
|
|
2378
|
-
/* @__PURE__ */
|
|
2442
|
+
/* @__PURE__ */ jsx25(
|
|
2379
2443
|
FollowControls,
|
|
2380
2444
|
{
|
|
2381
2445
|
grade: model.grade,
|
|
@@ -2397,7 +2461,7 @@ function FollowRead({
|
|
|
2397
2461
|
}
|
|
2398
2462
|
)
|
|
2399
2463
|
] }),
|
|
2400
|
-
model.demoFail ? /* @__PURE__ */
|
|
2464
|
+
model.demoFail ? /* @__PURE__ */ jsx25(FollowReadToast, { message: "\u8303\u8BFB\u52A0\u8F7D\u5931\u8D25 \xB7 \u53EF\u91CD\u8BD5 3 \u6B21" }) : null
|
|
2401
2465
|
]
|
|
2402
2466
|
}
|
|
2403
2467
|
);
|
|
@@ -2434,7 +2498,7 @@ function linkMatchActions({
|
|
|
2434
2498
|
}
|
|
2435
2499
|
|
|
2436
2500
|
// src/questions/link-match/feedback.tsx
|
|
2437
|
-
import { jsx as
|
|
2501
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2438
2502
|
function LinkMatchFeedback({
|
|
2439
2503
|
readonly,
|
|
2440
2504
|
phase,
|
|
@@ -2443,7 +2507,7 @@ function LinkMatchFeedback({
|
|
|
2443
2507
|
answerText
|
|
2444
2508
|
}) {
|
|
2445
2509
|
if (readonly) {
|
|
2446
|
-
return /* @__PURE__ */
|
|
2510
|
+
return /* @__PURE__ */ jsx26(
|
|
2447
2511
|
FeedbackSheet,
|
|
2448
2512
|
{
|
|
2449
2513
|
tone: "ok",
|
|
@@ -2455,13 +2519,13 @@ function LinkMatchFeedback({
|
|
|
2455
2519
|
);
|
|
2456
2520
|
}
|
|
2457
2521
|
if (phase === "retry") {
|
|
2458
|
-
return /* @__PURE__ */
|
|
2522
|
+
return /* @__PURE__ */ jsx26(FeedbackSheet, { tone: "warn", title: "\u6709\u8FDE\u9519\u7684\u7EBF\uFF0C\u518D\u8BD5\u4E00\u6B21", detail: "\u6B63\u786E\u7684\u8FDE\u7EBF\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
|
|
2459
2523
|
}
|
|
2460
2524
|
if (phase === "correct") {
|
|
2461
|
-
return /* @__PURE__ */
|
|
2525
|
+
return /* @__PURE__ */ jsx26(FeedbackSheet, { tone: "ok", title: labels.correctAll });
|
|
2462
2526
|
}
|
|
2463
2527
|
if (phase === "locked") {
|
|
2464
|
-
return /* @__PURE__ */
|
|
2528
|
+
return /* @__PURE__ */ jsx26(
|
|
2465
2529
|
FeedbackSheet,
|
|
2466
2530
|
{
|
|
2467
2531
|
tone: "bad",
|
|
@@ -2480,11 +2544,12 @@ function LinkMatchFeedback({
|
|
|
2480
2544
|
function pairKey(left, right) {
|
|
2481
2545
|
return `${left}-${right}`;
|
|
2482
2546
|
}
|
|
2483
|
-
function
|
|
2484
|
-
|
|
2485
|
-
if (!
|
|
2486
|
-
if (
|
|
2487
|
-
if (
|
|
2547
|
+
function nodeKind(node, legacyKind) {
|
|
2548
|
+
if (legacyKind) return legacyKind;
|
|
2549
|
+
if (!node) return "text";
|
|
2550
|
+
if (node.image || node.art) return "image";
|
|
2551
|
+
if (node.text !== void 0) return "text";
|
|
2552
|
+
if (node.audio) return "audio";
|
|
2488
2553
|
return "text";
|
|
2489
2554
|
}
|
|
2490
2555
|
function nodeLabel(node, kind, nodeIndex) {
|
|
@@ -2495,9 +2560,9 @@ function nodeLabel(node, kind, nodeIndex) {
|
|
|
2495
2560
|
if (kind === "audio") return `\u64AD\u653E\u97F3\u9891 ${nodeIndex + 1}`;
|
|
2496
2561
|
return typeof node.text === "string" ? node.text : void 0;
|
|
2497
2562
|
}
|
|
2498
|
-
function
|
|
2499
|
-
if (
|
|
2500
|
-
if (
|
|
2563
|
+
function boardKindOf(kinds) {
|
|
2564
|
+
if (kinds.includes("image")) return "image";
|
|
2565
|
+
if (kinds.includes("audio")) return "audio";
|
|
2501
2566
|
return "text";
|
|
2502
2567
|
}
|
|
2503
2568
|
function nodeOk(data, side, nodeIndex) {
|
|
@@ -2507,7 +2572,7 @@ function nodeOk(data, side, nodeIndex) {
|
|
|
2507
2572
|
}
|
|
2508
2573
|
|
|
2509
2574
|
// src/questions/link-match/link-node.tsx
|
|
2510
|
-
import {
|
|
2575
|
+
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2511
2576
|
var BARS = [8, 14, 20, 10, 24, 16, 9, 18, 12];
|
|
2512
2577
|
function LinkNode({
|
|
2513
2578
|
side,
|
|
@@ -2524,7 +2589,7 @@ function LinkNode({
|
|
|
2524
2589
|
}) {
|
|
2525
2590
|
var _a, _b;
|
|
2526
2591
|
const label = nodeLabel(node, kind, nodeIndex);
|
|
2527
|
-
return /* @__PURE__ */
|
|
2592
|
+
return /* @__PURE__ */ jsxs19(
|
|
2528
2593
|
"button",
|
|
2529
2594
|
{
|
|
2530
2595
|
type: "button",
|
|
@@ -2545,10 +2610,10 @@ function LinkNode({
|
|
|
2545
2610
|
"aria-pressed": picked,
|
|
2546
2611
|
"aria-label": label,
|
|
2547
2612
|
children: [
|
|
2548
|
-
side === "right" ? /* @__PURE__ */
|
|
2549
|
-
kind === "image" ? /* @__PURE__ */
|
|
2550
|
-
/* @__PURE__ */
|
|
2551
|
-
node.image ? /* @__PURE__ */
|
|
2613
|
+
side === "right" ? /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-marker", children: optionLetter(nodeIndex) }) : null,
|
|
2614
|
+
kind === "image" ? /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-media", children: [
|
|
2615
|
+
/* @__PURE__ */ jsx27("span", { className: "rqk-link-node-media-fallback", children: (_a = node.imageAlt) != null ? _a : typeof node.text === "string" ? node.text : "\u56FE\u7247" }),
|
|
2616
|
+
node.image ? /* @__PURE__ */ jsx27(
|
|
2552
2617
|
"img",
|
|
2553
2618
|
{
|
|
2554
2619
|
className: "rqk-link-node-image-media",
|
|
@@ -2558,31 +2623,31 @@ function LinkNode({
|
|
|
2558
2623
|
event.currentTarget.style.opacity = "0";
|
|
2559
2624
|
}
|
|
2560
2625
|
}
|
|
2561
|
-
) : node.art ? /* @__PURE__ */
|
|
2562
|
-
] }) : kind === "audio" ? /* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2564
|
-
/* @__PURE__ */
|
|
2565
|
-
] }) : /* @__PURE__ */
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
node.phonetic ? /* @__PURE__ */
|
|
2568
|
-
node.speak || node.audio ? /* @__PURE__ */ jsxs18("span", { className: "rqk-link-node-sound", "aria-hidden": true, children: [
|
|
2569
|
-
/* @__PURE__ */ jsx26("span", {}),
|
|
2570
|
-
/* @__PURE__ */ jsx26("span", {}),
|
|
2571
|
-
/* @__PURE__ */ jsx26("span", {})
|
|
2572
|
-
] }) : null
|
|
2626
|
+
) : node.art ? /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-art", children: /* @__PURE__ */ jsx27(Art, { name: node.art }) }) : null
|
|
2627
|
+
] }) : kind === "audio" ? /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-audio", children: [
|
|
2628
|
+
/* @__PURE__ */ jsx27("span", { className: "rqk-link-node-audio-icon", "aria-hidden": true, children: /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-audio-triangle" }) }),
|
|
2629
|
+
/* @__PURE__ */ jsx27("span", { className: "rqk-link-node-wave", "aria-hidden": true, children: BARS.map((height, barIndex) => /* @__PURE__ */ jsx27("span", { style: { height } }, barIndex)) })
|
|
2630
|
+
] }) : /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-text", children: [
|
|
2631
|
+
/* @__PURE__ */ jsx27("span", { className: "rqk-link-node-word", children: node.text }),
|
|
2632
|
+
node.phonetic ? /* @__PURE__ */ jsx27("span", { className: "rqk-link-node-sub", children: node.phonetic }) : null
|
|
2573
2633
|
] }),
|
|
2574
|
-
/* @__PURE__ */
|
|
2634
|
+
kind !== "audio" && node.audio ? /* @__PURE__ */ jsxs19("span", { className: "rqk-link-node-sound", "aria-hidden": true, children: [
|
|
2635
|
+
/* @__PURE__ */ jsx27("span", {}),
|
|
2636
|
+
/* @__PURE__ */ jsx27("span", {}),
|
|
2637
|
+
/* @__PURE__ */ jsx27("span", {})
|
|
2638
|
+
] }) : null,
|
|
2639
|
+
/* @__PURE__ */ jsx27("span", { className: "rqk-link-dot", "aria-hidden": true })
|
|
2575
2640
|
]
|
|
2576
2641
|
}
|
|
2577
2642
|
);
|
|
2578
2643
|
}
|
|
2579
2644
|
|
|
2580
2645
|
// src/questions/link-match/link-board.tsx
|
|
2581
|
-
import { jsx as
|
|
2646
|
+
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2582
2647
|
function LinkBoard({
|
|
2583
2648
|
data,
|
|
2584
|
-
|
|
2585
|
-
|
|
2649
|
+
leftKinds,
|
|
2650
|
+
rightKinds,
|
|
2586
2651
|
boardHeightKind,
|
|
2587
2652
|
boardRef,
|
|
2588
2653
|
leftRefs,
|
|
@@ -2596,7 +2661,7 @@ function LinkBoard({
|
|
|
2596
2661
|
readonly,
|
|
2597
2662
|
onNode
|
|
2598
2663
|
}) {
|
|
2599
|
-
return /* @__PURE__ */
|
|
2664
|
+
return /* @__PURE__ */ jsxs20(
|
|
2600
2665
|
"div",
|
|
2601
2666
|
{
|
|
2602
2667
|
className: classNames("rqk-link-board", `rqk-link-board-h-${boardHeightKind}`),
|
|
@@ -2604,7 +2669,7 @@ function LinkBoard({
|
|
|
2604
2669
|
boardRef.current = element;
|
|
2605
2670
|
},
|
|
2606
2671
|
children: [
|
|
2607
|
-
/* @__PURE__ */
|
|
2672
|
+
/* @__PURE__ */ jsx28("svg", { className: "rqk-link-lines", width: size.width, height: size.height, "aria-hidden": true, children: paths.map((path) => /* @__PURE__ */ jsx28(
|
|
2608
2673
|
"path",
|
|
2609
2674
|
{
|
|
2610
2675
|
d: path.d,
|
|
@@ -2617,18 +2682,16 @@ function LinkBoard({
|
|
|
2617
2682
|
path.key
|
|
2618
2683
|
)) }),
|
|
2619
2684
|
["left", "right"].map((side) => {
|
|
2620
|
-
const
|
|
2685
|
+
const kinds = side === "left" ? leftKinds : rightKinds;
|
|
2621
2686
|
const nodes = side === "left" ? data.left : data.right;
|
|
2622
2687
|
const refs = side === "left" ? leftRefs : rightRefs;
|
|
2623
|
-
return /* @__PURE__ */
|
|
2688
|
+
return /* @__PURE__ */ jsx28(
|
|
2624
2689
|
"div",
|
|
2625
2690
|
{
|
|
2626
|
-
className: classNames(
|
|
2627
|
-
"rqk-link-column",
|
|
2628
|
-
`rqk-link-column-${side}`,
|
|
2629
|
-
`rqk-link-column-${kind}`
|
|
2630
|
-
),
|
|
2691
|
+
className: classNames("rqk-link-column", `rqk-link-column-${side}`),
|
|
2631
2692
|
children: nodes.map((node, nodeIndex) => {
|
|
2693
|
+
var _a;
|
|
2694
|
+
const kind = (_a = kinds[nodeIndex]) != null ? _a : "text";
|
|
2632
2695
|
const linked = shownPairs.some(
|
|
2633
2696
|
([left, right]) => side === "left" ? left === nodeIndex : right === nodeIndex
|
|
2634
2697
|
);
|
|
@@ -2636,7 +2699,7 @@ function LinkBoard({
|
|
|
2636
2699
|
const isPlaying = (playing == null ? void 0 : playing.side) === side && playing.index === nodeIndex;
|
|
2637
2700
|
const correct = phase === "locked" || readonly ? nodeOk(data, side, nodeIndex) : false;
|
|
2638
2701
|
const wrong = phase === "locked" && side === "left" && !nodeOk(data, side, nodeIndex);
|
|
2639
|
-
return /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ jsx28(
|
|
2640
2703
|
LinkNode,
|
|
2641
2704
|
{
|
|
2642
2705
|
side,
|
|
@@ -2665,52 +2728,46 @@ function LinkBoard({
|
|
|
2665
2728
|
|
|
2666
2729
|
// src/questions/link-match/use-link-audio.ts
|
|
2667
2730
|
import { useEffect as useEffect9, useRef as useRef9, useState as useState12 } from "react";
|
|
2731
|
+
var MIN_PLAYING_MS = 500;
|
|
2668
2732
|
function useLinkAudio(data) {
|
|
2669
|
-
const config = useQuestConfig();
|
|
2670
2733
|
const [playing, setPlaying] = useState12(null);
|
|
2671
2734
|
const audioRef = useRef9(null);
|
|
2735
|
+
const playToken = useRef9(0);
|
|
2672
2736
|
const speakNode = (side, nodeIndex) => {
|
|
2673
|
-
var _a
|
|
2737
|
+
var _a;
|
|
2674
2738
|
const node = (side === "left" ? data.left : data.right)[nodeIndex];
|
|
2675
|
-
if (!node) return;
|
|
2739
|
+
if (!(node == null ? void 0 : node.audio)) return;
|
|
2740
|
+
const token = ++playToken.current;
|
|
2676
2741
|
(_a = audioRef.current) == null ? void 0 : _a.pause();
|
|
2677
2742
|
audioRef.current = null;
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2743
|
+
try {
|
|
2744
|
+
const audio = new Audio(node.audio);
|
|
2745
|
+
audioRef.current = audio;
|
|
2746
|
+
const startedAt = Date.now();
|
|
2747
|
+
const clear = (immediate = false) => {
|
|
2748
|
+
if (playToken.current !== token) return;
|
|
2749
|
+
const remaining = immediate ? 0 : Math.max(0, MIN_PLAYING_MS - (Date.now() - startedAt));
|
|
2750
|
+
window.setTimeout(() => {
|
|
2751
|
+
if (playToken.current !== token) return;
|
|
2683
2752
|
if (audioRef.current === audio) audioRef.current = null;
|
|
2684
2753
|
setPlaying(
|
|
2685
2754
|
(current) => (current == null ? void 0 : current.side) === side && current.index === nodeIndex ? null : current
|
|
2686
2755
|
);
|
|
2687
|
-
};
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
const played = audio.play();
|
|
2692
|
-
if (played && typeof played.catch === "function") void played.catch(clear);
|
|
2693
|
-
} catch (e) {
|
|
2694
|
-
setPlaying(null);
|
|
2695
|
-
}
|
|
2696
|
-
return;
|
|
2697
|
-
}
|
|
2698
|
-
if (node.speak) {
|
|
2699
|
-
const text = (_b = node.spokenText) != null ? _b : typeof node.text === "string" ? node.text : "";
|
|
2700
|
-
if (!text) return;
|
|
2756
|
+
}, remaining);
|
|
2757
|
+
};
|
|
2758
|
+
audio.onended = () => clear();
|
|
2759
|
+
audio.onerror = () => clear(true);
|
|
2701
2760
|
setPlaying({ side, index: nodeIndex });
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
} catch (e) {
|
|
2707
|
-
setPlaying(null);
|
|
2708
|
-
}
|
|
2761
|
+
const played = audio.play();
|
|
2762
|
+
if (played && typeof played.catch === "function") void played.catch(() => clear(true));
|
|
2763
|
+
} catch (e) {
|
|
2764
|
+
if (playToken.current === token) setPlaying(null);
|
|
2709
2765
|
}
|
|
2710
2766
|
};
|
|
2711
2767
|
useEffect9(
|
|
2712
2768
|
() => () => {
|
|
2713
2769
|
var _a;
|
|
2770
|
+
playToken.current += 1;
|
|
2714
2771
|
(_a = audioRef.current) == null ? void 0 : _a.pause();
|
|
2715
2772
|
audioRef.current = null;
|
|
2716
2773
|
},
|
|
@@ -2794,12 +2851,12 @@ function useLinkPairs({
|
|
|
2794
2851
|
onSubmit,
|
|
2795
2852
|
sound,
|
|
2796
2853
|
demoAttempt,
|
|
2797
|
-
leftKind,
|
|
2798
|
-
rightKind,
|
|
2799
2854
|
speakNode
|
|
2800
2855
|
}) {
|
|
2801
2856
|
var _a;
|
|
2802
2857
|
const readonly = isReadonly(mode);
|
|
2858
|
+
const totalPairs = Math.min(data.left.length, data.right.length);
|
|
2859
|
+
const hasAnswer = data.pairs.length > 0;
|
|
2803
2860
|
const expected = useMemo4(
|
|
2804
2861
|
() => new Set(data.pairs.map(([left, right]) => pairKey(left, right))),
|
|
2805
2862
|
[data.pairs]
|
|
@@ -2807,19 +2864,17 @@ function useLinkPairs({
|
|
|
2807
2864
|
const [pairs, setPairs] = useState14([]);
|
|
2808
2865
|
const [selection, setSelection] = useState14(null);
|
|
2809
2866
|
const judge = useJudge({
|
|
2810
|
-
evaluate: () => pairs.length ===
|
|
2867
|
+
evaluate: () => pairs.length === totalPairs && (!hasAnswer || pairs.every(([left, right]) => expected.has(pairKey(left, right)))),
|
|
2811
2868
|
onFirstWrong: () => setPairs((current) => current.filter(([left, right]) => expected.has(pairKey(left, right)))),
|
|
2812
2869
|
sound,
|
|
2813
2870
|
demoAttempt
|
|
2814
2871
|
});
|
|
2815
2872
|
const frozen = readonly || judge.phase === "correct" || judge.phase === "locked";
|
|
2816
2873
|
const shownPairs = readonly ? data.pairs : pairs;
|
|
2817
|
-
const complete = pairs.length ===
|
|
2874
|
+
const complete = pairs.length === totalPairs;
|
|
2818
2875
|
const handleNode = (side, nodeIndex) => {
|
|
2819
2876
|
const node = (side === "left" ? data.left : data.right)[nodeIndex];
|
|
2820
|
-
if (
|
|
2821
|
-
speakNode(side, nodeIndex);
|
|
2822
|
-
}
|
|
2877
|
+
if (node == null ? void 0 : node.audio) speakNode(side, nodeIndex);
|
|
2823
2878
|
if (frozen) return;
|
|
2824
2879
|
if (sound !== false) questSfx.tick();
|
|
2825
2880
|
const existing = pairs.find(
|
|
@@ -2870,15 +2925,13 @@ function useLinkPairs({
|
|
|
2870
2925
|
readonly,
|
|
2871
2926
|
selection,
|
|
2872
2927
|
shownPairs,
|
|
2873
|
-
pairs
|
|
2928
|
+
pairs,
|
|
2929
|
+
totalPairs
|
|
2874
2930
|
};
|
|
2875
2931
|
}
|
|
2876
|
-
function projectKind(side, leftKind, rightKind) {
|
|
2877
|
-
return side === "left" ? leftKind : rightKind;
|
|
2878
|
-
}
|
|
2879
2932
|
|
|
2880
2933
|
// src/questions/link-match/index.tsx
|
|
2881
|
-
import { Fragment as
|
|
2934
|
+
import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2882
2935
|
function LinkMatch({
|
|
2883
2936
|
data,
|
|
2884
2937
|
mode = "answer",
|
|
@@ -2894,11 +2947,10 @@ function LinkMatch({
|
|
|
2894
2947
|
demoAttempt,
|
|
2895
2948
|
className
|
|
2896
2949
|
}) {
|
|
2897
|
-
var _a, _b;
|
|
2898
2950
|
const labels = useQuestLabels();
|
|
2899
|
-
const
|
|
2900
|
-
const
|
|
2901
|
-
const boardHeightKind =
|
|
2951
|
+
const leftKinds = data.left.map((node) => nodeKind(node, data.leftKind));
|
|
2952
|
+
const rightKinds = data.right.map((node) => nodeKind(node, data.rightKind));
|
|
2953
|
+
const boardHeightKind = boardKindOf([...leftKinds, ...rightKinds]);
|
|
2902
2954
|
const audio = useLinkAudio(data);
|
|
2903
2955
|
const pairs = useLinkPairs({
|
|
2904
2956
|
data,
|
|
@@ -2906,8 +2958,6 @@ function LinkMatch({
|
|
|
2906
2958
|
onSubmit,
|
|
2907
2959
|
sound,
|
|
2908
2960
|
demoAttempt,
|
|
2909
|
-
leftKind,
|
|
2910
|
-
rightKind,
|
|
2911
2961
|
speakNode: audio.speakNode
|
|
2912
2962
|
});
|
|
2913
2963
|
const geometry = useLinkGeometry({
|
|
@@ -2922,12 +2972,12 @@ function LinkMatch({
|
|
|
2922
2972
|
labels,
|
|
2923
2973
|
complete: pairs.complete,
|
|
2924
2974
|
pairCount: pairs.pairs.length,
|
|
2925
|
-
totalPairs:
|
|
2975
|
+
totalPairs: pairs.totalPairs,
|
|
2926
2976
|
onNext,
|
|
2927
2977
|
onSubmit: pairs.handleSubmit,
|
|
2928
2978
|
onRetry: pairs.judge.retry
|
|
2929
2979
|
});
|
|
2930
|
-
return /* @__PURE__ */
|
|
2980
|
+
return /* @__PURE__ */ jsx29(
|
|
2931
2981
|
QuestShell,
|
|
2932
2982
|
{
|
|
2933
2983
|
mode,
|
|
@@ -2938,7 +2988,7 @@ function LinkMatch({
|
|
|
2938
2988
|
onBack,
|
|
2939
2989
|
className: classNames("rqk-quest", className),
|
|
2940
2990
|
dataQuest: "link-match",
|
|
2941
|
-
feedback: /* @__PURE__ */
|
|
2991
|
+
feedback: /* @__PURE__ */ jsx29(
|
|
2942
2992
|
LinkMatchFeedback,
|
|
2943
2993
|
{
|
|
2944
2994
|
readonly: pairs.readonly,
|
|
@@ -2948,15 +2998,15 @@ function LinkMatch({
|
|
|
2948
2998
|
answerText: pairs.answerText
|
|
2949
2999
|
}
|
|
2950
3000
|
),
|
|
2951
|
-
footer: /* @__PURE__ */
|
|
2952
|
-
children: /* @__PURE__ */
|
|
2953
|
-
data.hint ? /* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
3001
|
+
footer: /* @__PURE__ */ jsx29(ActionBar, { actions, index, total, onPrev }),
|
|
3002
|
+
children: /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
3003
|
+
data.hint ? /* @__PURE__ */ jsx29("div", { className: "rqk-link-hint", children: data.hint }) : null,
|
|
3004
|
+
/* @__PURE__ */ jsx29(
|
|
2955
3005
|
LinkBoard,
|
|
2956
3006
|
{
|
|
2957
3007
|
data,
|
|
2958
|
-
|
|
2959
|
-
|
|
3008
|
+
leftKinds,
|
|
3009
|
+
rightKinds,
|
|
2960
3010
|
boardHeightKind,
|
|
2961
3011
|
boardRef: geometry.boardRef,
|
|
2962
3012
|
leftRefs: geometry.leftRefs,
|
|
@@ -3000,7 +3050,7 @@ function rearrangeActions({
|
|
|
3000
3050
|
}
|
|
3001
3051
|
|
|
3002
3052
|
// src/questions/rearrange/feedback.tsx
|
|
3003
|
-
import { jsx as
|
|
3053
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3004
3054
|
function RearrangeFeedback({
|
|
3005
3055
|
readonly,
|
|
3006
3056
|
phase,
|
|
@@ -3009,7 +3059,7 @@ function RearrangeFeedback({
|
|
|
3009
3059
|
answerText
|
|
3010
3060
|
}) {
|
|
3011
3061
|
if (readonly) {
|
|
3012
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ jsx30(
|
|
3013
3063
|
FeedbackSheet,
|
|
3014
3064
|
{
|
|
3015
3065
|
tone: "ok",
|
|
@@ -3021,7 +3071,7 @@ function RearrangeFeedback({
|
|
|
3021
3071
|
);
|
|
3022
3072
|
}
|
|
3023
3073
|
if (phase === "retry") {
|
|
3024
|
-
return /* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ jsx30(
|
|
3025
3075
|
FeedbackSheet,
|
|
3026
3076
|
{
|
|
3027
3077
|
tone: "warn",
|
|
@@ -3031,10 +3081,10 @@ function RearrangeFeedback({
|
|
|
3031
3081
|
);
|
|
3032
3082
|
}
|
|
3033
3083
|
if (phase === "correct") {
|
|
3034
|
-
return /* @__PURE__ */
|
|
3084
|
+
return /* @__PURE__ */ jsx30(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
|
|
3035
3085
|
}
|
|
3036
3086
|
if (phase === "locked") {
|
|
3037
|
-
return /* @__PURE__ */
|
|
3087
|
+
return /* @__PURE__ */ jsx30(
|
|
3038
3088
|
FeedbackSheet,
|
|
3039
3089
|
{
|
|
3040
3090
|
tone: "bad",
|
|
@@ -3050,7 +3100,7 @@ function RearrangeFeedback({
|
|
|
3050
3100
|
}
|
|
3051
3101
|
|
|
3052
3102
|
// src/primitives/word-chip.tsx
|
|
3053
|
-
import { jsx as
|
|
3103
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3054
3104
|
function WordChip({
|
|
3055
3105
|
children,
|
|
3056
3106
|
onClick,
|
|
@@ -3061,7 +3111,7 @@ function WordChip({
|
|
|
3061
3111
|
className,
|
|
3062
3112
|
ariaLabel
|
|
3063
3113
|
}) {
|
|
3064
|
-
return /* @__PURE__ */
|
|
3114
|
+
return /* @__PURE__ */ jsxs22(
|
|
3065
3115
|
"button",
|
|
3066
3116
|
{
|
|
3067
3117
|
type: "button",
|
|
@@ -3076,14 +3126,14 @@ function WordChip({
|
|
|
3076
3126
|
"aria-label": ariaLabel,
|
|
3077
3127
|
children: [
|
|
3078
3128
|
children,
|
|
3079
|
-
removable ? /* @__PURE__ */
|
|
3129
|
+
removable ? /* @__PURE__ */ jsx31(CrossIcon, { className: "rqk-chip-remove", size: 14 }) : null
|
|
3080
3130
|
]
|
|
3081
3131
|
}
|
|
3082
3132
|
);
|
|
3083
3133
|
}
|
|
3084
3134
|
|
|
3085
3135
|
// src/questions/rearrange/bank-card.tsx
|
|
3086
|
-
import { jsx as
|
|
3136
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3087
3137
|
function RearrangeBank({
|
|
3088
3138
|
data,
|
|
3089
3139
|
bank,
|
|
@@ -3091,11 +3141,11 @@ function RearrangeBank({
|
|
|
3091
3141
|
tileUsed,
|
|
3092
3142
|
onPick
|
|
3093
3143
|
}) {
|
|
3094
|
-
return /* @__PURE__ */
|
|
3095
|
-
/* @__PURE__ */
|
|
3096
|
-
/* @__PURE__ */
|
|
3144
|
+
return /* @__PURE__ */ jsxs23(Card, { className: "rqk-rearrange-bank", children: [
|
|
3145
|
+
/* @__PURE__ */ jsx32("div", { className: "rqk-rearrange-bank-label", children: data.kind === "word" ? "\u53EF\u9009\u5B57\u6BCD" : "\u53EF\u9009\u5355\u8BCD" }),
|
|
3146
|
+
/* @__PURE__ */ jsx32("div", { className: "rqk-rearrange-tiles", children: bank.map((tile, tileIndex) => {
|
|
3097
3147
|
const used = tileUsed(tile);
|
|
3098
|
-
return /* @__PURE__ */
|
|
3148
|
+
return /* @__PURE__ */ jsx32(
|
|
3099
3149
|
WordChip,
|
|
3100
3150
|
{
|
|
3101
3151
|
variant: data.kind === "word" ? "letter" : "bank",
|
|
@@ -3111,7 +3161,7 @@ function RearrangeBank({
|
|
|
3111
3161
|
}
|
|
3112
3162
|
|
|
3113
3163
|
// src/questions/rearrange/slots-card.tsx
|
|
3114
|
-
import { jsx as
|
|
3164
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3115
3165
|
function RearrangeSlots({
|
|
3116
3166
|
data,
|
|
3117
3167
|
slots,
|
|
@@ -3121,15 +3171,15 @@ function RearrangeSlots({
|
|
|
3121
3171
|
isSlotOk,
|
|
3122
3172
|
onSlot
|
|
3123
3173
|
}) {
|
|
3124
|
-
return /* @__PURE__ */
|
|
3125
|
-
data.hint ? /* @__PURE__ */
|
|
3174
|
+
return /* @__PURE__ */ jsxs24(Card, { className: "rqk-rearrange-slots", children: [
|
|
3175
|
+
data.hint ? /* @__PURE__ */ jsxs24("div", { className: "rqk-rearrange-hint", children: [
|
|
3126
3176
|
"\u63D0\u793A\uFF1A",
|
|
3127
3177
|
data.hint
|
|
3128
3178
|
] }) : null,
|
|
3129
3179
|
slots.map((slot, slotIndex) => {
|
|
3130
3180
|
const value = slot.holder ? slot.char : filled[slotIndex];
|
|
3131
3181
|
const current = !slot.holder && !value && cursor === slotIndex;
|
|
3132
|
-
return /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ jsxs24(
|
|
3133
3183
|
"button",
|
|
3134
3184
|
{
|
|
3135
3185
|
type: "button",
|
|
@@ -3145,7 +3195,7 @@ function RearrangeSlots({
|
|
|
3145
3195
|
disabled: slot.holder,
|
|
3146
3196
|
children: [
|
|
3147
3197
|
value,
|
|
3148
|
-
current ? /* @__PURE__ */
|
|
3198
|
+
current ? /* @__PURE__ */ jsx33("span", { className: "rqk-rearrange-caret" }) : null
|
|
3149
3199
|
]
|
|
3150
3200
|
},
|
|
3151
3201
|
slotIndex
|
|
@@ -3155,7 +3205,7 @@ function RearrangeSlots({
|
|
|
3155
3205
|
}
|
|
3156
3206
|
|
|
3157
3207
|
// src/questions/rearrange/rearrange-page.tsx
|
|
3158
|
-
import { Fragment as
|
|
3208
|
+
import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3159
3209
|
function RearrangePage({
|
|
3160
3210
|
data,
|
|
3161
3211
|
slots,
|
|
@@ -3169,8 +3219,8 @@ function RearrangePage({
|
|
|
3169
3219
|
onSlot,
|
|
3170
3220
|
onPick
|
|
3171
3221
|
}) {
|
|
3172
|
-
return /* @__PURE__ */
|
|
3173
|
-
/* @__PURE__ */
|
|
3222
|
+
return /* @__PURE__ */ jsxs25(Fragment6, { children: [
|
|
3223
|
+
/* @__PURE__ */ jsx34(
|
|
3174
3224
|
RearrangeSlots,
|
|
3175
3225
|
{
|
|
3176
3226
|
data,
|
|
@@ -3182,7 +3232,7 @@ function RearrangePage({
|
|
|
3182
3232
|
onSlot
|
|
3183
3233
|
}
|
|
3184
3234
|
),
|
|
3185
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ jsx34(RearrangeBank, { data, bank, frozen, tileUsed, onPick })
|
|
3186
3236
|
] });
|
|
3187
3237
|
}
|
|
3188
3238
|
|
|
@@ -3362,7 +3412,7 @@ function useRearrange({
|
|
|
3362
3412
|
}
|
|
3363
3413
|
|
|
3364
3414
|
// src/questions/rearrange/index.tsx
|
|
3365
|
-
import { Fragment as
|
|
3415
|
+
import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3366
3416
|
function Rearrange({
|
|
3367
3417
|
data,
|
|
3368
3418
|
mode = "answer",
|
|
@@ -3388,26 +3438,26 @@ function Rearrange({
|
|
|
3388
3438
|
onSubmit: model.handleSubmit,
|
|
3389
3439
|
onRetry: model.judge.retry
|
|
3390
3440
|
});
|
|
3391
|
-
return /* @__PURE__ */
|
|
3441
|
+
return /* @__PURE__ */ jsx35(
|
|
3392
3442
|
QuestShell,
|
|
3393
3443
|
{
|
|
3394
3444
|
mode,
|
|
3395
3445
|
title: title != null ? title : data.kind === "word" ? "\u5355\u8BCD\u91CD\u7EC4" : "\u53E5\u5B50\u91CD\u7EC4",
|
|
3396
3446
|
index,
|
|
3397
3447
|
total,
|
|
3398
|
-
instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */
|
|
3448
|
+
instruction: instruction != null ? instruction : data.kind === "word" ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
3399
3449
|
"\u6309\u5B57\u6BCD\u987A\u5E8F\u586B\u5165",
|
|
3400
|
-
/* @__PURE__ */
|
|
3450
|
+
/* @__PURE__ */ jsx35("b", { children: "\u6A2A\u7EBF" }),
|
|
3401
3451
|
"\uFF0C\u62FC\u51FA\u5355\u8BCD"
|
|
3402
|
-
] }) : /* @__PURE__ */
|
|
3452
|
+
] }) : /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
3403
3453
|
"\u6309\u6B63\u786E\u987A\u5E8F\u628A\u8BCD\u5757\u586B\u5165",
|
|
3404
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ jsx35("b", { children: "\u6A2A\u7EBF" }),
|
|
3405
3455
|
"\uFF0C\u62FC\u51FA\u53E5\u5B50"
|
|
3406
3456
|
] }),
|
|
3407
3457
|
onBack,
|
|
3408
3458
|
className: classNames("rqk-quest", "rqk-rearrange", className),
|
|
3409
3459
|
dataQuest: "rearrange",
|
|
3410
|
-
feedback: /* @__PURE__ */
|
|
3460
|
+
feedback: /* @__PURE__ */ jsx35(
|
|
3411
3461
|
RearrangeFeedback,
|
|
3412
3462
|
{
|
|
3413
3463
|
readonly: model.readonly,
|
|
@@ -3417,8 +3467,8 @@ function Rearrange({
|
|
|
3417
3467
|
answerText: targetAnswerText(data)
|
|
3418
3468
|
}
|
|
3419
3469
|
),
|
|
3420
|
-
footer: /* @__PURE__ */
|
|
3421
|
-
children: /* @__PURE__ */
|
|
3470
|
+
footer: /* @__PURE__ */ jsx35(ActionBar, { actions, index, total, onPrev }),
|
|
3471
|
+
children: /* @__PURE__ */ jsx35(
|
|
3422
3472
|
RearrangePage,
|
|
3423
3473
|
{
|
|
3424
3474
|
data,
|
|
@@ -3462,20 +3512,20 @@ function classifyActions({
|
|
|
3462
3512
|
}
|
|
3463
3513
|
|
|
3464
3514
|
// src/questions/classify/bank-card.tsx
|
|
3465
|
-
import { jsx as
|
|
3515
|
+
import { jsx as jsx36, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3466
3516
|
function ClassifyBank({
|
|
3467
3517
|
data,
|
|
3468
3518
|
remaining,
|
|
3469
3519
|
frozen,
|
|
3470
3520
|
onPick
|
|
3471
3521
|
}) {
|
|
3472
|
-
return /* @__PURE__ */
|
|
3473
|
-
/* @__PURE__ */
|
|
3522
|
+
return /* @__PURE__ */ jsxs27(Card, { className: "rqk-classify-bank", children: [
|
|
3523
|
+
/* @__PURE__ */ jsxs27("div", { className: "rqk-classify-bank-label", children: [
|
|
3474
3524
|
"\u5F85\u5206\u7C7B \xB7 \u5269\u4F59 ",
|
|
3475
3525
|
remaining.length,
|
|
3476
3526
|
" \u9879"
|
|
3477
3527
|
] }),
|
|
3478
|
-
/* @__PURE__ */
|
|
3528
|
+
/* @__PURE__ */ jsx36("div", { className: "rqk-classify-bank-items", children: remaining.length ? remaining.map((itemIndex) => /* @__PURE__ */ jsx36(
|
|
3479
3529
|
WordChip,
|
|
3480
3530
|
{
|
|
3481
3531
|
variant: "bank",
|
|
@@ -3484,12 +3534,12 @@ function ClassifyBank({
|
|
|
3484
3534
|
children: data.items[itemIndex].text
|
|
3485
3535
|
},
|
|
3486
3536
|
itemIndex
|
|
3487
|
-
)) : /* @__PURE__ */
|
|
3537
|
+
)) : /* @__PURE__ */ jsx36("span", { className: "rqk-classify-empty", children: "\u5DF2\u5168\u90E8\u5F52\u7C7B" }) })
|
|
3488
3538
|
] });
|
|
3489
3539
|
}
|
|
3490
3540
|
|
|
3491
3541
|
// src/questions/classify/category-card.tsx
|
|
3492
|
-
import { jsx as
|
|
3542
|
+
import { jsx as jsx37, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3493
3543
|
function ClassifyCategory({
|
|
3494
3544
|
categoryIndex,
|
|
3495
3545
|
category,
|
|
@@ -3503,7 +3553,7 @@ function ClassifyCategory({
|
|
|
3503
3553
|
}) {
|
|
3504
3554
|
const items = data.items.map((_item, itemIndex) => placed[itemIndex] === categoryIndex ? itemIndex : null).filter((itemIndex) => itemIndex !== null);
|
|
3505
3555
|
const focused = !frozen && current === categoryIndex;
|
|
3506
|
-
return /* @__PURE__ */
|
|
3556
|
+
return /* @__PURE__ */ jsxs28(
|
|
3507
3557
|
"div",
|
|
3508
3558
|
{
|
|
3509
3559
|
className: classNames("rqk-card", "rqk-classify-cat", focused && "rqk-is-selected"),
|
|
@@ -3517,20 +3567,20 @@ function ClassifyCategory({
|
|
|
3517
3567
|
role: "button",
|
|
3518
3568
|
tabIndex: frozen ? -1 : 0,
|
|
3519
3569
|
children: [
|
|
3520
|
-
/* @__PURE__ */
|
|
3521
|
-
/* @__PURE__ */
|
|
3570
|
+
/* @__PURE__ */ jsxs28("div", { className: "rqk-classify-cat-head", children: [
|
|
3571
|
+
/* @__PURE__ */ jsxs28("span", { className: "rqk-classify-cat-name", children: [
|
|
3522
3572
|
category.label,
|
|
3523
|
-
category.sub ? /* @__PURE__ */
|
|
3573
|
+
category.sub ? /* @__PURE__ */ jsx37("em", { className: "rqk-classify-cat-sub", children: category.sub }) : null
|
|
3524
3574
|
] }),
|
|
3525
|
-
/* @__PURE__ */
|
|
3575
|
+
/* @__PURE__ */ jsxs28("span", { className: "rqk-classify-cat-count", children: [
|
|
3526
3576
|
items.length,
|
|
3527
3577
|
" \u9879"
|
|
3528
3578
|
] })
|
|
3529
3579
|
] }),
|
|
3530
|
-
/* @__PURE__ */
|
|
3580
|
+
/* @__PURE__ */ jsx37("div", { className: "rqk-classify-cat-body", children: items.length ? items.map((itemIndex) => {
|
|
3531
3581
|
const item = data.items[itemIndex];
|
|
3532
3582
|
const slotOk = placed[itemIndex] === item.category;
|
|
3533
|
-
return /* @__PURE__ */
|
|
3583
|
+
return /* @__PURE__ */ jsx37(
|
|
3534
3584
|
WordChip,
|
|
3535
3585
|
{
|
|
3536
3586
|
variant: "placed",
|
|
@@ -3545,14 +3595,14 @@ function ClassifyCategory({
|
|
|
3545
3595
|
},
|
|
3546
3596
|
itemIndex
|
|
3547
3597
|
);
|
|
3548
|
-
}) : /* @__PURE__ */
|
|
3598
|
+
}) : /* @__PURE__ */ jsx37("span", { className: "rqk-classify-empty", children: "\u70B9\u51FB\u9009\u9879\u653E\u5165\u8FD9\u4E00\u7C7B" }) })
|
|
3549
3599
|
]
|
|
3550
3600
|
}
|
|
3551
3601
|
);
|
|
3552
3602
|
}
|
|
3553
3603
|
|
|
3554
3604
|
// src/questions/classify/classify-page.tsx
|
|
3555
|
-
import { Fragment as
|
|
3605
|
+
import { Fragment as Fragment8, jsx as jsx38, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3556
3606
|
function ClassifyPage({
|
|
3557
3607
|
data,
|
|
3558
3608
|
placed,
|
|
@@ -3564,8 +3614,8 @@ function ClassifyPage({
|
|
|
3564
3614
|
onUnplace,
|
|
3565
3615
|
onPick
|
|
3566
3616
|
}) {
|
|
3567
|
-
return /* @__PURE__ */
|
|
3568
|
-
data.categories.map((category, categoryIndex) => /* @__PURE__ */
|
|
3617
|
+
return /* @__PURE__ */ jsxs29(Fragment8, { children: [
|
|
3618
|
+
data.categories.map((category, categoryIndex) => /* @__PURE__ */ jsx38(
|
|
3569
3619
|
ClassifyCategory,
|
|
3570
3620
|
{
|
|
3571
3621
|
categoryIndex,
|
|
@@ -3580,12 +3630,12 @@ function ClassifyPage({
|
|
|
3580
3630
|
},
|
|
3581
3631
|
categoryIndex
|
|
3582
3632
|
)),
|
|
3583
|
-
/* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ jsx38(ClassifyBank, { data, remaining, frozen, onPick })
|
|
3584
3634
|
] });
|
|
3585
3635
|
}
|
|
3586
3636
|
|
|
3587
3637
|
// src/questions/classify/feedback.tsx
|
|
3588
|
-
import { jsx as
|
|
3638
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3589
3639
|
function ClassifyFeedback({
|
|
3590
3640
|
readonly,
|
|
3591
3641
|
phase,
|
|
@@ -3594,7 +3644,7 @@ function ClassifyFeedback({
|
|
|
3594
3644
|
answerText
|
|
3595
3645
|
}) {
|
|
3596
3646
|
if (readonly) {
|
|
3597
|
-
return /* @__PURE__ */
|
|
3647
|
+
return /* @__PURE__ */ jsx39(
|
|
3598
3648
|
FeedbackSheet,
|
|
3599
3649
|
{
|
|
3600
3650
|
tone: "ok",
|
|
@@ -3606,13 +3656,13 @@ function ClassifyFeedback({
|
|
|
3606
3656
|
);
|
|
3607
3657
|
}
|
|
3608
3658
|
if (phase === "retry") {
|
|
3609
|
-
return /* @__PURE__ */
|
|
3659
|
+
return /* @__PURE__ */ jsx39(FeedbackSheet, { tone: "warn", title: "\u6709\u653E\u9519\u7C7B\u522B\u7684\u5355\u8BCD", detail: "\u5206\u7C7B\u6B63\u786E\u7684\u5355\u8BCD\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
|
|
3610
3660
|
}
|
|
3611
3661
|
if (phase === "correct") {
|
|
3612
|
-
return /* @__PURE__ */
|
|
3662
|
+
return /* @__PURE__ */ jsx39(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
|
|
3613
3663
|
}
|
|
3614
3664
|
if (phase === "locked") {
|
|
3615
|
-
return /* @__PURE__ */
|
|
3665
|
+
return /* @__PURE__ */ jsx39(
|
|
3616
3666
|
FeedbackSheet,
|
|
3617
3667
|
{
|
|
3618
3668
|
tone: "bad",
|
|
@@ -3710,7 +3760,7 @@ function useClassify({
|
|
|
3710
3760
|
}
|
|
3711
3761
|
|
|
3712
3762
|
// src/questions/classify/index.tsx
|
|
3713
|
-
import { Fragment as
|
|
3763
|
+
import { Fragment as Fragment9, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3714
3764
|
function Classify({
|
|
3715
3765
|
data,
|
|
3716
3766
|
mode = "answer",
|
|
@@ -3736,21 +3786,21 @@ function Classify({
|
|
|
3736
3786
|
onSubmit: model.handleSubmit,
|
|
3737
3787
|
onRetry: model.judge.retry
|
|
3738
3788
|
});
|
|
3739
|
-
return /* @__PURE__ */
|
|
3789
|
+
return /* @__PURE__ */ jsx40(
|
|
3740
3790
|
QuestShell,
|
|
3741
3791
|
{
|
|
3742
3792
|
mode,
|
|
3743
3793
|
title: title != null ? title : "\u5206\u7C7B\u9898",
|
|
3744
3794
|
index,
|
|
3745
3795
|
total,
|
|
3746
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */
|
|
3796
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
3747
3797
|
"\u628A\u5355\u8BCD\u70B9\u9009\u5230",
|
|
3748
|
-
/* @__PURE__ */
|
|
3798
|
+
/* @__PURE__ */ jsx40("b", { children: "\u6B63\u786E\u7684\u7C7B\u522B" })
|
|
3749
3799
|
] }),
|
|
3750
3800
|
onBack,
|
|
3751
3801
|
className: classNames("rqk-quest", "rqk-classify", className),
|
|
3752
3802
|
dataQuest: "classify",
|
|
3753
|
-
feedback: /* @__PURE__ */
|
|
3803
|
+
feedback: /* @__PURE__ */ jsx40(
|
|
3754
3804
|
ClassifyFeedback,
|
|
3755
3805
|
{
|
|
3756
3806
|
readonly: model.readonly,
|
|
@@ -3760,8 +3810,8 @@ function Classify({
|
|
|
3760
3810
|
answerText: model.answerText
|
|
3761
3811
|
}
|
|
3762
3812
|
),
|
|
3763
|
-
footer: /* @__PURE__ */
|
|
3764
|
-
children: /* @__PURE__ */
|
|
3813
|
+
footer: /* @__PURE__ */ jsx40(ActionBar, { actions, index, total, onPrev }),
|
|
3814
|
+
children: /* @__PURE__ */ jsx40(
|
|
3765
3815
|
ClassifyPage,
|
|
3766
3816
|
{
|
|
3767
3817
|
data,
|
|
@@ -3809,7 +3859,7 @@ function rewriteActions({
|
|
|
3809
3859
|
}
|
|
3810
3860
|
|
|
3811
3861
|
// src/questions/rewrite/answer-card.tsx
|
|
3812
|
-
import { jsx as
|
|
3862
|
+
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3813
3863
|
function RewriteAnswerCard({
|
|
3814
3864
|
data,
|
|
3815
3865
|
value,
|
|
@@ -3821,12 +3871,12 @@ function RewriteAnswerCard({
|
|
|
3821
3871
|
showAnswers
|
|
3822
3872
|
}) {
|
|
3823
3873
|
var _a, _b;
|
|
3824
|
-
return /* @__PURE__ */
|
|
3825
|
-
/* @__PURE__ */
|
|
3826
|
-
/* @__PURE__ */
|
|
3874
|
+
return /* @__PURE__ */ jsxs31(Card, { className: "rqk-rewrite-card", children: [
|
|
3875
|
+
/* @__PURE__ */ jsxs31("div", { className: "rqk-rewrite-stem", children: [
|
|
3876
|
+
/* @__PURE__ */ jsx41("span", { className: "rqk-rewrite-badge", children: "\u539F\u53E5" }),
|
|
3827
3877
|
data.stem
|
|
3828
3878
|
] }),
|
|
3829
|
-
/* @__PURE__ */
|
|
3879
|
+
/* @__PURE__ */ jsx41(
|
|
3830
3880
|
"textarea",
|
|
3831
3881
|
{
|
|
3832
3882
|
ref: (element) => {
|
|
@@ -3846,12 +3896,12 @@ function RewriteAnswerCard({
|
|
|
3846
3896
|
disabled: readonly || phase === "locked"
|
|
3847
3897
|
}
|
|
3848
3898
|
),
|
|
3849
|
-
showAnswers ? /* @__PURE__ */
|
|
3899
|
+
showAnswers ? /* @__PURE__ */ jsx41("div", { className: "rqk-rewrite-answers", children: data.answers.map((answer, answerIndex2) => /* @__PURE__ */ jsx41("span", { className: "rqk-rewrite-answer-chip", children: answer }, answerIndex2)) }) : null
|
|
3850
3900
|
] });
|
|
3851
3901
|
}
|
|
3852
3902
|
|
|
3853
3903
|
// src/questions/rewrite/feedback.tsx
|
|
3854
|
-
import { jsx as
|
|
3904
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3855
3905
|
function RewriteFeedback({
|
|
3856
3906
|
readonly,
|
|
3857
3907
|
phase,
|
|
@@ -3859,7 +3909,7 @@ function RewriteFeedback({
|
|
|
3859
3909
|
labels
|
|
3860
3910
|
}) {
|
|
3861
3911
|
if (readonly) {
|
|
3862
|
-
return /* @__PURE__ */
|
|
3912
|
+
return /* @__PURE__ */ jsx42(
|
|
3863
3913
|
FeedbackSheet,
|
|
3864
3914
|
{
|
|
3865
3915
|
tone: "ok",
|
|
@@ -3871,13 +3921,13 @@ function RewriteFeedback({
|
|
|
3871
3921
|
);
|
|
3872
3922
|
}
|
|
3873
3923
|
if (phase === "retry") {
|
|
3874
|
-
return /* @__PURE__ */
|
|
3924
|
+
return /* @__PURE__ */ jsx42(FeedbackSheet, { tone: "warn", title: "\u518D\u68C0\u67E5\u4E00\u4E0B\u8BED\u5E8F\u4E0E\u65F6\u6001", detail: "\u6CE8\u610F\u4FDD\u6301\u539F\u53E5\u7684\u4EBA\u79F0\u548C\u65F6\u6001" });
|
|
3875
3925
|
}
|
|
3876
3926
|
if (phase === "correct") {
|
|
3877
|
-
return /* @__PURE__ */
|
|
3927
|
+
return /* @__PURE__ */ jsx42(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: data.answers[0] });
|
|
3878
3928
|
}
|
|
3879
3929
|
if (phase === "locked") {
|
|
3880
|
-
return /* @__PURE__ */
|
|
3930
|
+
return /* @__PURE__ */ jsx42(
|
|
3881
3931
|
FeedbackSheet,
|
|
3882
3932
|
{
|
|
3883
3933
|
tone: "bad",
|
|
@@ -3893,10 +3943,10 @@ function RewriteFeedback({
|
|
|
3893
3943
|
}
|
|
3894
3944
|
|
|
3895
3945
|
// src/questions/rewrite/kb-hint.tsx
|
|
3896
|
-
import { jsx as
|
|
3946
|
+
import { jsx as jsx43, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3897
3947
|
function RewriteKbHint({ text }) {
|
|
3898
|
-
return /* @__PURE__ */
|
|
3899
|
-
/* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ jsxs32("div", { className: "rqk-tx-kb-hint", children: [
|
|
3949
|
+
/* @__PURE__ */ jsx43(KeyboardIcon, {}),
|
|
3900
3950
|
text
|
|
3901
3951
|
] });
|
|
3902
3952
|
}
|
|
@@ -3958,7 +4008,7 @@ function useRewrite({
|
|
|
3958
4008
|
}
|
|
3959
4009
|
|
|
3960
4010
|
// src/questions/rewrite/index.tsx
|
|
3961
|
-
import { Fragment as
|
|
4011
|
+
import { Fragment as Fragment10, jsx as jsx44, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3962
4012
|
function Rewrite({
|
|
3963
4013
|
data,
|
|
3964
4014
|
mode = "answer",
|
|
@@ -3985,7 +4035,7 @@ function Rewrite({
|
|
|
3985
4035
|
onSubmit: model.handleSubmit,
|
|
3986
4036
|
onRetry: model.judge.retry
|
|
3987
4037
|
});
|
|
3988
|
-
return /* @__PURE__ */
|
|
4038
|
+
return /* @__PURE__ */ jsx44(
|
|
3989
4039
|
QuestShell,
|
|
3990
4040
|
{
|
|
3991
4041
|
mode,
|
|
@@ -3996,7 +4046,7 @@ function Rewrite({
|
|
|
3996
4046
|
onBack,
|
|
3997
4047
|
className: classNames("rqk-quest", "rqk-rewrite", className),
|
|
3998
4048
|
dataQuest: "rewrite",
|
|
3999
|
-
feedback: /* @__PURE__ */
|
|
4049
|
+
feedback: /* @__PURE__ */ jsx44(
|
|
4000
4050
|
RewriteFeedback,
|
|
4001
4051
|
{
|
|
4002
4052
|
readonly: model.readonly,
|
|
@@ -4005,9 +4055,9 @@ function Rewrite({
|
|
|
4005
4055
|
labels: model.labels
|
|
4006
4056
|
}
|
|
4007
4057
|
),
|
|
4008
|
-
footer: /* @__PURE__ */
|
|
4009
|
-
children: /* @__PURE__ */
|
|
4010
|
-
/* @__PURE__ */
|
|
4058
|
+
footer: /* @__PURE__ */ jsx44(ActionBar, { actions, index, total, onPrev }),
|
|
4059
|
+
children: /* @__PURE__ */ jsxs33(Fragment10, { children: [
|
|
4060
|
+
/* @__PURE__ */ jsx44(
|
|
4011
4061
|
RewriteAnswerCard,
|
|
4012
4062
|
{
|
|
4013
4063
|
data,
|
|
@@ -4020,7 +4070,7 @@ function Rewrite({
|
|
|
4020
4070
|
showAnswers: model.showAnswers
|
|
4021
4071
|
}
|
|
4022
4072
|
),
|
|
4023
|
-
!model.readonly && !model.graded ? /* @__PURE__ */
|
|
4073
|
+
!model.readonly && !model.graded ? /* @__PURE__ */ jsx44(RewriteKbHint, { text: "\u70B9\u51FB\u8F93\u5165\u6846\uFF0C\u7CFB\u7EDF\u952E\u76D8\u81EA\u52A8\u5F39\u51FA" }) : null
|
|
4024
4074
|
] })
|
|
4025
4075
|
}
|
|
4026
4076
|
);
|
|
@@ -4051,7 +4101,7 @@ function fillBlankActions({
|
|
|
4051
4101
|
}
|
|
4052
4102
|
|
|
4053
4103
|
// src/questions/fill-blank/feedback.tsx
|
|
4054
|
-
import { jsx as
|
|
4104
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4055
4105
|
function FillBlankFeedback({
|
|
4056
4106
|
readonly,
|
|
4057
4107
|
phase,
|
|
@@ -4060,7 +4110,7 @@ function FillBlankFeedback({
|
|
|
4060
4110
|
answerText
|
|
4061
4111
|
}) {
|
|
4062
4112
|
if (readonly) {
|
|
4063
|
-
return /* @__PURE__ */
|
|
4113
|
+
return /* @__PURE__ */ jsx45(
|
|
4064
4114
|
FeedbackSheet,
|
|
4065
4115
|
{
|
|
4066
4116
|
tone: "ok",
|
|
@@ -4072,7 +4122,7 @@ function FillBlankFeedback({
|
|
|
4072
4122
|
);
|
|
4073
4123
|
}
|
|
4074
4124
|
if (phase === "retry") {
|
|
4075
|
-
return /* @__PURE__ */
|
|
4125
|
+
return /* @__PURE__ */ jsx45(
|
|
4076
4126
|
FeedbackSheet,
|
|
4077
4127
|
{
|
|
4078
4128
|
tone: "warn",
|
|
@@ -4082,10 +4132,10 @@ function FillBlankFeedback({
|
|
|
4082
4132
|
);
|
|
4083
4133
|
}
|
|
4084
4134
|
if (phase === "correct") {
|
|
4085
|
-
return /* @__PURE__ */
|
|
4135
|
+
return /* @__PURE__ */ jsx45(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
|
|
4086
4136
|
}
|
|
4087
4137
|
if (phase === "locked") {
|
|
4088
|
-
return /* @__PURE__ */
|
|
4138
|
+
return /* @__PURE__ */ jsx45(
|
|
4089
4139
|
FeedbackSheet,
|
|
4090
4140
|
{
|
|
4091
4141
|
tone: "bad",
|
|
@@ -4101,7 +4151,7 @@ function FillBlankFeedback({
|
|
|
4101
4151
|
}
|
|
4102
4152
|
|
|
4103
4153
|
// src/questions/fill-blank/blank-input.tsx
|
|
4104
|
-
import { jsx as
|
|
4154
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4105
4155
|
function BlankInput({
|
|
4106
4156
|
blank,
|
|
4107
4157
|
blankIndex,
|
|
@@ -4116,7 +4166,7 @@ function BlankInput({
|
|
|
4116
4166
|
7,
|
|
4117
4167
|
Math.min(18, normalizeAnswer(value).length || normalizeAnswer((_a = blank.answers[0]) != null ? _a : "").length)
|
|
4118
4168
|
);
|
|
4119
|
-
return /* @__PURE__ */
|
|
4169
|
+
return /* @__PURE__ */ jsx46(
|
|
4120
4170
|
"input",
|
|
4121
4171
|
{
|
|
4122
4172
|
className: classNames("rqk-fill-input", graded && (ok ? "rqk-is-correct" : "rqk-is-wrong")),
|
|
@@ -4131,7 +4181,7 @@ function BlankInput({
|
|
|
4131
4181
|
}
|
|
4132
4182
|
|
|
4133
4183
|
// src/questions/fill-blank/passage-card.tsx
|
|
4134
|
-
import { jsx as
|
|
4184
|
+
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4135
4185
|
function FillBlankPassage({
|
|
4136
4186
|
data,
|
|
4137
4187
|
values,
|
|
@@ -4140,16 +4190,16 @@ function FillBlankPassage({
|
|
|
4140
4190
|
readonly,
|
|
4141
4191
|
onChange
|
|
4142
4192
|
}) {
|
|
4143
|
-
return /* @__PURE__ */
|
|
4144
|
-
/* @__PURE__ */
|
|
4145
|
-
/* @__PURE__ */
|
|
4193
|
+
return /* @__PURE__ */ jsxs34(Card, { className: "rqk-fill-card", children: [
|
|
4194
|
+
/* @__PURE__ */ jsxs34("div", { className: "rqk-fill-tip", children: [
|
|
4195
|
+
/* @__PURE__ */ jsx47("span", { className: "rqk-fill-badge", children: "\u77ED\u6587" }),
|
|
4146
4196
|
"\u6BCF\u7A7A\u586B\u4E00\u4E2A\u5355\u8BCD"
|
|
4147
4197
|
] }),
|
|
4148
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ jsx47("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
|
|
4149
4199
|
var _a;
|
|
4150
|
-
return /* @__PURE__ */
|
|
4200
|
+
return /* @__PURE__ */ jsxs34("span", { children: [
|
|
4151
4201
|
segment,
|
|
4152
|
-
segmentIndex < data.blanks.length ? /* @__PURE__ */
|
|
4202
|
+
segmentIndex < data.blanks.length ? /* @__PURE__ */ jsx47(
|
|
4153
4203
|
BlankInput,
|
|
4154
4204
|
{
|
|
4155
4205
|
blank: data.blanks[segmentIndex],
|
|
@@ -4163,7 +4213,7 @@ function FillBlankPassage({
|
|
|
4163
4213
|
) : null
|
|
4164
4214
|
] }, segmentIndex);
|
|
4165
4215
|
}) }),
|
|
4166
|
-
data.translation ? /* @__PURE__ */
|
|
4216
|
+
data.translation ? /* @__PURE__ */ jsxs34("div", { className: "rqk-fill-translation", children: [
|
|
4167
4217
|
"\u8BD1\uFF1A",
|
|
4168
4218
|
data.translation
|
|
4169
4219
|
] }) : null
|
|
@@ -4243,7 +4293,7 @@ function useFillBlank({
|
|
|
4243
4293
|
}
|
|
4244
4294
|
|
|
4245
4295
|
// src/questions/fill-blank/index.tsx
|
|
4246
|
-
import { Fragment as
|
|
4296
|
+
import { Fragment as Fragment11, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4247
4297
|
function FillBlank({
|
|
4248
4298
|
data,
|
|
4249
4299
|
mode = "answer",
|
|
@@ -4269,22 +4319,22 @@ function FillBlank({
|
|
|
4269
4319
|
onSubmit: model.handleSubmit,
|
|
4270
4320
|
onRetry: model.judge.retry
|
|
4271
4321
|
});
|
|
4272
|
-
return /* @__PURE__ */
|
|
4322
|
+
return /* @__PURE__ */ jsx48(
|
|
4273
4323
|
QuestShell,
|
|
4274
4324
|
{
|
|
4275
4325
|
mode,
|
|
4276
4326
|
title: title != null ? title : "\u586B\u7A7A\u9898",
|
|
4277
4327
|
index,
|
|
4278
4328
|
total,
|
|
4279
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */
|
|
4329
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
4280
4330
|
"\u8BFB\u77ED\u6587\uFF0C\u5728",
|
|
4281
|
-
/* @__PURE__ */
|
|
4331
|
+
/* @__PURE__ */ jsx48("b", { children: "\u6A2A\u7EBF" }),
|
|
4282
4332
|
"\u5904\u8F93\u5165\u6B63\u786E\u7684\u8BCD"
|
|
4283
4333
|
] }),
|
|
4284
4334
|
onBack,
|
|
4285
4335
|
className: classNames("rqk-quest", "rqk-fill-blank", className),
|
|
4286
4336
|
dataQuest: "fill-blank",
|
|
4287
|
-
feedback: /* @__PURE__ */
|
|
4337
|
+
feedback: /* @__PURE__ */ jsx48(
|
|
4288
4338
|
FillBlankFeedback,
|
|
4289
4339
|
{
|
|
4290
4340
|
readonly: model.readonly,
|
|
@@ -4294,9 +4344,9 @@ function FillBlank({
|
|
|
4294
4344
|
answerText: model.answerText
|
|
4295
4345
|
}
|
|
4296
4346
|
),
|
|
4297
|
-
footer: /* @__PURE__ */
|
|
4298
|
-
children: /* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4347
|
+
footer: /* @__PURE__ */ jsx48(ActionBar, { actions, index, total, onPrev }),
|
|
4348
|
+
children: /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
4349
|
+
/* @__PURE__ */ jsx48(
|
|
4300
4350
|
FillBlankPassage,
|
|
4301
4351
|
{
|
|
4302
4352
|
data,
|
|
@@ -4307,8 +4357,8 @@ function FillBlank({
|
|
|
4307
4357
|
onChange: model.updateBlank
|
|
4308
4358
|
}
|
|
4309
4359
|
),
|
|
4310
|
-
!model.readonly && !model.graded ? /* @__PURE__ */
|
|
4311
|
-
/* @__PURE__ */
|
|
4360
|
+
!model.readonly && !model.graded ? /* @__PURE__ */ jsxs35("div", { className: "rqk-tx-kb-hint", children: [
|
|
4361
|
+
/* @__PURE__ */ jsx48(KeyboardIcon, {}),
|
|
4312
4362
|
"\u70B9\u51FB\u6A2A\u7EBF\u8F93\u5165\uFF0C\u7CFB\u7EDF\u952E\u76D8\u81EA\u52A8\u5F39\u51FA"
|
|
4313
4363
|
] }) : null
|
|
4314
4364
|
] })
|
|
@@ -4340,7 +4390,7 @@ function wordSelectActions({
|
|
|
4340
4390
|
}
|
|
4341
4391
|
|
|
4342
4392
|
// src/questions/word-select/bank-card.tsx
|
|
4343
|
-
import { jsx as
|
|
4393
|
+
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4344
4394
|
function WordSelectBank({
|
|
4345
4395
|
bank,
|
|
4346
4396
|
interaction,
|
|
@@ -4348,9 +4398,9 @@ function WordSelectBank({
|
|
|
4348
4398
|
tileUsed,
|
|
4349
4399
|
onPick
|
|
4350
4400
|
}) {
|
|
4351
|
-
return /* @__PURE__ */
|
|
4352
|
-
/* @__PURE__ */
|
|
4353
|
-
/* @__PURE__ */
|
|
4401
|
+
return /* @__PURE__ */ jsxs36(Card, { className: "rqk-word-select-bank", children: [
|
|
4402
|
+
/* @__PURE__ */ jsx49("div", { className: "rqk-word-select-bank-label", children: interaction === "sequence" ? "\u70B9\u9009\u9879\u4F9D\u5E8F\u586B\u5165" : "\u5148\u9009\u6A2A\u7EBF\uFF0C\u518D\u70B9\u9009\u9879" }),
|
|
4403
|
+
/* @__PURE__ */ jsx49("div", { className: "rqk-word-select-bank-items", children: bank.map((tile, tileIndex) => /* @__PURE__ */ jsx49(
|
|
4354
4404
|
WordChip,
|
|
4355
4405
|
{
|
|
4356
4406
|
variant: "word",
|
|
@@ -4365,7 +4415,7 @@ function WordSelectBank({
|
|
|
4365
4415
|
}
|
|
4366
4416
|
|
|
4367
4417
|
// src/questions/word-select/feedback.tsx
|
|
4368
|
-
import { jsx as
|
|
4418
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
4369
4419
|
function WordSelectFeedback({
|
|
4370
4420
|
readonly,
|
|
4371
4421
|
phase,
|
|
@@ -4374,7 +4424,7 @@ function WordSelectFeedback({
|
|
|
4374
4424
|
answerText
|
|
4375
4425
|
}) {
|
|
4376
4426
|
if (readonly) {
|
|
4377
|
-
return /* @__PURE__ */
|
|
4427
|
+
return /* @__PURE__ */ jsx50(
|
|
4378
4428
|
FeedbackSheet,
|
|
4379
4429
|
{
|
|
4380
4430
|
tone: "ok",
|
|
@@ -4386,13 +4436,13 @@ function WordSelectFeedback({
|
|
|
4386
4436
|
);
|
|
4387
4437
|
}
|
|
4388
4438
|
if (phase === "retry") {
|
|
4389
|
-
return /* @__PURE__ */
|
|
4439
|
+
return /* @__PURE__ */ jsx50(FeedbackSheet, { tone: "warn", title: "\u6709\u7A7A\u653E\u9519\u4E86\u4F4D\u7F6E", detail: "\u6B63\u786E\u7684\u8BCD\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
|
|
4390
4440
|
}
|
|
4391
4441
|
if (phase === "correct") {
|
|
4392
|
-
return /* @__PURE__ */
|
|
4442
|
+
return /* @__PURE__ */ jsx50(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
|
|
4393
4443
|
}
|
|
4394
4444
|
if (phase === "locked") {
|
|
4395
|
-
return /* @__PURE__ */
|
|
4445
|
+
return /* @__PURE__ */ jsx50(
|
|
4396
4446
|
FeedbackSheet,
|
|
4397
4447
|
{
|
|
4398
4448
|
tone: "bad",
|
|
@@ -4408,7 +4458,7 @@ function WordSelectFeedback({
|
|
|
4408
4458
|
}
|
|
4409
4459
|
|
|
4410
4460
|
// src/questions/word-select/passage-card.tsx
|
|
4411
|
-
import { jsx as
|
|
4461
|
+
import { jsx as jsx51, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4412
4462
|
function WordSelectPassage({
|
|
4413
4463
|
data,
|
|
4414
4464
|
filled,
|
|
@@ -4417,18 +4467,18 @@ function WordSelectPassage({
|
|
|
4417
4467
|
phase,
|
|
4418
4468
|
onSlot
|
|
4419
4469
|
}) {
|
|
4420
|
-
return /* @__PURE__ */
|
|
4421
|
-
/* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4470
|
+
return /* @__PURE__ */ jsxs37(Card, { className: "rqk-word-select-card", children: [
|
|
4471
|
+
/* @__PURE__ */ jsxs37("div", { className: "rqk-fill-tip", children: [
|
|
4472
|
+
/* @__PURE__ */ jsx51("span", { className: "rqk-fill-badge", children: "\u77ED\u6587" }),
|
|
4423
4473
|
"\u6BCF\u4E2A\u8BCD\u53EA\u80FD\u4F7F\u7528\u4E00\u6B21"
|
|
4424
4474
|
] }),
|
|
4425
|
-
/* @__PURE__ */
|
|
4475
|
+
/* @__PURE__ */ jsx51("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
|
|
4426
4476
|
const value = filled[segmentIndex];
|
|
4427
4477
|
const active = !frozen && !value && selected === segmentIndex;
|
|
4428
4478
|
const correct = value ? matchesAny(value, [data.blanks[segmentIndex].answer]) : false;
|
|
4429
|
-
return /* @__PURE__ */
|
|
4479
|
+
return /* @__PURE__ */ jsxs37("span", { children: [
|
|
4430
4480
|
segment,
|
|
4431
|
-
segmentIndex < data.blanks.length ? /* @__PURE__ */
|
|
4481
|
+
segmentIndex < data.blanks.length ? /* @__PURE__ */ jsx51(
|
|
4432
4482
|
"button",
|
|
4433
4483
|
{
|
|
4434
4484
|
type: "button",
|
|
@@ -4446,7 +4496,7 @@ function WordSelectPassage({
|
|
|
4446
4496
|
) : null
|
|
4447
4497
|
] }, segmentIndex);
|
|
4448
4498
|
}) }),
|
|
4449
|
-
data.translation ? /* @__PURE__ */
|
|
4499
|
+
data.translation ? /* @__PURE__ */ jsxs37("div", { className: "rqk-fill-translation", children: [
|
|
4450
4500
|
"\u8BD1\uFF1A",
|
|
4451
4501
|
data.translation
|
|
4452
4502
|
] }) : null
|
|
@@ -4574,7 +4624,7 @@ function useWordSelect({
|
|
|
4574
4624
|
}
|
|
4575
4625
|
|
|
4576
4626
|
// src/questions/word-select/index.tsx
|
|
4577
|
-
import { Fragment as
|
|
4627
|
+
import { Fragment as Fragment12, jsx as jsx52, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4578
4628
|
function WordSelect({
|
|
4579
4629
|
data,
|
|
4580
4630
|
mode = "answer",
|
|
@@ -4600,22 +4650,22 @@ function WordSelect({
|
|
|
4600
4650
|
onSubmit: model.handleSubmit,
|
|
4601
4651
|
onRetry: model.judge.retry
|
|
4602
4652
|
});
|
|
4603
|
-
return /* @__PURE__ */
|
|
4653
|
+
return /* @__PURE__ */ jsx52(
|
|
4604
4654
|
QuestShell,
|
|
4605
4655
|
{
|
|
4606
4656
|
mode,
|
|
4607
4657
|
title: title != null ? title : "\u9009\u8BCD\u586B\u7A7A",
|
|
4608
4658
|
index,
|
|
4609
4659
|
total,
|
|
4610
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */
|
|
4660
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs38(Fragment12, { children: [
|
|
4611
4661
|
"\u4ECE\u9009\u9879\u5E93",
|
|
4612
|
-
/* @__PURE__ */
|
|
4662
|
+
/* @__PURE__ */ jsx52("b", { children: "\u9009\u8BCD" }),
|
|
4613
4663
|
"\uFF0C\u8865\u5168\u77ED\u6587"
|
|
4614
4664
|
] }),
|
|
4615
4665
|
onBack,
|
|
4616
4666
|
className: classNames("rqk-quest", "rqk-word-select", className),
|
|
4617
4667
|
dataQuest: "word-select",
|
|
4618
|
-
feedback: /* @__PURE__ */
|
|
4668
|
+
feedback: /* @__PURE__ */ jsx52(
|
|
4619
4669
|
WordSelectFeedback,
|
|
4620
4670
|
{
|
|
4621
4671
|
readonly: model.readonly,
|
|
@@ -4625,9 +4675,9 @@ function WordSelect({
|
|
|
4625
4675
|
answerText: model.answerText
|
|
4626
4676
|
}
|
|
4627
4677
|
),
|
|
4628
|
-
footer: /* @__PURE__ */
|
|
4629
|
-
children: /* @__PURE__ */
|
|
4630
|
-
/* @__PURE__ */
|
|
4678
|
+
footer: /* @__PURE__ */ jsx52(ActionBar, { actions, index, total, onPrev }),
|
|
4679
|
+
children: /* @__PURE__ */ jsxs38(Fragment12, { children: [
|
|
4680
|
+
/* @__PURE__ */ jsx52(
|
|
4631
4681
|
WordSelectPassage,
|
|
4632
4682
|
{
|
|
4633
4683
|
data,
|
|
@@ -4638,7 +4688,7 @@ function WordSelect({
|
|
|
4638
4688
|
onSlot: model.tapSlot
|
|
4639
4689
|
}
|
|
4640
4690
|
),
|
|
4641
|
-
/* @__PURE__ */
|
|
4691
|
+
/* @__PURE__ */ jsx52(
|
|
4642
4692
|
WordSelectBank,
|
|
4643
4693
|
{
|
|
4644
4694
|
bank: model.bank,
|
|
@@ -4648,7 +4698,7 @@ function WordSelect({
|
|
|
4648
4698
|
onPick: model.pickWord
|
|
4649
4699
|
}
|
|
4650
4700
|
),
|
|
4651
|
-
/* @__PURE__ */
|
|
4701
|
+
/* @__PURE__ */ jsx52(Toast, { children: model.notice })
|
|
4652
4702
|
] })
|
|
4653
4703
|
}
|
|
4654
4704
|
);
|
|
@@ -4683,7 +4733,7 @@ function sortSentencesActions({
|
|
|
4683
4733
|
}
|
|
4684
4734
|
|
|
4685
4735
|
// src/questions/sort-sentences/feedback.tsx
|
|
4686
|
-
import { jsx as
|
|
4736
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
4687
4737
|
function SortSentencesFeedback({
|
|
4688
4738
|
readonly,
|
|
4689
4739
|
phase,
|
|
@@ -4691,7 +4741,7 @@ function SortSentencesFeedback({
|
|
|
4691
4741
|
labels
|
|
4692
4742
|
}) {
|
|
4693
4743
|
if (readonly) {
|
|
4694
|
-
return /* @__PURE__ */
|
|
4744
|
+
return /* @__PURE__ */ jsx53(
|
|
4695
4745
|
FeedbackSheet,
|
|
4696
4746
|
{
|
|
4697
4747
|
tone: "ok",
|
|
@@ -4703,13 +4753,13 @@ function SortSentencesFeedback({
|
|
|
4703
4753
|
);
|
|
4704
4754
|
}
|
|
4705
4755
|
if (phase === "retry") {
|
|
4706
|
-
return /* @__PURE__ */
|
|
4756
|
+
return /* @__PURE__ */ jsx53(FeedbackSheet, { tone: "warn", title: "\u6709\u53E5\u5B50\u653E\u9519\u4E86\u4F4D\u7F6E", detail: "\u987A\u5E8F\u6B63\u786E\u7684\u884C\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
|
|
4707
4757
|
}
|
|
4708
4758
|
if (phase === "correct") {
|
|
4709
|
-
return /* @__PURE__ */
|
|
4759
|
+
return /* @__PURE__ */ jsx53(FeedbackSheet, { tone: "ok", title: labels.correctAll });
|
|
4710
4760
|
}
|
|
4711
4761
|
if (phase === "locked") {
|
|
4712
|
-
return /* @__PURE__ */
|
|
4762
|
+
return /* @__PURE__ */ jsx53(
|
|
4713
4763
|
FeedbackSheet,
|
|
4714
4764
|
{
|
|
4715
4765
|
tone: "bad",
|
|
@@ -4725,7 +4775,7 @@ function SortSentencesFeedback({
|
|
|
4725
4775
|
}
|
|
4726
4776
|
|
|
4727
4777
|
// src/questions/sort-sentences/sort-bank.tsx
|
|
4728
|
-
import { jsx as
|
|
4778
|
+
import { jsx as jsx54, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4729
4779
|
function SortBank({
|
|
4730
4780
|
bank,
|
|
4731
4781
|
readonly,
|
|
@@ -4733,9 +4783,9 @@ function SortBank({
|
|
|
4733
4783
|
tileUsed,
|
|
4734
4784
|
onPick
|
|
4735
4785
|
}) {
|
|
4736
|
-
return /* @__PURE__ */
|
|
4737
|
-
/* @__PURE__ */
|
|
4738
|
-
/* @__PURE__ */
|
|
4786
|
+
return /* @__PURE__ */ jsxs39(Card, { className: "rqk-sort-bank", children: [
|
|
4787
|
+
/* @__PURE__ */ jsx54("div", { className: "rqk-sort-bank-label", children: readonly ? "\u6B63\u786E\u987A\u5E8F" : "\u5F85\u6392\u5E8F\u53E5\u5B50" }),
|
|
4788
|
+
/* @__PURE__ */ jsx54("div", { className: "rqk-sort-bank-items", children: bank.map((tile, tileIndex) => /* @__PURE__ */ jsx54(
|
|
4739
4789
|
"button",
|
|
4740
4790
|
{
|
|
4741
4791
|
type: "button",
|
|
@@ -4750,7 +4800,7 @@ function SortBank({
|
|
|
4750
4800
|
}
|
|
4751
4801
|
|
|
4752
4802
|
// src/questions/sort-sentences/sort-rows.tsx
|
|
4753
|
-
import { jsx as
|
|
4803
|
+
import { jsx as jsx55, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4754
4804
|
function SortRows({
|
|
4755
4805
|
rows,
|
|
4756
4806
|
order,
|
|
@@ -4758,7 +4808,7 @@ function SortRows({
|
|
|
4758
4808
|
phase,
|
|
4759
4809
|
onRow
|
|
4760
4810
|
}) {
|
|
4761
|
-
return /* @__PURE__ */
|
|
4811
|
+
return /* @__PURE__ */ jsx55("div", { className: "rqk-sort-rows", children: rows.map((sentence, rowIndex) => /* @__PURE__ */ jsxs40(
|
|
4762
4812
|
"div",
|
|
4763
4813
|
{
|
|
4764
4814
|
className: classNames(
|
|
@@ -4776,8 +4826,8 @@ function SortRows({
|
|
|
4776
4826
|
}
|
|
4777
4827
|
},
|
|
4778
4828
|
children: [
|
|
4779
|
-
/* @__PURE__ */
|
|
4780
|
-
sentence ? /* @__PURE__ */
|
|
4829
|
+
/* @__PURE__ */ jsx55("span", { className: "rqk-sort-row-number", children: rowIndex + 1 }),
|
|
4830
|
+
sentence ? /* @__PURE__ */ jsx55("span", { className: "rqk-sort-row-text", children: sentence }) : /* @__PURE__ */ jsxs40("span", { className: "rqk-sort-row-placeholder", children: [
|
|
4781
4831
|
"\u70B9\u51FB\u4E0B\u65B9\u53E5\u5B50\u653E\u5165\u7B2C ",
|
|
4782
4832
|
rowIndex + 1,
|
|
4783
4833
|
" \u884C"
|
|
@@ -4884,7 +4934,7 @@ function useSortSentences({
|
|
|
4884
4934
|
}
|
|
4885
4935
|
|
|
4886
4936
|
// src/questions/sort-sentences/index.tsx
|
|
4887
|
-
import { Fragment as
|
|
4937
|
+
import { Fragment as Fragment13, jsx as jsx56, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4888
4938
|
function SortSentences({
|
|
4889
4939
|
data,
|
|
4890
4940
|
mode = "answer",
|
|
@@ -4910,22 +4960,22 @@ function SortSentences({
|
|
|
4910
4960
|
onSubmit: model.handleSubmit,
|
|
4911
4961
|
onRetry: model.judge.retry
|
|
4912
4962
|
});
|
|
4913
|
-
return /* @__PURE__ */
|
|
4963
|
+
return /* @__PURE__ */ jsx56(
|
|
4914
4964
|
QuestShell,
|
|
4915
4965
|
{
|
|
4916
4966
|
mode,
|
|
4917
4967
|
title: title != null ? title : "\u53E5\u5B50\u6392\u5E8F",
|
|
4918
4968
|
index,
|
|
4919
4969
|
total,
|
|
4920
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */
|
|
4970
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs41(Fragment13, { children: [
|
|
4921
4971
|
"\u6309\u6B63\u786E",
|
|
4922
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsx56("b", { children: "\u987A\u5E8F" }),
|
|
4923
4973
|
"\u6392\u5217\u53E5\u5B50\uFF0C\u70B9\u51FB\u7A7A\u884C\u653E\u5165"
|
|
4924
4974
|
] }),
|
|
4925
4975
|
onBack,
|
|
4926
4976
|
className: classNames("rqk-quest", "rqk-sort", className),
|
|
4927
4977
|
dataQuest: "sort-sentences",
|
|
4928
|
-
feedback: /* @__PURE__ */
|
|
4978
|
+
feedback: /* @__PURE__ */ jsx56(
|
|
4929
4979
|
SortSentencesFeedback,
|
|
4930
4980
|
{
|
|
4931
4981
|
readonly: model.readonly,
|
|
@@ -4934,9 +4984,9 @@ function SortSentences({
|
|
|
4934
4984
|
labels: model.labels
|
|
4935
4985
|
}
|
|
4936
4986
|
),
|
|
4937
|
-
footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */
|
|
4938
|
-
children: /* @__PURE__ */
|
|
4939
|
-
/* @__PURE__ */
|
|
4987
|
+
footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ jsx56(ActionBar, { actions, index, total, onPrev }) : void 0,
|
|
4988
|
+
children: /* @__PURE__ */ jsxs41(Fragment13, { children: [
|
|
4989
|
+
/* @__PURE__ */ jsx56(
|
|
4940
4990
|
SortRows,
|
|
4941
4991
|
{
|
|
4942
4992
|
rows: model.rows,
|
|
@@ -4946,7 +4996,7 @@ function SortSentences({
|
|
|
4946
4996
|
onRow: model.tapRow
|
|
4947
4997
|
}
|
|
4948
4998
|
),
|
|
4949
|
-
/* @__PURE__ */
|
|
4999
|
+
/* @__PURE__ */ jsx56(
|
|
4950
5000
|
SortBank,
|
|
4951
5001
|
{
|
|
4952
5002
|
bank: model.bank,
|
|
@@ -4956,7 +5006,7 @@ function SortSentences({
|
|
|
4956
5006
|
onPick: model.tapBank
|
|
4957
5007
|
}
|
|
4958
5008
|
),
|
|
4959
|
-
/* @__PURE__ */
|
|
5009
|
+
/* @__PURE__ */ jsx56(Toast, { children: model.notice })
|
|
4960
5010
|
] })
|
|
4961
5011
|
}
|
|
4962
5012
|
);
|
|
@@ -4986,7 +5036,7 @@ function clozeActions({
|
|
|
4986
5036
|
}
|
|
4987
5037
|
|
|
4988
5038
|
// src/questions/cloze/feedback.tsx
|
|
4989
|
-
import { jsx as
|
|
5039
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
4990
5040
|
function ClozeFeedback({
|
|
4991
5041
|
readonly,
|
|
4992
5042
|
phase,
|
|
@@ -4995,7 +5045,7 @@ function ClozeFeedback({
|
|
|
4995
5045
|
answerText
|
|
4996
5046
|
}) {
|
|
4997
5047
|
if (readonly) {
|
|
4998
|
-
return /* @__PURE__ */
|
|
5048
|
+
return /* @__PURE__ */ jsx57(
|
|
4999
5049
|
FeedbackSheet,
|
|
5000
5050
|
{
|
|
5001
5051
|
tone: "ok",
|
|
@@ -5007,13 +5057,13 @@ function ClozeFeedback({
|
|
|
5007
5057
|
);
|
|
5008
5058
|
}
|
|
5009
5059
|
if (phase === "retry") {
|
|
5010
|
-
return /* @__PURE__ */
|
|
5060
|
+
return /* @__PURE__ */ jsx57(FeedbackSheet, { tone: "warn", title: "\u6709\u7A7A\u9009\u9519\u4E86", detail: "\u9009\u62E9\u6B63\u786E\u7684\u7A7A\u5DF2\u4E3A\u4F60\u4FDD\u7559" });
|
|
5011
5061
|
}
|
|
5012
5062
|
if (phase === "correct") {
|
|
5013
|
-
return /* @__PURE__ */
|
|
5063
|
+
return /* @__PURE__ */ jsx57(FeedbackSheet, { tone: "ok", title: labels.correctAll, answer: answerText });
|
|
5014
5064
|
}
|
|
5015
5065
|
if (phase === "locked") {
|
|
5016
|
-
return /* @__PURE__ */
|
|
5066
|
+
return /* @__PURE__ */ jsx57(
|
|
5017
5067
|
FeedbackSheet,
|
|
5018
5068
|
{
|
|
5019
5069
|
tone: "bad",
|
|
@@ -5029,7 +5079,7 @@ function ClozeFeedback({
|
|
|
5029
5079
|
}
|
|
5030
5080
|
|
|
5031
5081
|
// src/questions/cloze/option-grid.tsx
|
|
5032
|
-
import { jsx as
|
|
5082
|
+
import { jsx as jsx58, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5033
5083
|
function ClozeOptions({
|
|
5034
5084
|
data,
|
|
5035
5085
|
current,
|
|
@@ -5041,17 +5091,17 @@ function ClozeOptions({
|
|
|
5041
5091
|
var _a;
|
|
5042
5092
|
const options = (_a = data.options[current]) != null ? _a : [];
|
|
5043
5093
|
const currentChosen = selected[current];
|
|
5044
|
-
return /* @__PURE__ */
|
|
5045
|
-
/* @__PURE__ */
|
|
5094
|
+
return /* @__PURE__ */ jsxs42(Card, { className: "rqk-cloze-options", children: [
|
|
5095
|
+
/* @__PURE__ */ jsxs42("div", { className: "rqk-cloze-options-label", children: [
|
|
5046
5096
|
"\u7B2C ",
|
|
5047
5097
|
current + 1,
|
|
5048
5098
|
" \u7A7A \xB7 \u9009\u62E9\u7B54\u6848"
|
|
5049
5099
|
] }),
|
|
5050
|
-
/* @__PURE__ */
|
|
5100
|
+
/* @__PURE__ */ jsx58("div", { className: "rqk-cloze-options-grid", children: options.map((option, optionIndex) => {
|
|
5051
5101
|
var _a2;
|
|
5052
5102
|
const chosen = currentChosen === optionIndex;
|
|
5053
5103
|
const isAnswer = option === ((_a2 = data.gaps[current]) == null ? void 0 : _a2.answer);
|
|
5054
|
-
return /* @__PURE__ */
|
|
5104
|
+
return /* @__PURE__ */ jsxs42(
|
|
5055
5105
|
"button",
|
|
5056
5106
|
{
|
|
5057
5107
|
type: "button",
|
|
@@ -5064,7 +5114,7 @@ function ClozeOptions({
|
|
|
5064
5114
|
onClick: () => onPick(optionIndex),
|
|
5065
5115
|
disabled: frozen,
|
|
5066
5116
|
children: [
|
|
5067
|
-
/* @__PURE__ */
|
|
5117
|
+
/* @__PURE__ */ jsx58("span", { className: "rqk-cloze-option-key", children: String.fromCharCode(65 + optionIndex) }),
|
|
5068
5118
|
option
|
|
5069
5119
|
]
|
|
5070
5120
|
},
|
|
@@ -5075,7 +5125,7 @@ function ClozeOptions({
|
|
|
5075
5125
|
}
|
|
5076
5126
|
|
|
5077
5127
|
// src/questions/cloze/passage-card.tsx
|
|
5078
|
-
import { jsx as
|
|
5128
|
+
import { jsx as jsx59, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5079
5129
|
function ClozePassage({
|
|
5080
5130
|
data,
|
|
5081
5131
|
selected,
|
|
@@ -5084,15 +5134,15 @@ function ClozePassage({
|
|
|
5084
5134
|
phase,
|
|
5085
5135
|
onGap
|
|
5086
5136
|
}) {
|
|
5087
|
-
return /* @__PURE__ */
|
|
5088
|
-
/* @__PURE__ */
|
|
5137
|
+
return /* @__PURE__ */ jsxs43(Card, { className: "rqk-cloze-card", children: [
|
|
5138
|
+
/* @__PURE__ */ jsx59("div", { className: "rqk-fill-passage", children: data.segments.map((segment, segmentIndex) => {
|
|
5089
5139
|
var _a, _b;
|
|
5090
5140
|
const optionIndex = selected[segmentIndex];
|
|
5091
5141
|
const gap = data.gaps[segmentIndex];
|
|
5092
5142
|
const value = optionIndex === null || segmentIndex >= data.gaps.length ? "\uFF3F\uFF3F" : (_b = (_a = data.options[segmentIndex]) == null ? void 0 : _a[optionIndex]) != null ? _b : "\uFF3F\uFF3F";
|
|
5093
|
-
return /* @__PURE__ */
|
|
5143
|
+
return /* @__PURE__ */ jsxs43("span", { children: [
|
|
5094
5144
|
segment,
|
|
5095
|
-
segmentIndex < data.gaps.length ? /* @__PURE__ */
|
|
5145
|
+
segmentIndex < data.gaps.length ? /* @__PURE__ */ jsx59(
|
|
5096
5146
|
"button",
|
|
5097
5147
|
{
|
|
5098
5148
|
type: "button",
|
|
@@ -5110,7 +5160,7 @@ function ClozePassage({
|
|
|
5110
5160
|
) : null
|
|
5111
5161
|
] }, segmentIndex);
|
|
5112
5162
|
}) }),
|
|
5113
|
-
data.translation ? /* @__PURE__ */
|
|
5163
|
+
data.translation ? /* @__PURE__ */ jsxs43("div", { className: "rqk-fill-translation", children: [
|
|
5114
5164
|
"\u8BD1\uFF1A",
|
|
5115
5165
|
data.translation
|
|
5116
5166
|
] }) : null
|
|
@@ -5214,7 +5264,7 @@ function useCloze({
|
|
|
5214
5264
|
}
|
|
5215
5265
|
|
|
5216
5266
|
// src/questions/cloze/index.tsx
|
|
5217
|
-
import { Fragment as
|
|
5267
|
+
import { Fragment as Fragment14, jsx as jsx60, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
5218
5268
|
function Cloze({
|
|
5219
5269
|
data,
|
|
5220
5270
|
mode = "answer",
|
|
@@ -5240,7 +5290,7 @@ function Cloze({
|
|
|
5240
5290
|
onSubmit: model.handleSubmit,
|
|
5241
5291
|
onRetry: model.judge.retry
|
|
5242
5292
|
});
|
|
5243
|
-
return /* @__PURE__ */
|
|
5293
|
+
return /* @__PURE__ */ jsx60(
|
|
5244
5294
|
QuestShell,
|
|
5245
5295
|
{
|
|
5246
5296
|
mode,
|
|
@@ -5251,7 +5301,7 @@ function Cloze({
|
|
|
5251
5301
|
onBack,
|
|
5252
5302
|
className: classNames("rqk-quest", "rqk-cloze", className),
|
|
5253
5303
|
dataQuest: "cloze",
|
|
5254
|
-
feedback: /* @__PURE__ */
|
|
5304
|
+
feedback: /* @__PURE__ */ jsx60(
|
|
5255
5305
|
ClozeFeedback,
|
|
5256
5306
|
{
|
|
5257
5307
|
readonly: model.readonly,
|
|
@@ -5261,9 +5311,9 @@ function Cloze({
|
|
|
5261
5311
|
answerText: model.answerText
|
|
5262
5312
|
}
|
|
5263
5313
|
),
|
|
5264
|
-
footer: /* @__PURE__ */
|
|
5265
|
-
children: /* @__PURE__ */
|
|
5266
|
-
/* @__PURE__ */
|
|
5314
|
+
footer: /* @__PURE__ */ jsx60(ActionBar, { actions, index, total, onPrev }),
|
|
5315
|
+
children: /* @__PURE__ */ jsxs44(Fragment14, { children: [
|
|
5316
|
+
/* @__PURE__ */ jsx60(
|
|
5267
5317
|
ClozePassage,
|
|
5268
5318
|
{
|
|
5269
5319
|
data,
|
|
@@ -5274,7 +5324,7 @@ function Cloze({
|
|
|
5274
5324
|
onGap: model.tapGap
|
|
5275
5325
|
}
|
|
5276
5326
|
),
|
|
5277
|
-
/* @__PURE__ */
|
|
5327
|
+
/* @__PURE__ */ jsx60(
|
|
5278
5328
|
ClozeOptions,
|
|
5279
5329
|
{
|
|
5280
5330
|
data,
|
|
@@ -5319,7 +5369,7 @@ function readingActions({
|
|
|
5319
5369
|
}
|
|
5320
5370
|
|
|
5321
5371
|
// src/questions/reading-comprehension/feedback.tsx
|
|
5322
|
-
import { jsx as
|
|
5372
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
5323
5373
|
function ReadingFeedback({
|
|
5324
5374
|
readonly,
|
|
5325
5375
|
phase,
|
|
@@ -5328,7 +5378,7 @@ function ReadingFeedback({
|
|
|
5328
5378
|
answerText
|
|
5329
5379
|
}) {
|
|
5330
5380
|
if (readonly) {
|
|
5331
|
-
return /* @__PURE__ */
|
|
5381
|
+
return /* @__PURE__ */ jsx61(
|
|
5332
5382
|
FeedbackSheet,
|
|
5333
5383
|
{
|
|
5334
5384
|
tone: "ok",
|
|
@@ -5340,10 +5390,10 @@ function ReadingFeedback({
|
|
|
5340
5390
|
);
|
|
5341
5391
|
}
|
|
5342
5392
|
if (phase === "retry") {
|
|
5343
|
-
return /* @__PURE__ */
|
|
5393
|
+
return /* @__PURE__ */ jsx61(FeedbackSheet, { tone: "warn", title: "\u6709\u5C0F\u9898\u7B54\u9519\u4E86", detail: "\u7B54\u5BF9\u7684\u5C0F\u9898\u5DF2\u9501\u5B9A\uFF0C\u9519\u9898\u53EF\u91CD\u65B0\u9009\u62E9" });
|
|
5344
5394
|
}
|
|
5345
5395
|
if (phase === "correct") {
|
|
5346
|
-
return /* @__PURE__ */
|
|
5396
|
+
return /* @__PURE__ */ jsx61(
|
|
5347
5397
|
FeedbackSheet,
|
|
5348
5398
|
{
|
|
5349
5399
|
tone: "ok",
|
|
@@ -5354,7 +5404,7 @@ function ReadingFeedback({
|
|
|
5354
5404
|
);
|
|
5355
5405
|
}
|
|
5356
5406
|
if (phase === "locked") {
|
|
5357
|
-
return /* @__PURE__ */
|
|
5407
|
+
return /* @__PURE__ */ jsx61(
|
|
5358
5408
|
FeedbackSheet,
|
|
5359
5409
|
{
|
|
5360
5410
|
tone: "bad",
|
|
@@ -5370,7 +5420,7 @@ function ReadingFeedback({
|
|
|
5370
5420
|
}
|
|
5371
5421
|
|
|
5372
5422
|
// src/questions/reading-comprehension/passage-card.tsx
|
|
5373
|
-
import { jsx as
|
|
5423
|
+
import { jsx as jsx62, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
5374
5424
|
function ReadingPassage({
|
|
5375
5425
|
data,
|
|
5376
5426
|
collapsible,
|
|
@@ -5379,10 +5429,10 @@ function ReadingPassage({
|
|
|
5379
5429
|
textRef,
|
|
5380
5430
|
onToggle
|
|
5381
5431
|
}) {
|
|
5382
|
-
return /* @__PURE__ */
|
|
5383
|
-
/* @__PURE__ */
|
|
5384
|
-
/* @__PURE__ */
|
|
5385
|
-
collapsible ? /* @__PURE__ */
|
|
5432
|
+
return /* @__PURE__ */ jsxs45(Card, { className: "rqk-reading-card", children: [
|
|
5433
|
+
/* @__PURE__ */ jsxs45("div", { className: "rqk-reading-head", children: [
|
|
5434
|
+
/* @__PURE__ */ jsx62("span", { className: "rqk-reading-title", children: data.title }),
|
|
5435
|
+
collapsible ? /* @__PURE__ */ jsx62(
|
|
5386
5436
|
"button",
|
|
5387
5437
|
{
|
|
5388
5438
|
type: "button",
|
|
@@ -5393,12 +5443,12 @@ function ReadingPassage({
|
|
|
5393
5443
|
}
|
|
5394
5444
|
) : null
|
|
5395
5445
|
] }),
|
|
5396
|
-
/* @__PURE__ */
|
|
5446
|
+
/* @__PURE__ */ jsx62(
|
|
5397
5447
|
"div",
|
|
5398
5448
|
{
|
|
5399
5449
|
className: classNames("rqk-reading-body", folded && "rqk-is-collapsed"),
|
|
5400
5450
|
style: { maxHeight: folded ? 80 : fullHeight || void 0 },
|
|
5401
|
-
children: /* @__PURE__ */
|
|
5451
|
+
children: /* @__PURE__ */ jsx62(
|
|
5402
5452
|
"div",
|
|
5403
5453
|
{
|
|
5404
5454
|
ref: (element) => {
|
|
@@ -5414,7 +5464,7 @@ function ReadingPassage({
|
|
|
5414
5464
|
}
|
|
5415
5465
|
|
|
5416
5466
|
// src/questions/reading-comprehension/question-chips.tsx
|
|
5417
|
-
import { jsx as
|
|
5467
|
+
import { jsx as jsx63, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5418
5468
|
function ReadingChips({
|
|
5419
5469
|
data,
|
|
5420
5470
|
answers,
|
|
@@ -5424,12 +5474,12 @@ function ReadingChips({
|
|
|
5424
5474
|
readonly,
|
|
5425
5475
|
onPick
|
|
5426
5476
|
}) {
|
|
5427
|
-
return /* @__PURE__ */
|
|
5428
|
-
/* @__PURE__ */
|
|
5477
|
+
return /* @__PURE__ */ jsxs46("div", { className: "rqk-reading-chips", children: [
|
|
5478
|
+
/* @__PURE__ */ jsx63("span", { className: "rqk-reading-chips-label", children: "\u5C0F\u9898" }),
|
|
5429
5479
|
data.questions.map((item, questionIndex) => {
|
|
5430
5480
|
const value = answers[questionIndex];
|
|
5431
5481
|
const ok = judged && value === item.answer;
|
|
5432
|
-
return /* @__PURE__ */
|
|
5482
|
+
return /* @__PURE__ */ jsx63(
|
|
5433
5483
|
"button",
|
|
5434
5484
|
{
|
|
5435
5485
|
type: "button",
|
|
@@ -5452,7 +5502,7 @@ function ReadingChips({
|
|
|
5452
5502
|
}
|
|
5453
5503
|
|
|
5454
5504
|
// src/questions/reading-comprehension/question-card.tsx
|
|
5455
|
-
import { jsx as
|
|
5505
|
+
import { jsx as jsx64, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
5456
5506
|
function ReadingQuestion({
|
|
5457
5507
|
data,
|
|
5458
5508
|
current,
|
|
@@ -5464,18 +5514,18 @@ function ReadingQuestion({
|
|
|
5464
5514
|
}) {
|
|
5465
5515
|
const question = data.questions[current];
|
|
5466
5516
|
if (!question) return null;
|
|
5467
|
-
return /* @__PURE__ */
|
|
5468
|
-
/* @__PURE__ */
|
|
5469
|
-
/* @__PURE__ */
|
|
5517
|
+
return /* @__PURE__ */ jsx64(Card, { className: "rqk-reading-question", children: /* @__PURE__ */ jsxs47("div", { className: "rqk-reading-qbody", children: [
|
|
5518
|
+
/* @__PURE__ */ jsxs47("div", { className: "rqk-reading-stem", children: [
|
|
5519
|
+
/* @__PURE__ */ jsxs47("span", { className: "rqk-reading-stem-index", children: [
|
|
5470
5520
|
current + 1,
|
|
5471
5521
|
"."
|
|
5472
5522
|
] }),
|
|
5473
5523
|
question.stem
|
|
5474
5524
|
] }),
|
|
5475
|
-
/* @__PURE__ */
|
|
5525
|
+
/* @__PURE__ */ jsx64("div", { className: "rqk-reading-options", children: question.options.map((option, optionIndex) => {
|
|
5476
5526
|
const chosen = answers[current] === optionIndex;
|
|
5477
5527
|
const isAnswer = optionIndex === question.answer;
|
|
5478
|
-
return /* @__PURE__ */
|
|
5528
|
+
return /* @__PURE__ */ jsxs47(
|
|
5479
5529
|
"button",
|
|
5480
5530
|
{
|
|
5481
5531
|
type: "button",
|
|
@@ -5489,7 +5539,7 @@ function ReadingQuestion({
|
|
|
5489
5539
|
onClick: () => onPick(optionIndex),
|
|
5490
5540
|
disabled: readonly || locked[current],
|
|
5491
5541
|
children: [
|
|
5492
|
-
/* @__PURE__ */
|
|
5542
|
+
/* @__PURE__ */ jsx64("span", { className: "rqk-reading-option-key", children: optionLetter(optionIndex) }),
|
|
5493
5543
|
option
|
|
5494
5544
|
]
|
|
5495
5545
|
},
|
|
@@ -5500,7 +5550,7 @@ function ReadingQuestion({
|
|
|
5500
5550
|
}
|
|
5501
5551
|
|
|
5502
5552
|
// src/questions/reading-comprehension/reading-page.tsx
|
|
5503
|
-
import { Fragment as
|
|
5553
|
+
import { Fragment as Fragment15, jsx as jsx65, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5504
5554
|
function ReadingPage({
|
|
5505
5555
|
data,
|
|
5506
5556
|
collapsible,
|
|
@@ -5516,8 +5566,8 @@ function ReadingPage({
|
|
|
5516
5566
|
onChip,
|
|
5517
5567
|
onPick
|
|
5518
5568
|
}) {
|
|
5519
|
-
return /* @__PURE__ */
|
|
5520
|
-
/* @__PURE__ */
|
|
5569
|
+
return /* @__PURE__ */ jsxs48(Fragment15, { children: [
|
|
5570
|
+
/* @__PURE__ */ jsx65(
|
|
5521
5571
|
ReadingPassage,
|
|
5522
5572
|
{
|
|
5523
5573
|
data,
|
|
@@ -5528,7 +5578,7 @@ function ReadingPage({
|
|
|
5528
5578
|
onToggle
|
|
5529
5579
|
}
|
|
5530
5580
|
),
|
|
5531
|
-
/* @__PURE__ */
|
|
5581
|
+
/* @__PURE__ */ jsx65(
|
|
5532
5582
|
ReadingChips,
|
|
5533
5583
|
{
|
|
5534
5584
|
data,
|
|
@@ -5540,7 +5590,7 @@ function ReadingPage({
|
|
|
5540
5590
|
onPick: onChip
|
|
5541
5591
|
}
|
|
5542
5592
|
),
|
|
5543
|
-
/* @__PURE__ */
|
|
5593
|
+
/* @__PURE__ */ jsx65(
|
|
5544
5594
|
ReadingQuestion,
|
|
5545
5595
|
{
|
|
5546
5596
|
data,
|
|
@@ -5707,7 +5757,7 @@ function useReadingComprehension({
|
|
|
5707
5757
|
}
|
|
5708
5758
|
|
|
5709
5759
|
// src/questions/reading-comprehension/index.tsx
|
|
5710
|
-
import { Fragment as
|
|
5760
|
+
import { Fragment as Fragment16, jsx as jsx66, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5711
5761
|
function ReadingComprehension({
|
|
5712
5762
|
data,
|
|
5713
5763
|
mode = "answer",
|
|
@@ -5741,22 +5791,22 @@ function ReadingComprehension({
|
|
|
5741
5791
|
onSubmit: model.handleSubmit,
|
|
5742
5792
|
onRetry: model.judge.retry
|
|
5743
5793
|
});
|
|
5744
|
-
return /* @__PURE__ */
|
|
5794
|
+
return /* @__PURE__ */ jsxs49(
|
|
5745
5795
|
QuestShell,
|
|
5746
5796
|
{
|
|
5747
5797
|
mode,
|
|
5748
5798
|
title: title != null ? title : "\u9605\u8BFB\u7406\u89E3",
|
|
5749
5799
|
index,
|
|
5750
5800
|
total,
|
|
5751
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */
|
|
5801
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs49(Fragment16, { children: [
|
|
5752
5802
|
"\u9605\u8BFB\u77ED\u6587\uFF0C\u5B8C\u6210 ",
|
|
5753
|
-
/* @__PURE__ */
|
|
5803
|
+
/* @__PURE__ */ jsx66("b", { children: data.questions.length }),
|
|
5754
5804
|
" \u9053\u5C0F\u9898"
|
|
5755
5805
|
] }),
|
|
5756
5806
|
onBack,
|
|
5757
5807
|
className: classNames("rqk-quest", "rqk-reading", className),
|
|
5758
5808
|
dataQuest: "reading-comprehension",
|
|
5759
|
-
feedback: /* @__PURE__ */
|
|
5809
|
+
feedback: /* @__PURE__ */ jsx66(
|
|
5760
5810
|
ReadingFeedback,
|
|
5761
5811
|
{
|
|
5762
5812
|
readonly: model.readonly,
|
|
@@ -5766,9 +5816,9 @@ function ReadingComprehension({
|
|
|
5766
5816
|
answerText: model.answerText
|
|
5767
5817
|
}
|
|
5768
5818
|
),
|
|
5769
|
-
footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */
|
|
5819
|
+
footer: actions.length > 0 || index > 1 && Boolean(onPrev) ? /* @__PURE__ */ jsx66(ActionBar, { actions, index, total, onPrev }) : void 0,
|
|
5770
5820
|
children: [
|
|
5771
|
-
/* @__PURE__ */
|
|
5821
|
+
/* @__PURE__ */ jsx66(
|
|
5772
5822
|
ReadingPage,
|
|
5773
5823
|
{
|
|
5774
5824
|
data,
|
|
@@ -5786,7 +5836,7 @@ function ReadingComprehension({
|
|
|
5786
5836
|
onPick: model.pick
|
|
5787
5837
|
}
|
|
5788
5838
|
),
|
|
5789
|
-
/* @__PURE__ */
|
|
5839
|
+
/* @__PURE__ */ jsx66(Toast, { children: model.notice })
|
|
5790
5840
|
]
|
|
5791
5841
|
}
|
|
5792
5842
|
);
|
|
@@ -5796,67 +5846,69 @@ function ReadingComprehension({
|
|
|
5796
5846
|
function listenTaskActions({
|
|
5797
5847
|
feedback,
|
|
5798
5848
|
completed,
|
|
5799
|
-
|
|
5849
|
+
readonly,
|
|
5850
|
+
labels,
|
|
5800
5851
|
onSubmit,
|
|
5801
5852
|
onNext
|
|
5802
5853
|
}) {
|
|
5803
5854
|
const actions = [];
|
|
5804
5855
|
if (feedback) {
|
|
5805
|
-
actions.push({ key: "
|
|
5806
|
-
actions.push({ key: "next", label: "\u5B8C\u6210\u5E76\u8FD4\u56DE", onClick: onNext });
|
|
5856
|
+
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
5807
5857
|
} else {
|
|
5808
5858
|
actions.push({
|
|
5809
5859
|
key: "submit",
|
|
5810
5860
|
label: "\u63D0\u4EA4\u5E76\u67E5\u770B\u7EDF\u8BA1",
|
|
5811
5861
|
onClick: onSubmit,
|
|
5812
|
-
disabled: !completed
|
|
5862
|
+
disabled: !completed || readonly
|
|
5813
5863
|
});
|
|
5814
5864
|
}
|
|
5815
5865
|
return actions;
|
|
5816
5866
|
}
|
|
5817
5867
|
|
|
5818
5868
|
// src/questions/listen-task/feedback.tsx
|
|
5819
|
-
import { Fragment as
|
|
5869
|
+
import { Fragment as Fragment17, jsx as jsx67, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5820
5870
|
function ListenFeedback({
|
|
5821
5871
|
data,
|
|
5822
|
-
|
|
5823
|
-
|
|
5872
|
+
tracks,
|
|
5873
|
+
overall,
|
|
5874
|
+
timeOnTask
|
|
5824
5875
|
}) {
|
|
5825
|
-
var _a;
|
|
5876
|
+
var _a, _b;
|
|
5826
5877
|
const stats = (_a = data.stats) != null ? _a : [
|
|
5827
5878
|
{
|
|
5828
5879
|
label: "\u542C\u97F3\u9891\u65F6\u957F",
|
|
5829
|
-
value: /* @__PURE__ */
|
|
5830
|
-
(
|
|
5831
|
-
/* @__PURE__ */
|
|
5880
|
+
value: /* @__PURE__ */ jsxs50(Fragment17, { children: [
|
|
5881
|
+
(timeOnTask / 60).toFixed(1),
|
|
5882
|
+
/* @__PURE__ */ jsx67("small", { children: "min" })
|
|
5832
5883
|
] })
|
|
5833
5884
|
},
|
|
5834
5885
|
{
|
|
5835
5886
|
label: "\u97F3\u9891\u6570\u91CF",
|
|
5836
|
-
value: /* @__PURE__ */
|
|
5837
|
-
|
|
5838
|
-
/* @__PURE__ */
|
|
5887
|
+
value: /* @__PURE__ */ jsxs50(Fragment17, { children: [
|
|
5888
|
+
tracks.length,
|
|
5889
|
+
/* @__PURE__ */ jsx67("small", { children: "\u6BB5" })
|
|
5839
5890
|
] })
|
|
5840
5891
|
},
|
|
5841
5892
|
{
|
|
5842
5893
|
label: "\u5B8C\u6210\u5EA6",
|
|
5843
|
-
value: /* @__PURE__ */
|
|
5844
|
-
|
|
5845
|
-
/* @__PURE__ */
|
|
5894
|
+
value: /* @__PURE__ */ jsxs50(Fragment17, { children: [
|
|
5895
|
+
overall,
|
|
5896
|
+
/* @__PURE__ */ jsx67("small", { children: "%" })
|
|
5846
5897
|
] })
|
|
5847
5898
|
}
|
|
5848
5899
|
];
|
|
5849
|
-
return /* @__PURE__ */
|
|
5850
|
-
/* @__PURE__ */
|
|
5851
|
-
/* @__PURE__ */
|
|
5852
|
-
/* @__PURE__ */
|
|
5853
|
-
|
|
5854
|
-
|
|
5900
|
+
return /* @__PURE__ */ jsxs50("div", { className: "rqk-listen-feedback", children: [
|
|
5901
|
+
/* @__PURE__ */ jsx67(Art, { name: "trophy", className: "rqk-listen-feedback-art" }),
|
|
5902
|
+
/* @__PURE__ */ jsx67("h2", { className: "rqk-listen-feedback-title", children: (_b = data.finishTitle) != null ? _b : "\u542C\u529B\u5B8C\u6210" }),
|
|
5903
|
+
/* @__PURE__ */ jsxs50("p", { className: "rqk-listen-feedback-sub", children: [
|
|
5904
|
+
tracks.length,
|
|
5905
|
+
" \u6BB5\u97F3\u9891\u5168\u90E8\u5B8C\u6210 \xB7 \u6709\u6548\u64AD\u653E ",
|
|
5906
|
+
overall,
|
|
5855
5907
|
"%"
|
|
5856
5908
|
] }),
|
|
5857
|
-
/* @__PURE__ */
|
|
5858
|
-
/* @__PURE__ */
|
|
5859
|
-
/* @__PURE__ */
|
|
5909
|
+
/* @__PURE__ */ jsx67("div", { className: "rqk-listen-stats", children: stats.map((stat, statIndex) => /* @__PURE__ */ jsxs50("div", { className: "rqk-listen-stat", children: [
|
|
5910
|
+
/* @__PURE__ */ jsx67("span", { className: "rqk-listen-stat-value", children: stat.value }),
|
|
5911
|
+
/* @__PURE__ */ jsx67("span", { className: "rqk-listen-stat-label", children: stat.label })
|
|
5860
5912
|
] }, statIndex)) })
|
|
5861
5913
|
] });
|
|
5862
5914
|
}
|
|
@@ -5870,27 +5922,56 @@ function isArtName(value) {
|
|
|
5870
5922
|
}
|
|
5871
5923
|
|
|
5872
5924
|
// src/questions/listen-task/listen-hero.tsx
|
|
5873
|
-
import { jsx as
|
|
5874
|
-
function ListenHero({ data }) {
|
|
5875
|
-
return /* @__PURE__ */
|
|
5876
|
-
/* @__PURE__ */
|
|
5877
|
-
data.cover && isArtName(data.cover) ? /* @__PURE__ */
|
|
5878
|
-
data.badge ? /* @__PURE__ */
|
|
5925
|
+
import { jsx as jsx68, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5926
|
+
function ListenHero({ data, compact = false }) {
|
|
5927
|
+
return /* @__PURE__ */ jsxs51(Card, { className: classNames("rqk-listen-hero", compact && "rqk-is-compact"), children: [
|
|
5928
|
+
/* @__PURE__ */ jsxs51("div", { className: "rqk-listen-art", children: [
|
|
5929
|
+
data.cover && isArtName(data.cover) ? /* @__PURE__ */ jsx68(Art, { name: data.cover, className: "rqk-listen-cover-art" }) : data.cover ? /* @__PURE__ */ jsx68("img", { className: "rqk-listen-cover-img", src: data.cover, alt: "" }) : /* @__PURE__ */ jsx68(Art, { name: "headphones", className: "rqk-listen-cover-art" }),
|
|
5930
|
+
data.badge ? /* @__PURE__ */ jsx68("span", { className: "rqk-listen-badge", children: data.badge }) : null
|
|
5879
5931
|
] }),
|
|
5880
|
-
/* @__PURE__ */
|
|
5881
|
-
/* @__PURE__ */
|
|
5882
|
-
data.subtitle ? /* @__PURE__ */
|
|
5932
|
+
/* @__PURE__ */ jsxs51("div", { className: "rqk-listen-meta", children: [
|
|
5933
|
+
/* @__PURE__ */ jsx68("div", { className: "rqk-listen-name", children: data.title }),
|
|
5934
|
+
data.subtitle ? /* @__PURE__ */ jsx68("div", { className: "rqk-listen-subtitle", children: data.subtitle }) : null
|
|
5883
5935
|
] })
|
|
5884
5936
|
] });
|
|
5885
5937
|
}
|
|
5886
5938
|
|
|
5939
|
+
// src/questions/listen-task/listen-list.tsx
|
|
5940
|
+
import { jsx as jsx69, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5941
|
+
function ListenList({
|
|
5942
|
+
tracks,
|
|
5943
|
+
current,
|
|
5944
|
+
done,
|
|
5945
|
+
readonly,
|
|
5946
|
+
onSelect
|
|
5947
|
+
}) {
|
|
5948
|
+
return /* @__PURE__ */ jsx69("div", { className: "rqk-listen-list", children: tracks.map((track, trackIndex) => /* @__PURE__ */ jsxs52(
|
|
5949
|
+
"button",
|
|
5950
|
+
{
|
|
5951
|
+
type: "button",
|
|
5952
|
+
className: classNames("rqk-listen-item", trackIndex === current && "rqk-is-current"),
|
|
5953
|
+
disabled: readonly,
|
|
5954
|
+
onClick: () => onSelect(trackIndex),
|
|
5955
|
+
children: [
|
|
5956
|
+
/* @__PURE__ */ jsx69("span", { className: "rqk-listen-item-no", children: trackIndex + 1 }),
|
|
5957
|
+
/* @__PURE__ */ jsxs52("span", { className: "rqk-listen-item-text", children: [
|
|
5958
|
+
track.title,
|
|
5959
|
+
/* @__PURE__ */ jsx69("small", { children: trackIndex === current ? "\u5F53\u524D\u97F3\u9891" : `\u65F6\u957F ${formatTime(track.duration)}` })
|
|
5960
|
+
] }),
|
|
5961
|
+
done(trackIndex) ? /* @__PURE__ */ jsx69("span", { className: "rqk-listen-item-ok", children: "\u2713" }) : null
|
|
5962
|
+
]
|
|
5963
|
+
},
|
|
5964
|
+
trackIndex
|
|
5965
|
+
)) });
|
|
5966
|
+
}
|
|
5967
|
+
|
|
5887
5968
|
// src/questions/listen-task/listen-ring.tsx
|
|
5888
|
-
import { jsx as
|
|
5969
|
+
import { jsx as jsx70, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
5889
5970
|
function ListenRing({ percent }) {
|
|
5890
|
-
return /* @__PURE__ */
|
|
5891
|
-
/* @__PURE__ */
|
|
5892
|
-
/* @__PURE__ */
|
|
5893
|
-
/* @__PURE__ */
|
|
5971
|
+
return /* @__PURE__ */ jsxs53("div", { className: "rqk-listen-ring", children: [
|
|
5972
|
+
/* @__PURE__ */ jsxs53("svg", { width: "48", height: "48", viewBox: "0 0 48 48", "aria-hidden": true, children: [
|
|
5973
|
+
/* @__PURE__ */ jsx70("circle", { className: "rqk-listen-ring-bg", cx: "24", cy: "24", r: "20" }),
|
|
5974
|
+
/* @__PURE__ */ jsx70(
|
|
5894
5975
|
"circle",
|
|
5895
5976
|
{
|
|
5896
5977
|
className: "rqk-listen-ring-fg",
|
|
@@ -5902,7 +5983,7 @@ function ListenRing({ percent }) {
|
|
|
5902
5983
|
}
|
|
5903
5984
|
)
|
|
5904
5985
|
] }),
|
|
5905
|
-
/* @__PURE__ */
|
|
5986
|
+
/* @__PURE__ */ jsxs53("span", { className: classNames("rqk-listen-ring-text", percent >= 100 && "rqk-is-full"), children: [
|
|
5906
5987
|
percent,
|
|
5907
5988
|
"%"
|
|
5908
5989
|
] })
|
|
@@ -5910,107 +5991,111 @@ function ListenRing({ percent }) {
|
|
|
5910
5991
|
}
|
|
5911
5992
|
|
|
5912
5993
|
// src/questions/listen-task/listen-player.tsx
|
|
5913
|
-
import { Fragment as
|
|
5914
|
-
function ListenPlayer({
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5994
|
+
import { Fragment as Fragment18, jsx as jsx71, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
5995
|
+
function ListenPlayer({ model }) {
|
|
5996
|
+
var _a;
|
|
5997
|
+
const track = model.track;
|
|
5998
|
+
if (!track) return null;
|
|
5999
|
+
const percent = model.percentFor(model.current);
|
|
6000
|
+
const credit = (_a = model.credits[model.current]) != null ? _a : 0;
|
|
6001
|
+
const duration = Math.max(track.duration, 0);
|
|
6002
|
+
const ratio = duration ? Math.min(1, model.position / duration) : 0;
|
|
6003
|
+
return /* @__PURE__ */ jsxs54("div", { className: "rqk-listen-player", children: [
|
|
6004
|
+
/* @__PURE__ */ jsxs54("div", { className: "rqk-listen-top", children: [
|
|
6005
|
+
/* @__PURE__ */ jsx71(
|
|
5922
6006
|
"button",
|
|
5923
6007
|
{
|
|
5924
6008
|
type: "button",
|
|
5925
6009
|
className: "rqk-listen-play",
|
|
5926
|
-
onClick:
|
|
5927
|
-
"aria-label":
|
|
5928
|
-
children:
|
|
6010
|
+
onClick: model.toggle,
|
|
6011
|
+
"aria-label": model.playing ? "\u6682\u505C" : "\u64AD\u653E",
|
|
6012
|
+
children: model.playing ? /* @__PURE__ */ jsx71(PauseIcon, {}) : /* @__PURE__ */ jsx71(PlayIcon, {})
|
|
5929
6013
|
}
|
|
5930
6014
|
),
|
|
5931
|
-
/* @__PURE__ */
|
|
5932
|
-
/* @__PURE__ */
|
|
5933
|
-
/* @__PURE__ */
|
|
6015
|
+
/* @__PURE__ */ jsxs54("div", { className: "rqk-listen-info", children: [
|
|
6016
|
+
/* @__PURE__ */ jsx71("span", { className: "rqk-listen-state", children: model.playing ? "\u6B63\u5728\u64AD\u653E\u2026" : model.finished ? "\u64AD\u653E\u5B8C\u6BD5" : "\u5DF2\u6682\u505C" }),
|
|
6017
|
+
/* @__PURE__ */ jsx71("span", { className: "rqk-listen-hint", children: model.tracks.length > 1 ? `\u7B2C ${model.current + 1} \u6BB5 \xB7 \u5171 ${model.tracks.length} \u6BB5` : model.playing ? "\u64AD\u653E\u4E2D\u2026" : "\u70B9\u51FB\u64AD\u653E" })
|
|
5934
6018
|
] })
|
|
5935
6019
|
] }),
|
|
5936
|
-
/* @__PURE__ */
|
|
6020
|
+
/* @__PURE__ */ jsxs54(
|
|
5937
6021
|
"div",
|
|
5938
6022
|
{
|
|
5939
6023
|
className: "rqk-listen-track",
|
|
5940
6024
|
onPointerDown: (event) => {
|
|
6025
|
+
if (model.readonly) return;
|
|
5941
6026
|
const rect = event.currentTarget.getBoundingClientRect();
|
|
5942
|
-
const
|
|
5943
|
-
|
|
6027
|
+
const next = Math.min(1, Math.max(0, (event.clientX - rect.left) / rect.width));
|
|
6028
|
+
model.seek(next * duration);
|
|
5944
6029
|
},
|
|
5945
6030
|
children: [
|
|
5946
|
-
/* @__PURE__ */
|
|
5947
|
-
/* @__PURE__ */
|
|
5948
|
-
|
|
5949
|
-
{
|
|
5950
|
-
className: "rqk-listen-fill",
|
|
5951
|
-
style: { width: `${progress.position / data.duration * 100}%` }
|
|
5952
|
-
}
|
|
5953
|
-
),
|
|
5954
|
-
/* @__PURE__ */ jsx69(
|
|
5955
|
-
"div",
|
|
5956
|
-
{
|
|
5957
|
-
className: "rqk-listen-knob",
|
|
5958
|
-
style: { left: `${progress.position / data.duration * 100}%` }
|
|
5959
|
-
}
|
|
5960
|
-
)
|
|
6031
|
+
/* @__PURE__ */ jsx71("div", { className: "rqk-listen-buffer" }),
|
|
6032
|
+
/* @__PURE__ */ jsx71("div", { className: "rqk-listen-fill", style: { width: `${ratio * 100}%` } }),
|
|
6033
|
+
/* @__PURE__ */ jsx71("div", { className: "rqk-listen-knob", style: { left: `${ratio * 100}%` } })
|
|
5961
6034
|
]
|
|
5962
6035
|
}
|
|
5963
6036
|
),
|
|
5964
|
-
/* @__PURE__ */
|
|
5965
|
-
/* @__PURE__ */
|
|
5966
|
-
/* @__PURE__ */
|
|
6037
|
+
/* @__PURE__ */ jsxs54("div", { className: "rqk-listen-times", children: [
|
|
6038
|
+
/* @__PURE__ */ jsx71("span", { children: formatTime(model.position) }),
|
|
6039
|
+
/* @__PURE__ */ jsx71("span", { children: formatTime(duration) })
|
|
5967
6040
|
] }),
|
|
5968
|
-
/* @__PURE__ */
|
|
5969
|
-
/* @__PURE__ */
|
|
6041
|
+
/* @__PURE__ */ jsxs54("div", { className: "rqk-listen-controls", children: [
|
|
6042
|
+
/* @__PURE__ */ jsxs54(
|
|
5970
6043
|
"button",
|
|
5971
6044
|
{
|
|
5972
6045
|
type: "button",
|
|
5973
|
-
className: classNames("rqk-listen-loop",
|
|
5974
|
-
|
|
6046
|
+
className: classNames("rqk-listen-loop", model.loop && "rqk-is-on"),
|
|
6047
|
+
disabled: model.readonly,
|
|
6048
|
+
onClick: () => model.setLoop(!model.loop),
|
|
5975
6049
|
children: [
|
|
5976
|
-
/* @__PURE__ */
|
|
6050
|
+
/* @__PURE__ */ jsx71(LoopIcon, {}),
|
|
5977
6051
|
"\u5FAA\u73AF"
|
|
5978
6052
|
]
|
|
5979
6053
|
}
|
|
5980
6054
|
),
|
|
5981
|
-
/* @__PURE__ */
|
|
6055
|
+
/* @__PURE__ */ jsx71(
|
|
5982
6056
|
SegmentedControl,
|
|
5983
6057
|
{
|
|
5984
6058
|
ariaLabel: "\u64AD\u653E\u901F\u5EA6",
|
|
5985
6059
|
className: "rqk-listen-speeds",
|
|
5986
6060
|
options: SPEED_OPTIONS,
|
|
5987
|
-
value: `${
|
|
5988
|
-
|
|
6061
|
+
value: `${model.speed}`,
|
|
6062
|
+
disabled: model.readonly,
|
|
6063
|
+
onChange: (value) => model.setSpeed(Number(value))
|
|
5989
6064
|
}
|
|
5990
6065
|
)
|
|
5991
6066
|
] }),
|
|
5992
|
-
/* @__PURE__ */
|
|
5993
|
-
/* @__PURE__ */
|
|
5994
|
-
/* @__PURE__ */
|
|
6067
|
+
/* @__PURE__ */ jsxs54("div", { className: "rqk-listen-progress", children: [
|
|
6068
|
+
/* @__PURE__ */ jsx71(ListenRing, { percent }),
|
|
6069
|
+
/* @__PURE__ */ jsx71("div", { className: "rqk-listen-credit", children: Math.abs(model.position - credit) > 0.75 ? /* @__PURE__ */ jsxs54(Fragment18, { children: [
|
|
5995
6070
|
"\u64AD\u653E ",
|
|
5996
|
-
/* @__PURE__ */
|
|
6071
|
+
/* @__PURE__ */ jsx71("b", { children: formatTime(model.position) }),
|
|
5997
6072
|
" / ",
|
|
5998
|
-
formatTime(
|
|
5999
|
-
/* @__PURE__ */
|
|
6073
|
+
formatTime(duration),
|
|
6074
|
+
/* @__PURE__ */ jsx71("span", { className: "rqk-listen-credit-sep", children: "\xB7" }),
|
|
6000
6075
|
"\u6709\u6548 ",
|
|
6001
|
-
/* @__PURE__ */
|
|
6002
|
-
] }) : /* @__PURE__ */
|
|
6076
|
+
/* @__PURE__ */ jsx71("b", { children: formatTime(credit) })
|
|
6077
|
+
] }) : /* @__PURE__ */ jsxs54(Fragment18, { children: [
|
|
6003
6078
|
"\u6709\u6548\u64AD\u653E ",
|
|
6004
|
-
/* @__PURE__ */
|
|
6079
|
+
/* @__PURE__ */ jsx71("b", { children: formatTime(credit) }),
|
|
6005
6080
|
" / ",
|
|
6006
|
-
formatTime(
|
|
6081
|
+
formatTime(duration)
|
|
6007
6082
|
] }) })
|
|
6008
6083
|
] }),
|
|
6009
|
-
|
|
6084
|
+
model.tracks.length > 1 ? /* @__PURE__ */ jsx71(
|
|
6085
|
+
ListenList,
|
|
6086
|
+
{
|
|
6087
|
+
tracks: model.tracks,
|
|
6088
|
+
current: model.current,
|
|
6089
|
+
done: model.done,
|
|
6090
|
+
readonly: model.readonly,
|
|
6091
|
+
onSelect: model.selectTrack
|
|
6092
|
+
}
|
|
6093
|
+
) : null,
|
|
6094
|
+
track.audio ? /* @__PURE__ */ jsx71(
|
|
6010
6095
|
"audio",
|
|
6011
6096
|
{
|
|
6012
|
-
ref:
|
|
6013
|
-
src:
|
|
6097
|
+
ref: model.audioRef,
|
|
6098
|
+
src: track.audio,
|
|
6014
6099
|
preload: "metadata"
|
|
6015
6100
|
}
|
|
6016
6101
|
) : null
|
|
@@ -6018,33 +6103,223 @@ function ListenPlayer({
|
|
|
6018
6103
|
}
|
|
6019
6104
|
|
|
6020
6105
|
// src/questions/listen-task/use-listen-task.ts
|
|
6021
|
-
import { useState as useState24 } from "react";
|
|
6022
|
-
|
|
6106
|
+
import { useEffect as useEffect17, useMemo as useMemo5, useRef as useRef13, useState as useState24 } from "react";
|
|
6107
|
+
var TICK_MS2 = 100;
|
|
6108
|
+
function useListenTask({
|
|
6109
|
+
data,
|
|
6110
|
+
onSubmit,
|
|
6111
|
+
mode = "answer",
|
|
6112
|
+
initialRatios
|
|
6113
|
+
}) {
|
|
6114
|
+
var _a, _b, _c, _d, _e;
|
|
6115
|
+
const tracks = useMemo5(() => {
|
|
6116
|
+
var _a2, _b2;
|
|
6117
|
+
if ((_a2 = data.audios) == null ? void 0 : _a2.length) return data.audios;
|
|
6118
|
+
return [{ title: data.title, audio: data.audio, duration: (_b2 = data.duration) != null ? _b2 : 0 }];
|
|
6119
|
+
}, [data]);
|
|
6120
|
+
const readonly = mode === "lookup" || mode === "preview";
|
|
6121
|
+
const ratios = tracks.map(
|
|
6122
|
+
(_, index) => {
|
|
6123
|
+
var _a2;
|
|
6124
|
+
return Math.min(1, Math.max(0, (_a2 = initialRatios == null ? void 0 : initialRatios[index]) != null ? _a2 : 0));
|
|
6125
|
+
}
|
|
6126
|
+
);
|
|
6127
|
+
const secondsFor = (ratio, track2) => Math.min(track2.duration, Math.max(0, ratio * track2.duration));
|
|
6128
|
+
const initial = tracks.map((track2, index) => secondsFor(ratios[index], track2));
|
|
6023
6129
|
const [view, setView] = useState24("task");
|
|
6024
|
-
const
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
const
|
|
6130
|
+
const [current, setCurrent] = useState24(0);
|
|
6131
|
+
const [position, setPosition] = useState24((_a = initial[0]) != null ? _a : 0);
|
|
6132
|
+
const [credits, setCredits] = useState24(initial);
|
|
6133
|
+
const [playing, setPlaying] = useState24(false);
|
|
6134
|
+
const [finished, setFinished] = useState24(false);
|
|
6135
|
+
const [speed, setSpeedState] = useState24(1);
|
|
6136
|
+
const [loop, setLoopState] = useState24(false);
|
|
6137
|
+
const [timeOnTask, setTimeOnTask] = useState24(0);
|
|
6138
|
+
const audioRef = useRef13(null);
|
|
6139
|
+
const positionRef = useRef13((_b = initial[0]) != null ? _b : 0);
|
|
6140
|
+
const creditRef = useRef13((_c = initial[0]) != null ? _c : 0);
|
|
6141
|
+
const playingRef = useRef13(false);
|
|
6142
|
+
const speedRef = useRef13(1);
|
|
6143
|
+
const loopRef = useRef13(false);
|
|
6144
|
+
const track = (_d = tracks[current]) != null ? _d : tracks[0];
|
|
6145
|
+
const duration = (_e = track == null ? void 0 : track.duration) != null ? _e : 0;
|
|
6146
|
+
useEffect17(() => {
|
|
6147
|
+
var _a2;
|
|
6148
|
+
const next = tracks.map((t, i) => secondsFor(ratios[i], t));
|
|
6149
|
+
setCredits(next);
|
|
6150
|
+
const credit = (_a2 = next[current]) != null ? _a2 : 0;
|
|
6151
|
+
creditRef.current = credit;
|
|
6152
|
+
positionRef.current = Math.min(track.duration, credit);
|
|
6153
|
+
setPosition(positionRef.current);
|
|
6154
|
+
}, [tracks]);
|
|
6155
|
+
const applyPosition = (value) => {
|
|
6156
|
+
const next = Math.min(duration, Math.max(0, value));
|
|
6157
|
+
positionRef.current = next;
|
|
6158
|
+
setPosition(next);
|
|
6159
|
+
};
|
|
6160
|
+
const applyCredit = (value) => {
|
|
6161
|
+
const next = Math.min(duration, Math.max(0, value));
|
|
6162
|
+
creditRef.current = next;
|
|
6163
|
+
setCredits((values) => values.map((item, itemIndex) => itemIndex === current ? next : item));
|
|
6164
|
+
};
|
|
6165
|
+
const pause = () => {
|
|
6166
|
+
var _a2;
|
|
6167
|
+
playingRef.current = false;
|
|
6168
|
+
setPlaying(false);
|
|
6169
|
+
(_a2 = audioRef.current) == null ? void 0 : _a2.pause();
|
|
6170
|
+
};
|
|
6171
|
+
const toggle = () => {
|
|
6172
|
+
var _a2;
|
|
6173
|
+
if (playingRef.current) {
|
|
6174
|
+
pause();
|
|
6175
|
+
return;
|
|
6176
|
+
}
|
|
6177
|
+
if (positionRef.current >= duration) {
|
|
6178
|
+
applyPosition(0);
|
|
6179
|
+
setFinished(false);
|
|
6180
|
+
}
|
|
6181
|
+
playingRef.current = true;
|
|
6182
|
+
setPlaying(true);
|
|
6183
|
+
if (track == null ? void 0 : track.audio) void ((_a2 = audioRef.current) == null ? void 0 : _a2.play().catch(() => void 0));
|
|
6184
|
+
};
|
|
6185
|
+
const seek = (seconds) => {
|
|
6186
|
+
if (readonly) return;
|
|
6187
|
+
applyPosition(seconds);
|
|
6188
|
+
if (seconds < duration) setFinished(false);
|
|
6189
|
+
if (audioRef.current) audioRef.current.currentTime = Math.max(0, Math.min(duration, seconds));
|
|
6190
|
+
};
|
|
6191
|
+
const setSpeed = (value) => {
|
|
6192
|
+
if (readonly) return;
|
|
6193
|
+
speedRef.current = value;
|
|
6194
|
+
setSpeedState(value);
|
|
6195
|
+
if (audioRef.current) audioRef.current.playbackRate = value;
|
|
6196
|
+
};
|
|
6197
|
+
const setLoop = (value) => {
|
|
6198
|
+
if (readonly) return;
|
|
6199
|
+
loopRef.current = value;
|
|
6200
|
+
setLoopState(value);
|
|
6201
|
+
if (audioRef.current) audioRef.current.loop = value;
|
|
6202
|
+
};
|
|
6203
|
+
const selectTrack = (trackIndex) => {
|
|
6204
|
+
var _a2, _b2;
|
|
6205
|
+
if (readonly || trackIndex === current) return;
|
|
6206
|
+
playingRef.current = false;
|
|
6207
|
+
setPlaying(false);
|
|
6208
|
+
setFinished(false);
|
|
6209
|
+
(_a2 = audioRef.current) == null ? void 0 : _a2.pause();
|
|
6210
|
+
setCurrent(trackIndex);
|
|
6211
|
+
positionRef.current = 0;
|
|
6212
|
+
creditRef.current = (_b2 = credits[trackIndex]) != null ? _b2 : 0;
|
|
6213
|
+
setPosition(0);
|
|
6214
|
+
};
|
|
6215
|
+
useEffect17(() => {
|
|
6216
|
+
if ((track == null ? void 0 : track.audio) || !playing) return void 0;
|
|
6217
|
+
const timer = window.setInterval(() => {
|
|
6218
|
+
if (!playingRef.current) return;
|
|
6219
|
+
const delta = TICK_MS2 / 1e3 * speedRef.current;
|
|
6220
|
+
let next = positionRef.current + delta;
|
|
6221
|
+
let stopped = false;
|
|
6222
|
+
if (next >= duration) {
|
|
6223
|
+
if (loopRef.current && duration > 0) {
|
|
6224
|
+
next -= duration;
|
|
6225
|
+
} else {
|
|
6226
|
+
next = duration;
|
|
6227
|
+
stopped = true;
|
|
6228
|
+
}
|
|
6229
|
+
}
|
|
6230
|
+
applyPosition(next);
|
|
6231
|
+
applyCredit(creditRef.current + delta);
|
|
6232
|
+
setTimeOnTask((value) => value + TICK_MS2 / 1e3);
|
|
6233
|
+
if (stopped) {
|
|
6234
|
+
playingRef.current = false;
|
|
6235
|
+
setPlaying(false);
|
|
6236
|
+
setFinished(true);
|
|
6237
|
+
}
|
|
6238
|
+
}, TICK_MS2);
|
|
6239
|
+
return () => window.clearInterval(timer);
|
|
6240
|
+
}, [duration, playing, track == null ? void 0 : track.audio]);
|
|
6241
|
+
useEffect17(() => {
|
|
6242
|
+
const media = audioRef.current;
|
|
6243
|
+
if (!media || !(track == null ? void 0 : track.audio)) return void 0;
|
|
6244
|
+
media.playbackRate = speedRef.current;
|
|
6245
|
+
media.loop = loopRef.current;
|
|
6246
|
+
const handleTime = () => {
|
|
6247
|
+
const next = media.currentTime;
|
|
6248
|
+
const delta = next - positionRef.current;
|
|
6249
|
+
if (delta > 0 && delta < 1.2) {
|
|
6250
|
+
applyCredit(creditRef.current + delta);
|
|
6251
|
+
setTimeOnTask((value) => value + delta);
|
|
6252
|
+
}
|
|
6253
|
+
applyPosition(next);
|
|
6254
|
+
};
|
|
6255
|
+
const handleEnded = () => {
|
|
6256
|
+
setFinished(true);
|
|
6257
|
+
if (!loopRef.current) {
|
|
6258
|
+
playingRef.current = false;
|
|
6259
|
+
setPlaying(false);
|
|
6260
|
+
}
|
|
6261
|
+
};
|
|
6262
|
+
media.addEventListener("timeupdate", handleTime);
|
|
6263
|
+
media.addEventListener("ended", handleEnded);
|
|
6264
|
+
return () => {
|
|
6265
|
+
media.removeEventListener("timeupdate", handleTime);
|
|
6266
|
+
media.removeEventListener("ended", handleEnded);
|
|
6267
|
+
};
|
|
6268
|
+
}, [current, track == null ? void 0 : track.audio]);
|
|
6269
|
+
const percentFor = (trackIndex) => {
|
|
6270
|
+
var _a2;
|
|
6271
|
+
const item = tracks[trackIndex];
|
|
6272
|
+
if (!item || item.duration <= 0) return 0;
|
|
6273
|
+
return Math.min(100, Math.round(((_a2 = credits[trackIndex]) != null ? _a2 : 0) / item.duration * 100));
|
|
6274
|
+
};
|
|
6275
|
+
const done = (trackIndex) => percentFor(trackIndex) >= 90;
|
|
6276
|
+
const allDone = tracks.every((_item, trackIndex) => done(trackIndex));
|
|
6277
|
+
const overall = Math.round(
|
|
6278
|
+
tracks.reduce(
|
|
6279
|
+
(sum, item, trackIndex) => {
|
|
6280
|
+
var _a2;
|
|
6281
|
+
return sum + (item.duration > 0 ? Math.min(1, ((_a2 = credits[trackIndex]) != null ? _a2 : 0) / item.duration) : 0);
|
|
6282
|
+
},
|
|
6283
|
+
0
|
|
6284
|
+
) / tracks.length * 100
|
|
6285
|
+
);
|
|
6030
6286
|
const handleSubmit = () => {
|
|
6031
6287
|
setView("feedback");
|
|
6032
6288
|
onSubmit == null ? void 0 : onSubmit({
|
|
6033
6289
|
correct: true,
|
|
6034
6290
|
attempts: 1,
|
|
6035
|
-
answer: {
|
|
6291
|
+
answer: { credits }
|
|
6036
6292
|
});
|
|
6037
6293
|
};
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6294
|
+
return {
|
|
6295
|
+
allDone,
|
|
6296
|
+
audioRef,
|
|
6297
|
+
credits,
|
|
6298
|
+
current,
|
|
6299
|
+
done,
|
|
6300
|
+
finished,
|
|
6301
|
+
handleSubmit,
|
|
6302
|
+
loop,
|
|
6303
|
+
overall,
|
|
6304
|
+
percentFor,
|
|
6305
|
+
playing,
|
|
6306
|
+
position,
|
|
6307
|
+
readonly,
|
|
6308
|
+
selectTrack,
|
|
6309
|
+
setLoop,
|
|
6310
|
+
setSpeed,
|
|
6311
|
+
speed,
|
|
6312
|
+
timeOnTask,
|
|
6313
|
+
toggle,
|
|
6314
|
+
track,
|
|
6315
|
+
tracks,
|
|
6316
|
+
view,
|
|
6317
|
+
seek
|
|
6042
6318
|
};
|
|
6043
|
-
return { handleSubmit, percent, progress, replay, view };
|
|
6044
6319
|
}
|
|
6045
6320
|
|
|
6046
6321
|
// src/questions/listen-task/index.tsx
|
|
6047
|
-
import { Fragment as
|
|
6322
|
+
import { Fragment as Fragment19, jsx as jsx72, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
6048
6323
|
function ListenTask({
|
|
6049
6324
|
data,
|
|
6050
6325
|
mode = "answer",
|
|
@@ -6056,35 +6331,50 @@ function ListenTask({
|
|
|
6056
6331
|
onPrev,
|
|
6057
6332
|
onNext,
|
|
6058
6333
|
onSubmit,
|
|
6059
|
-
|
|
6334
|
+
bare,
|
|
6335
|
+
className,
|
|
6336
|
+
initialRatios
|
|
6060
6337
|
}) {
|
|
6061
|
-
const
|
|
6338
|
+
const labels = useQuestLabels();
|
|
6339
|
+
const model = useListenTask({ data, onSubmit, mode, initialRatios });
|
|
6062
6340
|
const actions = listenTaskActions({
|
|
6063
6341
|
feedback: model.view === "feedback",
|
|
6064
|
-
completed: model.
|
|
6065
|
-
|
|
6342
|
+
completed: model.allDone,
|
|
6343
|
+
readonly: model.readonly,
|
|
6344
|
+
labels,
|
|
6066
6345
|
onSubmit: model.handleSubmit,
|
|
6067
6346
|
onNext
|
|
6068
6347
|
});
|
|
6069
|
-
return /* @__PURE__ */
|
|
6348
|
+
return /* @__PURE__ */ jsx72(
|
|
6070
6349
|
QuestShell,
|
|
6071
6350
|
{
|
|
6072
6351
|
mode,
|
|
6073
6352
|
title: title != null ? title : model.view === "feedback" ? "\u542C\u529B\u7EDF\u8BA1" : "\u542C\u529B\u4EFB\u52A1",
|
|
6074
6353
|
index,
|
|
6075
6354
|
total,
|
|
6076
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */
|
|
6077
|
-
"\u542C\u5B8C\u97F3\u9891\
|
|
6078
|
-
|
|
6079
|
-
" \
|
|
6355
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs55(Fragment19, { children: [
|
|
6356
|
+
model.tracks.length > 1 ? "\u542C\u5B8C\u6BCF\u6BB5\u97F3\u9891" : "\u542C\u5B8C\u97F3\u9891",
|
|
6357
|
+
"\uFF0C\u6709\u6548\u64AD\u653E ",
|
|
6358
|
+
/* @__PURE__ */ jsx72("b", { children: "\u226590%" }),
|
|
6359
|
+
" ",
|
|
6360
|
+
"\u89C6\u4E3A\u5B8C\u6210"
|
|
6080
6361
|
] }),
|
|
6081
6362
|
onBack,
|
|
6363
|
+
bare,
|
|
6082
6364
|
className: classNames("rqk-quest", "rqk-listen", className),
|
|
6083
6365
|
dataQuest: "listen-task",
|
|
6084
|
-
footer: /* @__PURE__ */
|
|
6085
|
-
children: model.view === "feedback" ? /* @__PURE__ */
|
|
6086
|
-
|
|
6087
|
-
|
|
6366
|
+
footer: /* @__PURE__ */ jsx72(ActionBar, { actions, index, total, onPrev }),
|
|
6367
|
+
children: model.view === "feedback" ? /* @__PURE__ */ jsx72(
|
|
6368
|
+
ListenFeedback,
|
|
6369
|
+
{
|
|
6370
|
+
data,
|
|
6371
|
+
tracks: model.tracks,
|
|
6372
|
+
overall: model.overall,
|
|
6373
|
+
timeOnTask: model.timeOnTask
|
|
6374
|
+
}
|
|
6375
|
+
) : /* @__PURE__ */ jsxs55(Fragment19, { children: [
|
|
6376
|
+
/* @__PURE__ */ jsx72(ListenHero, { data, compact: model.tracks.length > 1 }),
|
|
6377
|
+
/* @__PURE__ */ jsx72(ListenPlayer, { model })
|
|
6088
6378
|
] })
|
|
6089
6379
|
}
|
|
6090
6380
|
);
|
|
@@ -6094,14 +6384,13 @@ function ListenTask({
|
|
|
6094
6384
|
function videoTaskActions({
|
|
6095
6385
|
feedback,
|
|
6096
6386
|
allDone,
|
|
6097
|
-
|
|
6387
|
+
labels,
|
|
6098
6388
|
onSubmit,
|
|
6099
6389
|
onNext
|
|
6100
6390
|
}) {
|
|
6101
6391
|
const actions = [];
|
|
6102
6392
|
if (feedback) {
|
|
6103
|
-
actions.push({ key: "
|
|
6104
|
-
actions.push({ key: "next", label: "\u5B8C\u6210\u5E76\u8FD4\u56DE", onClick: onNext });
|
|
6393
|
+
actions.push({ key: "next", label: labels.next, onClick: onNext });
|
|
6105
6394
|
} else {
|
|
6106
6395
|
actions.push({
|
|
6107
6396
|
key: "submit",
|
|
@@ -6114,7 +6403,7 @@ function videoTaskActions({
|
|
|
6114
6403
|
}
|
|
6115
6404
|
|
|
6116
6405
|
// src/questions/video-task/feedback.tsx
|
|
6117
|
-
import { Fragment as
|
|
6406
|
+
import { Fragment as Fragment20, jsx as jsx73, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
6118
6407
|
function VideoFeedback({
|
|
6119
6408
|
data,
|
|
6120
6409
|
overall,
|
|
@@ -6124,63 +6413,63 @@ function VideoFeedback({
|
|
|
6124
6413
|
const stats = (_a = data.stats) != null ? _a : [
|
|
6125
6414
|
{
|
|
6126
6415
|
label: "\u89C2\u770B\u65F6\u957F",
|
|
6127
|
-
value: /* @__PURE__ */
|
|
6416
|
+
value: /* @__PURE__ */ jsxs56(Fragment20, { children: [
|
|
6128
6417
|
(timeOnTask / 60).toFixed(1),
|
|
6129
|
-
/* @__PURE__ */
|
|
6418
|
+
/* @__PURE__ */ jsx73("small", { children: "min" })
|
|
6130
6419
|
] })
|
|
6131
6420
|
},
|
|
6132
6421
|
{
|
|
6133
6422
|
label: "\u89C6\u9891\u6570\u91CF",
|
|
6134
|
-
value: /* @__PURE__ */
|
|
6423
|
+
value: /* @__PURE__ */ jsxs56(Fragment20, { children: [
|
|
6135
6424
|
data.videos.length,
|
|
6136
|
-
/* @__PURE__ */
|
|
6425
|
+
/* @__PURE__ */ jsx73("small", { children: "\u4E2A" })
|
|
6137
6426
|
] })
|
|
6138
6427
|
},
|
|
6139
6428
|
{
|
|
6140
6429
|
label: "\u5B8C\u6210\u5EA6",
|
|
6141
|
-
value: /* @__PURE__ */
|
|
6430
|
+
value: /* @__PURE__ */ jsxs56(Fragment20, { children: [
|
|
6142
6431
|
overall,
|
|
6143
|
-
/* @__PURE__ */
|
|
6432
|
+
/* @__PURE__ */ jsx73("small", { children: "%" })
|
|
6144
6433
|
] })
|
|
6145
6434
|
}
|
|
6146
6435
|
];
|
|
6147
|
-
return /* @__PURE__ */
|
|
6148
|
-
/* @__PURE__ */
|
|
6149
|
-
/* @__PURE__ */
|
|
6150
|
-
/* @__PURE__ */
|
|
6436
|
+
return /* @__PURE__ */ jsxs56("div", { className: "rqk-video-feedback", children: [
|
|
6437
|
+
/* @__PURE__ */ jsx73(Art, { name: "trophy", className: "rqk-video-feedback-art" }),
|
|
6438
|
+
/* @__PURE__ */ jsx73("h2", { className: "rqk-video-feedback-title", children: (_b = data.finishTitle) != null ? _b : "\u89C6\u9891\u770B\u5B8C\u5566" }),
|
|
6439
|
+
/* @__PURE__ */ jsxs56("p", { className: "rqk-video-feedback-sub", children: [
|
|
6151
6440
|
data.videos.length,
|
|
6152
6441
|
" \u4E2A\u89C6\u9891\u5168\u90E8\u5B8C\u6210 \xB7 \u6709\u6548\u89C2\u770B ",
|
|
6153
6442
|
overall,
|
|
6154
6443
|
"%"
|
|
6155
6444
|
] }),
|
|
6156
|
-
/* @__PURE__ */
|
|
6157
|
-
/* @__PURE__ */
|
|
6158
|
-
/* @__PURE__ */
|
|
6445
|
+
/* @__PURE__ */ jsx73("div", { className: "rqk-video-stats", children: stats.map((stat, statIndex) => /* @__PURE__ */ jsxs56("div", { className: "rqk-video-stat", children: [
|
|
6446
|
+
/* @__PURE__ */ jsx73("span", { className: "rqk-video-stat-value", children: stat.value }),
|
|
6447
|
+
/* @__PURE__ */ jsx73("span", { className: "rqk-video-stat-label", children: stat.label })
|
|
6159
6448
|
] }, statIndex)) })
|
|
6160
6449
|
] });
|
|
6161
6450
|
}
|
|
6162
6451
|
|
|
6163
6452
|
// src/questions/video-task/video-list.tsx
|
|
6164
|
-
import { jsx as
|
|
6453
|
+
import { jsx as jsx74, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
6165
6454
|
function VideoList({
|
|
6166
6455
|
data,
|
|
6167
6456
|
current,
|
|
6168
6457
|
done,
|
|
6169
6458
|
onSelect
|
|
6170
6459
|
}) {
|
|
6171
|
-
return /* @__PURE__ */
|
|
6460
|
+
return /* @__PURE__ */ jsx74("div", { className: "rqk-video-list", children: data.videos.map((item, videoIndex) => /* @__PURE__ */ jsxs57(
|
|
6172
6461
|
"button",
|
|
6173
6462
|
{
|
|
6174
6463
|
type: "button",
|
|
6175
6464
|
className: classNames("rqk-video-item", videoIndex === current && "rqk-is-current"),
|
|
6176
6465
|
onClick: () => onSelect(videoIndex),
|
|
6177
6466
|
children: [
|
|
6178
|
-
/* @__PURE__ */
|
|
6179
|
-
/* @__PURE__ */
|
|
6467
|
+
/* @__PURE__ */ jsx74("span", { className: "rqk-video-item-no", children: videoIndex + 1 }),
|
|
6468
|
+
/* @__PURE__ */ jsxs57("span", { className: "rqk-video-item-text", children: [
|
|
6180
6469
|
item.title,
|
|
6181
|
-
/* @__PURE__ */
|
|
6470
|
+
/* @__PURE__ */ jsx74("small", { children: videoIndex === current ? "\u6B63\u5728\u89C2\u770B" : `\u65F6\u957F ${formatTime(item.duration)}` })
|
|
6182
6471
|
] }),
|
|
6183
|
-
done(videoIndex) ? /* @__PURE__ */
|
|
6472
|
+
done(videoIndex) ? /* @__PURE__ */ jsx74("span", { className: "rqk-video-item-ok", children: "\u2713" }) : null
|
|
6184
6473
|
]
|
|
6185
6474
|
},
|
|
6186
6475
|
videoIndex
|
|
@@ -6188,12 +6477,12 @@ function VideoList({
|
|
|
6188
6477
|
}
|
|
6189
6478
|
|
|
6190
6479
|
// src/questions/video-task/video-ring.tsx
|
|
6191
|
-
import { jsx as
|
|
6480
|
+
import { jsx as jsx75, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
6192
6481
|
function VideoRing({ percent }) {
|
|
6193
|
-
return /* @__PURE__ */
|
|
6194
|
-
/* @__PURE__ */
|
|
6195
|
-
/* @__PURE__ */
|
|
6196
|
-
/* @__PURE__ */
|
|
6482
|
+
return /* @__PURE__ */ jsxs58("div", { className: "rqk-video-ring", children: [
|
|
6483
|
+
/* @__PURE__ */ jsxs58("svg", { width: "48", height: "48", viewBox: "0 0 48 48", "aria-hidden": true, children: [
|
|
6484
|
+
/* @__PURE__ */ jsx75("circle", { className: "rqk-video-ring-bg", cx: "24", cy: "24", r: "20" }),
|
|
6485
|
+
/* @__PURE__ */ jsx75(
|
|
6197
6486
|
"circle",
|
|
6198
6487
|
{
|
|
6199
6488
|
className: "rqk-video-ring-fg",
|
|
@@ -6206,7 +6495,7 @@ function VideoRing({ percent }) {
|
|
|
6206
6495
|
}
|
|
6207
6496
|
)
|
|
6208
6497
|
] }),
|
|
6209
|
-
/* @__PURE__ */
|
|
6498
|
+
/* @__PURE__ */ jsxs58("span", { className: classNames("rqk-video-ring-text", percent >= 100 && "rqk-is-full"), children: [
|
|
6210
6499
|
percent,
|
|
6211
6500
|
"%"
|
|
6212
6501
|
] })
|
|
@@ -6214,7 +6503,7 @@ function VideoRing({ percent }) {
|
|
|
6214
6503
|
}
|
|
6215
6504
|
|
|
6216
6505
|
// src/questions/video-task/video-controls.tsx
|
|
6217
|
-
import { Fragment as
|
|
6506
|
+
import { Fragment as Fragment21, jsx as jsx76, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6218
6507
|
function VideoControls({
|
|
6219
6508
|
data,
|
|
6220
6509
|
video,
|
|
@@ -6231,24 +6520,24 @@ function VideoControls({
|
|
|
6231
6520
|
applyPosition
|
|
6232
6521
|
}) {
|
|
6233
6522
|
var _a, _b, _c;
|
|
6234
|
-
return /* @__PURE__ */
|
|
6235
|
-
/* @__PURE__ */
|
|
6236
|
-
/* @__PURE__ */
|
|
6523
|
+
return /* @__PURE__ */ jsxs59(Card, { className: "rqk-video-controls", children: [
|
|
6524
|
+
/* @__PURE__ */ jsxs59("div", { className: "rqk-video-ctrl", children: [
|
|
6525
|
+
/* @__PURE__ */ jsx76(
|
|
6237
6526
|
"button",
|
|
6238
6527
|
{
|
|
6239
6528
|
type: "button",
|
|
6240
6529
|
className: "rqk-video-mini",
|
|
6241
6530
|
onClick: onToggle,
|
|
6242
6531
|
"aria-label": playing ? "\u6682\u505C" : "\u64AD\u653E",
|
|
6243
|
-
children: playing ? /* @__PURE__ */
|
|
6532
|
+
children: playing ? /* @__PURE__ */ jsx76(PauseIcon, {}) : /* @__PURE__ */ jsx76(PlayIcon, {})
|
|
6244
6533
|
}
|
|
6245
6534
|
),
|
|
6246
|
-
/* @__PURE__ */
|
|
6247
|
-
/* @__PURE__ */
|
|
6248
|
-
/* @__PURE__ */
|
|
6249
|
-
/* @__PURE__ */
|
|
6535
|
+
/* @__PURE__ */ jsxs59("div", { className: "rqk-video-scrub", children: [
|
|
6536
|
+
/* @__PURE__ */ jsxs59("div", { className: "rqk-video-times", children: [
|
|
6537
|
+
/* @__PURE__ */ jsx76("span", { children: formatTime(position) }),
|
|
6538
|
+
/* @__PURE__ */ jsx76("span", { children: formatTime(video.duration) })
|
|
6250
6539
|
] }),
|
|
6251
|
-
/* @__PURE__ */
|
|
6540
|
+
/* @__PURE__ */ jsxs59(
|
|
6252
6541
|
"div",
|
|
6253
6542
|
{
|
|
6254
6543
|
className: "rqk-video-track",
|
|
@@ -6258,14 +6547,14 @@ function VideoControls({
|
|
|
6258
6547
|
applyPosition(ratio * video.duration);
|
|
6259
6548
|
},
|
|
6260
6549
|
children: [
|
|
6261
|
-
/* @__PURE__ */
|
|
6550
|
+
/* @__PURE__ */ jsx76(
|
|
6262
6551
|
"div",
|
|
6263
6552
|
{
|
|
6264
6553
|
className: "rqk-video-fill",
|
|
6265
6554
|
style: { width: `${position / video.duration * 100}%` }
|
|
6266
6555
|
}
|
|
6267
6556
|
),
|
|
6268
|
-
/* @__PURE__ */
|
|
6557
|
+
/* @__PURE__ */ jsx76(
|
|
6269
6558
|
"div",
|
|
6270
6559
|
{
|
|
6271
6560
|
className: "rqk-video-knob",
|
|
@@ -6276,40 +6565,40 @@ function VideoControls({
|
|
|
6276
6565
|
}
|
|
6277
6566
|
)
|
|
6278
6567
|
] }),
|
|
6279
|
-
/* @__PURE__ */
|
|
6568
|
+
/* @__PURE__ */ jsx76(
|
|
6280
6569
|
"button",
|
|
6281
6570
|
{
|
|
6282
6571
|
type: "button",
|
|
6283
6572
|
className: classNames("rqk-video-mini", fullscreen && "rqk-is-on"),
|
|
6284
6573
|
onClick: onFullscreen,
|
|
6285
6574
|
"aria-label": "\u5207\u6362\u5168\u5C4F",
|
|
6286
|
-
children: /* @__PURE__ */
|
|
6575
|
+
children: /* @__PURE__ */ jsx76(FullscreenIcon, {})
|
|
6287
6576
|
}
|
|
6288
6577
|
)
|
|
6289
6578
|
] }),
|
|
6290
|
-
/* @__PURE__ */
|
|
6291
|
-
/* @__PURE__ */
|
|
6292
|
-
/* @__PURE__ */
|
|
6579
|
+
/* @__PURE__ */ jsxs59("div", { className: "rqk-video-progress", children: [
|
|
6580
|
+
/* @__PURE__ */ jsx76(VideoRing, { percent: percentFor(current) }),
|
|
6581
|
+
/* @__PURE__ */ jsx76("div", { className: "rqk-video-credit", children: Math.abs(position - ((_a = credits[current]) != null ? _a : 0)) > 0.75 ? /* @__PURE__ */ jsxs59(Fragment21, { children: [
|
|
6293
6582
|
"\u64AD\u653E ",
|
|
6294
|
-
/* @__PURE__ */
|
|
6583
|
+
/* @__PURE__ */ jsx76("b", { children: formatTime(position) }),
|
|
6295
6584
|
" / ",
|
|
6296
6585
|
formatTime(video.duration),
|
|
6297
|
-
/* @__PURE__ */
|
|
6586
|
+
/* @__PURE__ */ jsx76("span", { className: "rqk-video-credit-sep", children: "\xB7" }),
|
|
6298
6587
|
"\u6709\u6548 ",
|
|
6299
|
-
/* @__PURE__ */
|
|
6300
|
-
] }) : /* @__PURE__ */
|
|
6588
|
+
/* @__PURE__ */ jsx76("b", { children: formatTime((_b = credits[current]) != null ? _b : 0) })
|
|
6589
|
+
] }) : /* @__PURE__ */ jsxs59(Fragment21, { children: [
|
|
6301
6590
|
"\u6709\u6548\u89C2\u770B ",
|
|
6302
|
-
/* @__PURE__ */
|
|
6591
|
+
/* @__PURE__ */ jsx76("b", { children: formatTime((_c = credits[current]) != null ? _c : 0) }),
|
|
6303
6592
|
" / ",
|
|
6304
6593
|
formatTime(video.duration)
|
|
6305
6594
|
] }) })
|
|
6306
6595
|
] }),
|
|
6307
|
-
/* @__PURE__ */
|
|
6596
|
+
/* @__PURE__ */ jsx76(VideoList, { data, current, done, onSelect })
|
|
6308
6597
|
] });
|
|
6309
6598
|
}
|
|
6310
6599
|
|
|
6311
6600
|
// src/questions/video-task/video-stage.tsx
|
|
6312
|
-
import { jsx as
|
|
6601
|
+
import { jsx as jsx77, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
6313
6602
|
function VideoStage({
|
|
6314
6603
|
video,
|
|
6315
6604
|
position,
|
|
@@ -6319,15 +6608,15 @@ function VideoStage({
|
|
|
6319
6608
|
onToggle,
|
|
6320
6609
|
onStageFullscreen
|
|
6321
6610
|
}) {
|
|
6322
|
-
const cover = video.poster ? /* @__PURE__ */
|
|
6323
|
-
return /* @__PURE__ */
|
|
6324
|
-
/* @__PURE__ */
|
|
6325
|
-
/* @__PURE__ */
|
|
6326
|
-
playing ? null : /* @__PURE__ */
|
|
6327
|
-
/* @__PURE__ */
|
|
6328
|
-
/* @__PURE__ */
|
|
6329
|
-
/* @__PURE__ */
|
|
6330
|
-
video.src ? /* @__PURE__ */
|
|
6611
|
+
const cover = video.poster ? /* @__PURE__ */ jsx77("img", { className: "rqk-video-poster", src: video.poster, alt: "" }) : /* @__PURE__ */ jsx77(Art, { name: "screen", className: "rqk-video-cover-art" });
|
|
6612
|
+
return /* @__PURE__ */ jsxs60("div", { className: classNames("rqk-video-stage", fullscreen && "rqk-is-fullscreen"), children: [
|
|
6613
|
+
/* @__PURE__ */ jsx77("div", { className: "rqk-video-cover", children: cover }),
|
|
6614
|
+
/* @__PURE__ */ jsx77("div", { className: "rqk-video-dim" }),
|
|
6615
|
+
playing ? null : /* @__PURE__ */ jsx77("button", { type: "button", className: "rqk-video-bigplay", onClick: onToggle, "aria-label": "\u64AD\u653E", children: /* @__PURE__ */ jsx77(PlayIcon, {}) }),
|
|
6616
|
+
/* @__PURE__ */ jsx77("span", { className: "rqk-video-duration", children: formatTime(video.duration) }),
|
|
6617
|
+
/* @__PURE__ */ jsx77("button", { type: "button", className: "rqk-video-fs", onClick: onStageFullscreen, "aria-label": "\u5168\u5C4F", children: /* @__PURE__ */ jsx77(FullscreenIcon, {}) }),
|
|
6618
|
+
/* @__PURE__ */ jsx77("div", { className: "rqk-video-nowbar", children: /* @__PURE__ */ jsx77("i", { style: { width: `${position / video.duration * 100}%` } }) }),
|
|
6619
|
+
video.src ? /* @__PURE__ */ jsx77(
|
|
6331
6620
|
"video",
|
|
6332
6621
|
{
|
|
6333
6622
|
ref: (element) => {
|
|
@@ -6343,13 +6632,13 @@ function VideoStage({
|
|
|
6343
6632
|
}
|
|
6344
6633
|
|
|
6345
6634
|
// src/questions/video-task/use-video-task.ts
|
|
6346
|
-
import { useRef as
|
|
6635
|
+
import { useRef as useRef14, useState as useState25 } from "react";
|
|
6347
6636
|
|
|
6348
6637
|
// src/questions/video-task/use-video-clock.ts
|
|
6349
|
-
import { useEffect as
|
|
6638
|
+
import { useEffect as useEffect18 } from "react";
|
|
6350
6639
|
|
|
6351
6640
|
// src/questions/video-task/constants.ts
|
|
6352
|
-
var
|
|
6641
|
+
var TICK_MS3 = 100;
|
|
6353
6642
|
|
|
6354
6643
|
// src/questions/video-task/use-video-clock.ts
|
|
6355
6644
|
function useVideoClock({
|
|
@@ -6366,17 +6655,17 @@ function useVideoClock({
|
|
|
6366
6655
|
setPosition,
|
|
6367
6656
|
setTimeOnTask
|
|
6368
6657
|
}) {
|
|
6369
|
-
|
|
6658
|
+
useEffect18(() => {
|
|
6370
6659
|
positionRef.current = 0;
|
|
6371
6660
|
setPosition(0);
|
|
6372
6661
|
setPlaying(false);
|
|
6373
6662
|
playingRef.current = false;
|
|
6374
6663
|
}, [current]);
|
|
6375
|
-
|
|
6664
|
+
useEffect18(() => {
|
|
6376
6665
|
if (video.src || !playing) return void 0;
|
|
6377
6666
|
const timer = window.setInterval(() => {
|
|
6378
6667
|
if (!playingRef.current) return;
|
|
6379
|
-
const delta =
|
|
6668
|
+
const delta = TICK_MS3 / 1e3;
|
|
6380
6669
|
const next = positionRef.current + delta;
|
|
6381
6670
|
applyPosition(next);
|
|
6382
6671
|
applyCredit(creditRef.current + delta);
|
|
@@ -6385,10 +6674,10 @@ function useVideoClock({
|
|
|
6385
6674
|
playingRef.current = false;
|
|
6386
6675
|
setPlaying(false);
|
|
6387
6676
|
}
|
|
6388
|
-
},
|
|
6677
|
+
}, TICK_MS3);
|
|
6389
6678
|
return () => window.clearInterval(timer);
|
|
6390
6679
|
}, [playing, video.duration, video.src]);
|
|
6391
|
-
|
|
6680
|
+
useEffect18(() => {
|
|
6392
6681
|
const element = videoRef.current;
|
|
6393
6682
|
if (!element || !video.src) return void 0;
|
|
6394
6683
|
const handleTime = () => {
|
|
@@ -6423,10 +6712,10 @@ function useVideoTask({ data, onSubmit }) {
|
|
|
6423
6712
|
const [playing, setPlaying] = useState25(false);
|
|
6424
6713
|
const [timeOnTask, setTimeOnTask] = useState25(0);
|
|
6425
6714
|
const [fullscreen, setFullscreen] = useState25(false);
|
|
6426
|
-
const videoRef =
|
|
6427
|
-
const positionRef =
|
|
6428
|
-
const creditRef =
|
|
6429
|
-
const playingRef =
|
|
6715
|
+
const videoRef = useRef14(null);
|
|
6716
|
+
const positionRef = useRef14(0);
|
|
6717
|
+
const creditRef = useRef14(0);
|
|
6718
|
+
const playingRef = useRef14(false);
|
|
6430
6719
|
const video = (_a = data.videos[current]) != null ? _a : data.videos[0];
|
|
6431
6720
|
const applyPosition = (value) => {
|
|
6432
6721
|
const next = Math.min(video.duration, Math.max(0, value));
|
|
@@ -6501,10 +6790,6 @@ function useVideoTask({ data, onSubmit }) {
|
|
|
6501
6790
|
answer: { credits }
|
|
6502
6791
|
});
|
|
6503
6792
|
};
|
|
6504
|
-
const replay = () => {
|
|
6505
|
-
setView("task");
|
|
6506
|
-
applyPosition(0);
|
|
6507
|
-
};
|
|
6508
6793
|
const toggleStageFullscreen = () => {
|
|
6509
6794
|
var _a2, _b, _c, _d;
|
|
6510
6795
|
setFullscreen((value) => !value);
|
|
@@ -6526,7 +6811,6 @@ function useVideoTask({ data, onSubmit }) {
|
|
|
6526
6811
|
percentFor,
|
|
6527
6812
|
playing,
|
|
6528
6813
|
position,
|
|
6529
|
-
replay,
|
|
6530
6814
|
selectVideo,
|
|
6531
6815
|
setFullscreen,
|
|
6532
6816
|
timeOnTask,
|
|
@@ -6539,7 +6823,7 @@ function useVideoTask({ data, onSubmit }) {
|
|
|
6539
6823
|
}
|
|
6540
6824
|
|
|
6541
6825
|
// src/questions/video-task/index.tsx
|
|
6542
|
-
import { Fragment as
|
|
6826
|
+
import { Fragment as Fragment22, jsx as jsx78, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6543
6827
|
function VideoTask({
|
|
6544
6828
|
data,
|
|
6545
6829
|
mode = "answer",
|
|
@@ -6553,32 +6837,33 @@ function VideoTask({
|
|
|
6553
6837
|
onSubmit,
|
|
6554
6838
|
className
|
|
6555
6839
|
}) {
|
|
6840
|
+
const labels = useQuestLabels();
|
|
6556
6841
|
const model = useVideoTask({ data, onSubmit });
|
|
6557
6842
|
const actions = videoTaskActions({
|
|
6558
6843
|
feedback: model.view === "feedback",
|
|
6559
6844
|
allDone: model.allDone,
|
|
6560
|
-
|
|
6845
|
+
labels,
|
|
6561
6846
|
onSubmit: model.handleSubmit,
|
|
6562
6847
|
onNext
|
|
6563
6848
|
});
|
|
6564
|
-
return /* @__PURE__ */
|
|
6849
|
+
return /* @__PURE__ */ jsx78(
|
|
6565
6850
|
QuestShell,
|
|
6566
6851
|
{
|
|
6567
6852
|
mode,
|
|
6568
6853
|
title: title != null ? title : model.view === "feedback" ? "\u89C6\u9891\u7EDF\u8BA1" : "\u89C6\u9891\u4EFB\u52A1",
|
|
6569
6854
|
index,
|
|
6570
6855
|
total,
|
|
6571
|
-
instruction: instruction != null ? instruction : /* @__PURE__ */
|
|
6856
|
+
instruction: instruction != null ? instruction : /* @__PURE__ */ jsxs61(Fragment22, { children: [
|
|
6572
6857
|
"\u89C2\u770B\u89C6\u9891\uFF0C\u6709\u6548\u89C2\u770B ",
|
|
6573
|
-
/* @__PURE__ */
|
|
6858
|
+
/* @__PURE__ */ jsx78("b", { children: "\u226590%" }),
|
|
6574
6859
|
" \u89C6\u4E3A\u5B8C\u6210"
|
|
6575
6860
|
] }),
|
|
6576
6861
|
onBack,
|
|
6577
6862
|
className: classNames("rqk-quest", "rqk-video", className),
|
|
6578
6863
|
dataQuest: "video-task",
|
|
6579
|
-
footer: /* @__PURE__ */
|
|
6580
|
-
children: model.view === "feedback" ? /* @__PURE__ */
|
|
6581
|
-
/* @__PURE__ */
|
|
6864
|
+
footer: /* @__PURE__ */ jsx78(ActionBar, { actions, index, total, onPrev }),
|
|
6865
|
+
children: model.view === "feedback" ? /* @__PURE__ */ jsx78(VideoFeedback, { data, overall: model.overall, timeOnTask: model.timeOnTask }) : /* @__PURE__ */ jsxs61(Fragment22, { children: [
|
|
6866
|
+
/* @__PURE__ */ jsx78(
|
|
6582
6867
|
VideoStage,
|
|
6583
6868
|
{
|
|
6584
6869
|
video: model.video,
|
|
@@ -6590,7 +6875,7 @@ function VideoTask({
|
|
|
6590
6875
|
onStageFullscreen: model.toggleStageFullscreen
|
|
6591
6876
|
}
|
|
6592
6877
|
),
|
|
6593
|
-
/* @__PURE__ */
|
|
6878
|
+
/* @__PURE__ */ jsx78(
|
|
6594
6879
|
VideoControls,
|
|
6595
6880
|
{
|
|
6596
6881
|
data,
|
|
@@ -6614,7 +6899,7 @@ function VideoTask({
|
|
|
6614
6899
|
}
|
|
6615
6900
|
|
|
6616
6901
|
// src/primitives/blank-input.tsx
|
|
6617
|
-
import { jsx as
|
|
6902
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
6618
6903
|
function BlankInput2({
|
|
6619
6904
|
value,
|
|
6620
6905
|
onChange,
|
|
@@ -6629,7 +6914,7 @@ function BlankInput2({
|
|
|
6629
6914
|
var _a;
|
|
6630
6915
|
const measured = Math.max(value.length, (_a = placeholder == null ? void 0 : placeholder.length) != null ? _a : 0, minCh);
|
|
6631
6916
|
const width = `${Math.min(18, Math.max(minCh, measured))}ch`;
|
|
6632
|
-
return /* @__PURE__ */
|
|
6917
|
+
return /* @__PURE__ */ jsx79(
|
|
6633
6918
|
"input",
|
|
6634
6919
|
{
|
|
6635
6920
|
className: classNames(
|
|
@@ -6652,10 +6937,11 @@ function BlankInput2({
|
|
|
6652
6937
|
}
|
|
6653
6938
|
|
|
6654
6939
|
// src/index.tsx
|
|
6655
|
-
var version = "1.0.
|
|
6940
|
+
var version = "1.0.5";
|
|
6656
6941
|
var questkit = {
|
|
6657
6942
|
version,
|
|
6658
6943
|
QuestShell,
|
|
6944
|
+
QuestComplete,
|
|
6659
6945
|
OptionItem,
|
|
6660
6946
|
FeedbackSheet,
|
|
6661
6947
|
Instruction,
|
|
@@ -6696,6 +6982,7 @@ export {
|
|
|
6696
6982
|
OptionItem,
|
|
6697
6983
|
PictureBox,
|
|
6698
6984
|
Progress,
|
|
6985
|
+
QuestComplete,
|
|
6699
6986
|
QuestConfigProvider,
|
|
6700
6987
|
QuestConfigProvider as QuestProvider,
|
|
6701
6988
|
QuestShell,
|