|
|
@@ -190,6 +190,7 @@ public class RealExamServiceImpl implements RealExamService {
|
|
|
.userId(userId)
|
|
|
.year(year)
|
|
|
.subjectId(subjectId)
|
|
|
+ .questionCount(questions.size())
|
|
|
.startTime(LocalDateTime.now())
|
|
|
.status(0)
|
|
|
.build();
|
|
|
@@ -314,10 +315,11 @@ public class RealExamServiceImpl implements RealExamService {
|
|
|
answerRecords.add(answerRecord);
|
|
|
}
|
|
|
|
|
|
- int total = correctCount + wrongCount;
|
|
|
- // 每题1分,总分按正确数计算;及格线为60%
|
|
|
+ // 满分 = 试卷题目总数(以 startExam 时快照为准,无快照则回退为本次作答题数)
|
|
|
+ int questionTotal = record.getQuestionCount() != null ? record.getQuestionCount() : correctCount + wrongCount;
|
|
|
+ // 每题1分,总分按正确数计算;及格线为满分的60%
|
|
|
BigDecimal totalScore = BigDecimal.valueOf(correctCount);
|
|
|
- BigDecimal passScore = BigDecimal.valueOf(total * 0.6).setScale(0, RoundingMode.HALF_UP);
|
|
|
+ BigDecimal passScore = BigDecimal.valueOf(questionTotal * 0.6).setScale(0, RoundingMode.HALF_UP);
|
|
|
int isPassed = totalScore.compareTo(passScore) >= 0 ? 1 : 0;
|
|
|
|
|
|
record.setSubmitTime(LocalDateTime.now());
|
|
|
@@ -325,6 +327,7 @@ public class RealExamServiceImpl implements RealExamService {
|
|
|
record.setTotalScore(totalScore);
|
|
|
record.setCorrectCount(correctCount);
|
|
|
record.setWrongCount(wrongCount);
|
|
|
+ record.setQuestionCount(questionTotal);
|
|
|
record.setIsPassed(isPassed);
|
|
|
record.setAnswers(answerRecords);
|
|
|
record.setStatus(1);
|
|
|
@@ -333,6 +336,7 @@ public class RealExamServiceImpl implements RealExamService {
|
|
|
return SubmitExamVO.builder()
|
|
|
.recordId(record.getId())
|
|
|
.totalScore(totalScore)
|
|
|
+ .questionCount(questionTotal)
|
|
|
.correctCount(correctCount)
|
|
|
.wrongCount(wrongCount)
|
|
|
.isPassed(isPassed)
|
|
|
@@ -378,6 +382,7 @@ public class RealExamServiceImpl implements RealExamService {
|
|
|
.yearLabel(yearLabel)
|
|
|
.subjectName(subjectName)
|
|
|
.totalScore(r.getTotalScore())
|
|
|
+ .questionCount(r.getQuestionCount())
|
|
|
.correctCount(r.getCorrectCount())
|
|
|
.wrongCount(r.getWrongCount())
|
|
|
.isPassed(r.getIsPassed())
|
|
|
@@ -456,6 +461,7 @@ public class RealExamServiceImpl implements RealExamService {
|
|
|
.recordId(record.getId())
|
|
|
.year(record.getYear())
|
|
|
.totalScore(record.getTotalScore())
|
|
|
+ .questionCount(record.getQuestionCount())
|
|
|
.correctCount(record.getCorrectCount())
|
|
|
.wrongCount(record.getWrongCount())
|
|
|
.isPassed(record.getIsPassed())
|