refactor: RBAC权限系统重构 + UI组件拆分 + 测试修复 + 架构文档
Some checks failed
CI / build-deploy (push) Has been cancelled
Some checks failed
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、代码分割
This commit is contained in:
124
src/mocks/question-data.ts
Normal file
124
src/mocks/question-data.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
import { Question } from "../modules/questions/types";
|
||||
|
||||
export const MOCK_QUESTIONS: Question[] = [
|
||||
{
|
||||
id: "q-001",
|
||||
content: "What is the capital of France?",
|
||||
type: "single_choice",
|
||||
difficulty: 1,
|
||||
createdAt: new Date("2023-11-01"),
|
||||
updatedAt: new Date("2023-11-01"),
|
||||
author: { id: "u-1", name: "Alice Teacher", image: null },
|
||||
knowledgePoints: [{ id: "kp-1", name: "Geography" }, { id: "kp-2", name: "Europe" }],
|
||||
},
|
||||
{
|
||||
id: "q-002",
|
||||
content: "Explain the theory of relativity in simple terms.",
|
||||
type: "text",
|
||||
difficulty: 5,
|
||||
createdAt: new Date("2023-11-02"),
|
||||
updatedAt: new Date("2023-11-02"),
|
||||
author: { id: "u-2", name: "Bob Physicist", image: null },
|
||||
knowledgePoints: [{ id: "kp-3", name: "Physics" }],
|
||||
},
|
||||
{
|
||||
id: "q-003",
|
||||
content: "True or False: The earth is flat.",
|
||||
type: "judgment",
|
||||
difficulty: 1,
|
||||
createdAt: new Date("2023-11-03"),
|
||||
updatedAt: new Date("2023-11-03"),
|
||||
author: { id: "u-1", name: "Alice Teacher", image: null },
|
||||
knowledgePoints: [{ id: "kp-1", name: "Geography" }],
|
||||
},
|
||||
{
|
||||
id: "q-004",
|
||||
content: "Select all prime numbers below 10.",
|
||||
type: "multiple_choice",
|
||||
difficulty: 2,
|
||||
createdAt: new Date("2023-11-04"),
|
||||
updatedAt: new Date("2023-11-04"),
|
||||
author: { id: "u-3", name: "Charlie Math", image: null },
|
||||
knowledgePoints: [{ id: "kp-4", name: "Math" }],
|
||||
},
|
||||
{
|
||||
id: "q-005",
|
||||
content: "Write a function to reverse a string in JavaScript.",
|
||||
type: "text",
|
||||
difficulty: 3,
|
||||
createdAt: new Date("2023-11-05"),
|
||||
updatedAt: new Date("2023-11-05"),
|
||||
author: { id: "u-4", name: "Dave Coder", image: null },
|
||||
knowledgePoints: [{ id: "kp-5", name: "Programming" }, { id: "kp-6", name: "JavaScript" }],
|
||||
},
|
||||
{
|
||||
id: "q-006",
|
||||
content: "Which of the following are fruits? (Apple, Carrot, Banana, Potato)",
|
||||
type: "multiple_choice",
|
||||
difficulty: 1,
|
||||
createdAt: new Date("2023-11-06"),
|
||||
updatedAt: new Date("2023-11-06"),
|
||||
author: { id: "u-1", name: "Alice Teacher", image: null },
|
||||
knowledgePoints: [{ id: "kp-7", name: "Biology" }],
|
||||
},
|
||||
{
|
||||
id: "q-007",
|
||||
content: "Water boils at 100 degrees Celsius at sea level.",
|
||||
type: "judgment",
|
||||
difficulty: 2,
|
||||
createdAt: new Date("2023-11-07"),
|
||||
updatedAt: new Date("2023-11-07"),
|
||||
author: { id: "u-2", name: "Bob Physicist", image: null },
|
||||
knowledgePoints: [{ id: "kp-3", name: "Physics" }],
|
||||
},
|
||||
{
|
||||
id: "q-008",
|
||||
content: "What is the powerhouse of the cell?",
|
||||
type: "single_choice",
|
||||
difficulty: 2,
|
||||
createdAt: new Date("2023-11-08"),
|
||||
updatedAt: new Date("2023-11-08"),
|
||||
author: { id: "u-5", name: "Eve Biologist", image: null },
|
||||
knowledgePoints: [{ id: "kp-7", name: "Biology" }],
|
||||
},
|
||||
{
|
||||
id: "q-009",
|
||||
content: "Solve for x: 2x + 5 = 15",
|
||||
type: "single_choice",
|
||||
difficulty: 2,
|
||||
createdAt: new Date("2023-11-09"),
|
||||
updatedAt: new Date("2023-11-09"),
|
||||
author: { id: "u-3", name: "Charlie Math", image: null },
|
||||
knowledgePoints: [{ id: "kp-4", name: "Math" }],
|
||||
},
|
||||
{
|
||||
id: "q-010",
|
||||
content: "Describe the impact of the Industrial Revolution.",
|
||||
type: "text",
|
||||
difficulty: 4,
|
||||
createdAt: new Date("2023-11-10"),
|
||||
updatedAt: new Date("2023-11-10"),
|
||||
author: { id: "u-6", name: "Frank Historian", image: null },
|
||||
knowledgePoints: [{ id: "kp-8", name: "History" }],
|
||||
},
|
||||
{
|
||||
id: "q-011",
|
||||
content: "Light travels faster than sound.",
|
||||
type: "judgment",
|
||||
difficulty: 1,
|
||||
createdAt: new Date("2023-11-11"),
|
||||
updatedAt: new Date("2023-11-11"),
|
||||
author: { id: "u-2", name: "Bob Physicist", image: null },
|
||||
knowledgePoints: [{ id: "kp-3", name: "Physics" }],
|
||||
},
|
||||
{
|
||||
id: "q-012",
|
||||
content: "Which element has the chemical symbol 'O'?",
|
||||
type: "single_choice",
|
||||
difficulty: 1,
|
||||
createdAt: new Date("2023-11-12"),
|
||||
updatedAt: new Date("2023-11-12"),
|
||||
author: { id: "u-7", name: "Grace Chemist", image: null },
|
||||
knowledgePoints: [{ id: "kp-9", name: "Chemistry" }],
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user