From 5ce33f3edf18893079e2e72b8f73e301f9ed2091 Mon Sep 17 00:00:00 2001 From: jacobxu666 Date: Thu, 20 Aug 2026 14:57:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8=E5=AD=98=E9=87=8F?= =?UTF-8?q?=20rubric=20=E5=BE=BD=E6=A0=87/=E9=A2=98=E5=9E=8B=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=B8=85=E7=90=86/=E5=88=86=E5=80=BC=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E4=BF=AE=E5=A4=8D(=E6=9C=80=E7=BB=88=E5=A4=8D?= =?UTF-8?q?=E6=A0=B8=20R1-R3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Haiku 4.5 --- src/app/parent/exams/question-list.test.tsx | 12 ++++++++++++ src/app/parent/exams/question-list.tsx | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/app/parent/exams/question-list.test.tsx b/src/app/parent/exams/question-list.test.tsx index 8dd2407..3bdbc24 100644 --- a/src/app/parent/exams/question-list.test.tsx +++ b/src/app/parent/exams/question-list.test.tsx @@ -61,6 +61,18 @@ describe("QuestionList 结构化编辑", () => { expect(screen.getByText("AI 逐评分点判分(存量题,保留原评分点)")).toBeInTheDocument(); }); + it("编辑存量无 judgeMode 字段的题显示 AI 判分徽标与必填参考解答语义", () => { + render( + {}} + />, + ); + fireEvent.click(screen.getByLabelText("编辑第 1 题")); + expect(screen.getByText("AI 逐评分点判分(存量题,保留原评分点)")).toBeInTheDocument(); + expect(screen.getByText("参考解答(完整解题过程,展示给孩子)")).toBeInTheDocument(); + }); + it("题干为空保存时报错,不写入列表", async () => { const user = userEvent.setup(); let saved: QuizQ[] = []; diff --git a/src/app/parent/exams/question-list.tsx b/src/app/parent/exams/question-list.tsx index 13efd26..bb8ad06 100644 --- a/src/app/parent/exams/question-list.tsx +++ b/src/app/parent/exams/question-list.tsx @@ -110,7 +110,7 @@ export function QuestionList({ aria-label="题型" onChange={(e) => { const t = e.target.value as QuizQ["type"]; - update({ type: t, options: undefined, answers: undefined, reference: undefined, judgeMode: undefined, points: undefined, ...(t === "solve" ? { judgeMode: "answer", points: 10 } : {}) }); + update({ type: t, options: undefined, answers: undefined, reference: undefined, rubric: undefined, judgeMode: undefined, points: undefined, ...(t === "solve" ? { judgeMode: "answer", points: 10 } : {}) }); }} className="ml-2 h-8 rounded-lg border border-slate-200 bg-white px-2 text-sm" > @@ -205,15 +205,16 @@ export function QuestionList({ aria-label="分值" type="number" min={1} - value={draft.points ?? 10} + placeholder="10" + value={draft.points ?? ""} onChange={(e) => update({ points: Number(e.target.value) || undefined })} />
- {draft.judgeMode === "rubric" ? "AI 逐评分点判分(存量题,保留原评分点)" : "仅最终答案(秒判)"} + {draft.judgeMode === "answer" ? "仅最终答案(秒判)" : "AI 逐评分点判分(存量题,保留原评分点)"}
- + update({ reference: e.target.value })} />