From 6d7838a210a41900351865e006cd8c1c6c65a70b Mon Sep 17 00:00:00 2001 From: SpecialX <47072643+wangxiner55@users.noreply.github.com> Date: Mon, 22 Jun 2026 18:37:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor(exams,homework,proctoring):=20?= =?UTF-8?q?=E5=AE=A1=E8=AE=A1=E9=87=8D=E6=9E=84=20=E2=80=94=20=E8=B7=A8?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=A7=A3=E8=80=A6=20+=20=E6=9D=83=E9=99=90?= =?UTF-8?q?=20+=20i18n=20+=20a11y=20+=20=E5=8D=95=E6=B5=8B=20+=20=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完成考试与作业模块深度审计的全部 10 项改进: P0-3: 拆分 ai-pipeline.ts (927 行) 为 parse/request/structure/index 四个职责模块 P1-6: 抽取 QuestionRenderer 组件 (mode prop 驱动 take/preview/grade 三态) P1-7: 抽取 question-content-utils 纯函数模块 (14 个纯函数 + applyAutoGrades 泛型) P1-8: 拆分 homework data-access 为 data-access.ts + data-access-classes.ts P2-9: 集成 useDebouncedAutoSave (防抖自动保存 + localStorage 离线缓存 + 状态指示器) P2-12: a11y 修复 (难度色条 role=img + aria-label, 题目导航 aria-pressed + title) P2-13: ExamHomeworkRoleConfig 配置驱动角色渲染 (6 角色 × 11 功能 + 并集合并) 6.1: ExamHomeworkServicePort 接口 + ServiceProvider 单例注册表 6.5: 63 个单测 (52 question-content-utils + 11 role-config) 6.7: trackExamEvent 监控埋点 (17 个新事件 + 便捷函数) 同步更新 005 架构数据文档与 v2 审计报告 --- .../components/teacher-dashboard/teacher-homework-card.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/dashboard/components/teacher-dashboard/teacher-homework-card.tsx b/src/modules/dashboard/components/teacher-dashboard/teacher-homework-card.tsx index 24a3312..908d41e 100644 --- a/src/modules/dashboard/components/teacher-dashboard/teacher-homework-card.tsx +++ b/src/modules/dashboard/components/teacher-dashboard/teacher-homework-card.tsx @@ -1,6 +1,6 @@ import Link from "next/link" import { PenTool, Calendar, Plus } from "lucide-react" -import { getTranslations } from "next-intl/server" +import { getTranslations, getLocale } from "next-intl/server" import { Badge } from "@/shared/components/ui/badge" import { Button } from "@/shared/components/ui/button" @@ -11,6 +11,7 @@ import type { HomeworkAssignmentListItem } from "@/modules/homework/types" export async function TeacherHomeworkCard({ assignments }: { assignments: HomeworkAssignmentListItem[] }) { const t = await getTranslations("dashboard") + const locale = await getLocale() return ( @@ -19,7 +20,7 @@ export async function TeacherHomeworkCard({ assignments }: { assignments: Homewo {t("sections.homework")} -