实现考试归档并永久锁定成绩流程
This commit is contained in:
+6
-1
@@ -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('该考生没有已通过的本场考试报名');
|
||||
|
||||
Reference in New Issue
Block a user