实现考试归档并永久锁定成绩流程

This commit is contained in:
2026-07-20 17:08:17 +08:00 Unverified
parent 6d22b41ce8
commit 1a87e06fc8
15 changed files with 265 additions and 39 deletions
+6 -1
View File
@@ -285,7 +285,7 @@ function publicExam(exam) {
return {
...exam,
totalScore: exam.subjects.reduce((sum, subject) => sum + Number(subject.fullScore || 0), 0),
registrationState: now < start ? 'upcoming' : now > end ? 'closed' : 'open'
registrationState: exam.archivedAt ? 'archived' : now < start ? 'upcoming' : now > end ? 'closed' : 'open'
};
}
@@ -374,6 +374,10 @@ function examResultSummary(db, registration) {
return {
examId: exam.id,
examName: exam.name,
examCode: exam.code,
examStart: exam.examStart,
archivedAt: exam.archivedAt || null,
complete,
publishedSubjects: published.length,
subjectCount: subjects.length,
@@ -536,6 +540,7 @@ function prepareResultImport(db, rows) {
else if (!account) rowErrors.push('报名号不存在');
if (!examCode) rowErrors.push('考试代码不能为空');
else if (!exam) rowErrors.push('考试代码不存在');
else if (exam.archivedAt) rowErrors.push('该考试已归档,成绩已永久锁定');
if (!subjectName) rowErrors.push('科目不能为空');
else if (exam && !subject) rowErrors.push('该考试中不存在此科目');
if (exam && account && !registration) rowErrors.push('该考生没有已通过的本场考试报名');