fix(dev): bind frontend to 127.0.0.1:8080 and avoid EACCES\nfix(backend): bind server to 127.0.0.1:8081, add permissive CORS whitelist\nfix(auth): login form UX remove default username, clarify placeholder, add test account autofill\nchore(api): set frontend API_BASE_URL to 127.0.0.1:8081\nrefactor(assignments): lifecycle/state logic and archive endpoint\nfeat(analytics): add exam stats endpoint and client method\nchore(lint): add eslint configs

This commit is contained in:
Nexus Dev
2025-11-30 21:55:28 +08:00
parent 38244630a7
commit 4b84a09538
63 changed files with 8478 additions and 3694 deletions

View File

@@ -246,8 +246,12 @@ export interface ExamDto {
totalScore: number;
duration: number; // 建议时长(分钟)
questionCount: number; // 总题数
usageCount?: number;
status: 'Draft' | 'Published';
createdAt: string;
creatorName?: string;
isMyExam?: boolean;
examType?: string;
}
/**
@@ -273,6 +277,9 @@ export interface ExamNodeDto {
// === 递归子节点 ===
children?: ExamNodeDto[]; // 子节点(支持无限嵌套)
// === 学生作答(用于恢复进度) ===
studentAnswer?: any;
}
/**
@@ -304,24 +311,67 @@ export interface ExamStatsDto {
// 6. Assignment / 作业
// ============================================================
export interface AssignmentAnalysisDto {
overview: {
title: string;
examTitle: string;
totalStudents: number;
submittedCount: number;
averageScore: number;
maxScore: number;
minScore: number;
};
questions: {
id: string;
title: string;
questionId: string | null;
score: number;
totalAnswers: number;
errorCount: number;
errorRate: number;
correctAnswer: string;
knowledgePoints: string[];
wrongSubmissions: {
studentName: string;
studentAnswer: string;
}[];
}[];
knowledgePoints: {
name: string;
errorRate: number;
}[];
}
export interface AssignmentTeacherViewDto {
id: string;
title: string;
examTitle: string;
subjectName?: string;
examType?: string;
className: string;
gradeName: string;
submittedCount: number;
totalCount: number;
status: 'Active' | 'Ended' | 'Scheduled';
status: string; // 'Active' | 'Closed' | 'Ended'
hasPendingGrading?: boolean;
dueDate: string;
examTitle: string;
createdAt: string;
}
export interface AssignmentStudentViewDto {
id: string;
title: string;
examTitle: string;
subjectName?: string;
teacherName?: string;
duration?: number;
questionCount?: number;
totalScore?: number;
className?: string;
endTime: string;
status: 'Pending' | 'Graded' | 'Submitted';
status: 'Pending' | 'InProgress' | 'Submitted' | 'Grading' | 'Completed';
score?: number;
isSubmitted?: boolean; // Helper flag to distinguish between 'Grading' (expired but not submitted) vs (submitted)
}
// ============================================================