feat(portal-shell): exams 三子页面迁移(analytics/build/edit)

§9.1 教师域 exams 模块补完(继 d066da5 列表/详情/表单后):
- /shell/teacher/exams/[id]/analytics:详情页(图表)- 混合契约
  · 基础统计  assignmentAnalysis(data-ana 子图,schema 已就绪)
  · 扩展字段(排名/每题正确率) MSW 兜底(@contract-pending)
  · 含 Summary/Distribution/QuestionAccuracy/Rankings 四区
- /shell/teacher/exams/[id]/build:工作台页(组卷)@contract-pending
  · 三栏:题库候选 / 已选题目 / 预览
  · 支持搜索/类型/难度筛选,添加/移除/上移/下移/改分
- /shell/teacher/exams/[id]/edit:工作台页(富文本试卷)@contract-pending
  · contentEditable + 工具栏(B/I/U/H1-H3/列表)
  · 右栏试卷属性面板

§11.3 DoD 11 项验收:
1. route-permissions:PREFIX 表 /shell/teacher/exams/ 已覆盖
2. 页面模板:analytics 用 DetailPageShell;build/edit 用 WorkbenchPageShell
3. 三态:loading/error/empty 均实现(workbench 用 errorNode 合并 empty)
4. lib/api hooks:useExamAnalytics/useExamBuild/useQuestionsLibrary/
   useSaveExamBuild/useExamRichEditor/useSaveExamRichContent 6 个
5. @contract-pending MSW 模式:graphql-data.ts 扩展 6 个 case
6. i18n:analytics(19 keys)+build(28 keys)+edit(13 keys) 中英对齐
7. lint:0 errors(4 warnings 在 __generated__)
8. lint:tokens:0 errors
9. notify:success/error/warning 走 @/shared/lib/notify(非 sonner 直引)
10. vitest:transformations 新增 10 函数 22 测试,全量 273/273 通过
11. typecheck:0 errors(noUncheckedIndexedAccess 安全 swap 写法)

剩余:proctoring 标注"二期 WS"按 §9.1 暂缓。
This commit is contained in:
SpecialX
2026-07-22 17:35:54 +08:00
parent d066da563f
commit dca25fc42f
14 changed files with 2467 additions and 0 deletions

View File

@@ -210,6 +210,95 @@
"errorTitleRequired": "Please fill in exam title",
"errorDateRequired": "Please select exam date",
"contractPending": "Create exam contract is @contract-pending, currently backed by MSW. Will switch to real submission once backend mutation is ready."
},
"analytics": {
"title": "Exam Analytics",
"subtitle": "Exam ID: {examId}",
"exportCsv": "Export CSV",
"notFound": "No analytics data found, grading may not be complete",
"sectionSummary": "Summary",
"sectionDistribution": "Score Distribution",
"sectionQuestionAccuracy": "Question Accuracy",
"sectionRankings": "Student Rankings",
"summaryExpected": "Expected",
"summaryAttended": "Attended",
"summaryAvg": "Average",
"summaryMax": "Max",
"summaryMin": "Min",
"summaryPassRate": "Pass Rate",
"emptyDistribution": "No score distribution data",
"emptyQuestionAccuracy": "No question accuracy data",
"emptyRankings": "No ranking data",
"colOrder": "#",
"colQuestionTitle": "Question",
"colCorrectRate": "Correct Rate",
"colAvgScore": "Avg Score",
"colMaxScore": "Max Score",
"colRank": "Rank",
"colStudentNo": "Student No.",
"colStudentName": "Name",
"colTotalScore": "Total Score",
"colLevel": "Level"
},
"build": {
"title": "Build Exam",
"subtitle": "Current total: {total} pts · Pass score: {pass} pts",
"save": "Save Build",
"saveSuccess": "Build saved successfully",
"saveFailed": "Save failed: {message}",
"notFound": "No build data found",
"alreadyAdded": "This question has already been added",
"libraryTitle": "Question Library",
"searchPlaceholder": "Search question content...",
"filterType": "Filter by type",
"filterDifficulty": "Filter by difficulty",
"allTypes": "All types",
"allDifficulties": "All difficulties",
"typeSingle": "Single Choice",
"typeMultiple": "Multiple Choice",
"typeFill": "Fill in the Blank",
"typeEssay": "Essay",
"diffEasy": "Easy",
"diffMedium": "Medium",
"diffHard": "Hard",
"loadingLibrary": "Loading library...",
"loadLibraryFailed": "Library load failed",
"libraryEmpty": "No questions match the filter",
"libraryTotal": "{total} questions total",
"addToExam": "Add to exam",
"unitScore": "pts",
"selectedTitle": "Selected Questions",
"selectedCount": "{count} questions",
"selectedEmpty": "Add questions from the library on the left",
"scoreLabel": "Score",
"moveUp": "Move up",
"moveDown": "Move down",
"remove": "Remove",
"previewTitle": "Preview",
"previewTotal": "Total Score",
"previewBaseline": "Baseline: {baseline} pts",
"previewPassScore": "Pass Score",
"previewTypeBreakdown": "Type Breakdown"
},
"edit": {
"title": "Edit Exam Paper",
"subtitle": "Total: {total} pts · {count} questions",
"save": "Save Paper",
"saveSuccess": "Paper saved successfully",
"saveFailed": "Save failed: {message}",
"notFound": "No paper content found",
"propertiesTitle": "Paper Properties",
"propExamId": "Exam ID",
"propTotalScore": "Total Score",
"propQuestionCount": "Question Count",
"propUpdatedAt": "Last Updated",
"contractPending": "Rich text editor contract is @contract-pending, currently backed by MSW. Will switch to real data once backend is ready.",
"editorTitle": "Paper Content",
"toolbarBold": "Bold",
"toolbarItalic": "Italic",
"toolbarUnderline": "Underline",
"toolbarBulletList": "Bullet list",
"toolbarOrderedList": "Ordered list"
}
},
"homework": {