SpecialX
98429e87eb
feat(business): update audit, auth, course-plans, announcements, exams
...
- audit: update retention.ts, types.ts, audit-retention-settings.tsx
- auth: update actions.ts and types.ts
- course-plans: update actions.ts, course-plan-detail.tsx, template-picker-dialog.tsx,
add lib/track-event.ts
- announcements: update page.tsx, announcement-list.tsx, announcement-pagination.tsx
- exams: update actions.ts
2026-07-04 10:23:03 +08:00
SpecialX
a16f09d3c3
feat(exams): add rich editor actions, auto-mark, preview, services, and config
...
- Add actions-helpers and actions-rich-editor for rich text exam editing
- Add ai-pipeline/auto-mark for automatic exam marking
- Add exam-boundaries and exam-preview components
- Add config directory for exam configuration
- Add data-access-cross-module for cross-module data access
- Add editor/exam-nodes-to-editor-doc and editor/utils for editor utilities
- Add use-exam-preview-rewrite, use-exam-preview-state, use-exam-preview-tasks hooks
- Add services directory
2026-07-03 10:25:11 +08:00
SpecialX
1f28efbeb6
feat(exams): add section/group structure nodes with auto stats
...
Distinguish structural levels from questions:
- sectionBlock (new): top-level volume like "第Ⅰ卷 选择题(共24分)"
- groupBlock (enhanced): section like "一、选择题" with instruction field
- questionBlock (composite): reserved for reading comprehension
Key changes:
- New section-block.tsx extension with level attr (1=卷, 2=部分) and
auto-computed question count + total score in NodeView
- group-block.tsx: add instruction field ("每小题3分"), auto stats display
- editor-to-structure.ts: recursive buildStructureNode supports arbitrary
nesting (section > group > question), computeStats accumulates scores
- exam-rich-form.tsx ExamPreview: render section/group/question with
distinct styles and stats badges
- selection-toolbar.tsx: add "分卷" button (Layers icon)
- exam-rich-editor.tsx: register SectionBlock, expose insertSection/
wrapInSection via ref
- actions.ts: AI prompt now outputs volumes[] + groups[] structure with
instruction; buildTiptapDocFromAiResponse generates nested sectionBlock
- i18n: add markSection keys (zh-CN/en)
Structural nodes are NOT questions: their question count and total score
are automatically computed from child questions, not manually set.
2026-06-24 14:07:29 +08:00
SpecialX
f260720443
fix(exams): fix composite question sub-questions not showing in preview
...
- Fix buildQuestion in editor-to-structure.ts: recursively detect nested
questionBlock nodes as subQuestions (composite questions now properly
extract child questions instead of treating them as plain text)
- Fix buildQuestionBlock in actions.ts: AI auto-mark now generates nested
questionBlock nodes for sub-questions instead of plain paragraphs, so
they are properly structured and detectable by the parser
- Rewrite ExamPreview component with proper layout:
- Question header: number + type label badge + score
- Indented question text and options
- Composite sub-questions shown in nested block with left border
- Image thumbnails
- Empty state message
- Title centered at top
- Group titles with bottom border
2026-06-24 13:54:24 +08:00
SpecialX
7380f1e6c8
fix(exams): fix rich editor crashes and redesign form layout
...
- Fix groupBlock/questionBlock insertContent error: empty content violates
schema "block+", now provide default empty paragraph
- Fix buildTiptapDocFromAiResponse: ensure groupBlock/questionBlock always
have content (fallback to empty paragraph)
- Add wrapInGroup/wrapInQuestion commands to wrap selected text into
question/group blocks (vs insert which creates empty blocks)
- Update SelectionToolbar: use wrap when text selected, insert when not
- Redesign exam-rich-form layout:
- Merge basic info into single-row toolbar (title/subject/grade/difficulty/score/duration)
- Remove separate "source text" textarea (user pastes directly in editor)
- AI auto-mark now reads from editor content via getText()
- Editor + preview takes full height (calc(100vh-180px))
- Enhance AI prompt for Chinese exam papers:
- Support reading material (阅读理解选段)
- Support dotted chars (加点字注音)
- Support sub-questions (阅读理解小题)
- Better type detection (single/multiple choice, judgment, fill, essay, composite)
- Add splitByDottedTexts helper to mark dotted chars in Tiptap doc
- Add i18n keys for titlePlaceholder, editorArea description
2026-06-24 13:41:39 +08:00
SpecialX
6114607c1e
feat(exams,homework): add rich text exam editor and scan-based grading
...
- Add Tiptap-based rich text editor with custom extensions (dotted-mark,
blank-node, image-node, group-block, question-block) for exam creation
- Add AI auto-marking action to convert pasted exam text to structured editor doc
- Add resizable split-panel layout for editor + live preview
- Add student scan upload (photo of paper answers) with drag-drop and reorder
- Add scan image viewer with zoom/rotate/fullscreen for teachers
- Add scan grading view with side-by-side questions and scan images
- Add /teacher/exams/new and /teacher/homework/submissions/[id]/scan-grading routes
- Fix getScansAction to support both teacher (HOMEWORK_GRADE) and student
(HOMEWORK_SUBMIT) permission scopes
- Add i18n keys for rich editor, scan upload, and scan grading (zh-CN/en)
- Sync architecture diagrams (004/005) with new modules, routes, and deps
2026-06-24 13:16:33 +08:00
SpecialX
f0f713ff33
feat(exams,homework): add error collection data-access for error book integration
...
- Add data-access-error-collection in exams module for collecting wrong exam answers
- Add data-access-error-collection in homework module for collecting wrong homework answers
- Update exams actions, exam-ai-generator, data-access, and types
- Update homework actions and data-access-write
2026-06-24 12:03:03 +08:00
SpecialX
4f0ef217a0
refactor(modules): update existing module implementations across attendance, audit, auth, classes, course-plans, exams, files, homework, layout, proctoring, questions, scheduling, textbooks, users
...
- Update attendance components and data-access for record management
- Update audit log views, filters, and data-access
- Update auth login and register forms
- Update classes actions, components, and data-access (admin, schedule, stats)
- Update course-plans actions, form, list, progress, and schema
- Update exams actions, AI pipeline, preview components, and hooks
- Update files components (icon, list, preview, upload) and data-access
- Update homework assignment form, review view, auto-save hook, and stats-service
- Update layout sidebar, header, and navigation config
- Update proctoring actions, anti-cheat monitor, and data-access
- Update questions actions, components (dialog, actions, columns, filters), and data-access
- Update scheduling actions, auto-scheduler, components, and schema
- Update textbooks constants and text-selection hook
- Update users class-registration, import-dialog, data-access, and user-service
2026-06-23 17:38:56 +08:00
SpecialX
682d385ee2
fix(dashboard): v3 审计修复 — 数据完整性、i18n、类型安全、死代码清理
...
P0 修复(严重):
- admin ContentRow 标签与值错配(stats.users→textbooks 等 6 处)
- admin/error.tsx 硬编码中文替换为 useTranslations
- UserGrowthChart 空数据时渲染 EmptyState(userGrowth/homeworkTrend 永远为空数组)
P1 修复(高):
- 新增 admin/dashboard 和 student/dashboard 的 loading.tsx + error.tsx
- 抽取 DashboardLoadingSkeleton 和 DashboardErrorFallback 共享组件,消除 5 套重复文件
- formatDate/formatLongDate 传入用户 locale(admin/teacher/student 共 6 个组件)
- 移除死代码:getCachedAdminDashboard、AvatarImage src={undefined}、TeacherStats isLoading prop
- filterTodaySchedule 改为泛型函数,消除 as 类型断言
- 辅助函数 getStatus/getDueUrgency 新增显式返回类型
- UserGrowthChart 新增 labelKey prop 区分用户增长/作业提交趋势标签
P2 修复(中):
- 4 个组件从客户端转为服务端组件(DashboardGreetingHeader、TeacherQuickActions、TeacherDashboardHeader、StudentDashboardHeader)
- Student dashboard 空状态新增 CTA(viewSchedule、viewAll)
- TeacherHomeworkCard 图标按钮新增 aria-label
- TeacherTodoCard 排序逻辑重写为可读的 if/return 模式
同步更新:
- docs/architecture/005_architecture_data.json 新增 DashboardLoadingSkeleton、DashboardErrorFallback 条目
- 新增 docs/architecture/audit/dashboard-audit-report-v3.md 审计报告
- dashboard.json 新增 6 个 i18n 键(textbooks/chapters/questions/exams/totalAssignments/totalSubmissions)
2026-06-22 18:36:46 +08:00
SpecialX
978d9a8309
feat: 新增备课模块并修复全模块 P0/P1/P2 缺陷
...
Security / deep-security-scan (push) Failing after 20m5s
DR Drill / dr-drill (push) Failing after 1m31s
CI / scheduled-backup (push) Failing after 1m31s
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled
主要变更:
- 新增 lesson-preparation 模块: 备课编辑器、节点编辑、AI 建议、知识点选择、版本历史、作业发布
- 新增 shared 通用组件: charts/question-bank-filters/schedule-list/ui (chip-nav/filter-bar/page-header/stat-card/stat-item)
- 新增 student/admin 端 loading.tsx 与 error.tsx, 优化加载与错误态体验
- 新增 teacher/lesson-plans 页面 (列表/新建/编辑)
- 新增 drizzle 迁移 0002_tiny_lionheart 及 snapshot
- 新增 textbooks/schema.ts 与 exams/utils/normalize-structure.ts
- 修复 Tiptap v3 SSR hydration 崩溃 (rich-text-block immediatelyRender: false)
- 重构多模块 data-access/actions/组件, 修复权限校验与类型规范
- 同步架构文档 004/005 反映新增模块、导出、依赖关系
- 归档 bugs/* 测试报告与 e2e 测试脚本 (admin/parent/student/teacher web_test)
2026-06-22 01:06:16 +08:00
SpecialX
49291fcc31
refactor: fix all P0/P1/P2 bugs and architecture issues
...
Bug fixes (from bugs/ directory):
- Fix cross-module DB queries in 9 modules (homework, grades, parent, diagnostic, elective, proctoring, notifications, scheduling, classes) by routing through data-access functions
- Fix shared/lib <-> auth circular dependency via new session.ts module
- Fix divide-by-zero guard in grades data-access
- Fix audit export data truncation (paginated fetch for full datasets)
- Fix missing transactions in homework grading and elective lottery
- Fix missing revalidatePath in course-plans actions
- Fix frontend permission checks using requirePermission instead of requireAuth
- Fix dashboard role routing using session.user.roles
- Fix student auth pattern (migrate getDemoStudentUser to users module)
- Fix ActionState return type handling in components
Code quality fixes:
- Remove 60+ as type assertions (replace with type guards)
- Remove non-null assertions (use optional chaining or explicit checks)
- Convert dynamic imports to static imports (grades, diagnostic)
- Add React.cache() wrapping for read functions
- Parallelize independent queries with Promise.all
- Add explicit return types to 30+ arrow functions
- Replace any with unknown + type guards
- Fix import type for type-only imports
- Add Zod validation schemas for classes and diagnostic modules
- Extract duplicate code (normalizeRoleName, normalizeBcryptHash, logger IP extraction)
- Add console.error to silent catch blocks
- Fix permission naming consistency (exam:proctor_read -> exam:proctor:read)
Architecture doc sync:
- Update 004_architecture_impact_map.md and 005_architecture_data.json
- Update management-modules-audit.md for P0-7 cross-module fix
Moved deleted proctoring event route to deletes/ folder.
2026-06-19 05:13:34 +08:00
SpecialX
84d6636bd1
refactor: P1-2 actions 层 DB 操作下沉到 data-access (exams/homework/questions/announcements)
2026-06-18 02:31:16 +08:00
SpecialX
125f7ec54c
refactor: RBAC权限系统重构 + UI组件拆分 + 测试修复 + 架构文档
...
CI / build-deploy (push) Has been cancelled
- RBAC: 新增30个权限点、DataScope行级权限、requirePermission守卫,所有57+ Server Action接入权限校验
- UI拆分: exam-form(1623行→11文件)、textbook-reader(744行→7文件),均降至300行以内
- 测试: 新增5个单元测试文件(19用例),修复4个集成测试文件(38用例全部通过)
- 架构文档: 新增架构影响地图(004/005)、标准功能清单(006)、差距审计报告(007)
- 项目规则: 架构图优先规则,改码必同步图
- 安全: rehype-sanitize净化、AES加密API Key、权限路由守卫
- 无障碍: skip-link、aria-label、prefers-reduced-motion
- 性能: next/font优化、next/image、代码分割
2026-06-16 23:38:33 +08:00
SpecialX
99f116cb64
=test_update_homework_tests_and_work_log
CI / build-deploy (push) Has been cancelled
2026-03-19 13:16:49 +08:00
SpecialX
9bfc621d3f
feat(classes): optimize teacher dashboard ui and implement grade management
2026-01-14 13:59:11 +08:00
SpecialX
57807def37
完整性更新
...
现在已经实现了大部分基础功能
2026-01-08 11:14:03 +08:00
SpecialX
13e91e628d
Merge exams grading into homework
...
Redirect /teacher/exams/grading* to /teacher/homework/submissions; remove exam grading UI/actions/data-access; add homework student workflow and update design docs.
2025-12-31 11:59:03 +08:00
SpecialX
f7ff018490
feat: exam actions and data safety fixes
2025-12-30 17:48:22 +08:00
SpecialX
e7c902e8e1
Module Update
2025-12-30 14:42:30 +08:00