|
@@ -98,7 +98,8 @@ public class FixCorrectAnswerAndResetScoreService {
|
|
List<ExamRecordDataEntity> examRecordDataList = queryExamRecordDataList(examId, courseCode);
|
|
List<ExamRecordDataEntity> examRecordDataList = queryExamRecordDataList(examId, courseCode);
|
|
|
|
|
|
if (examRecordDataList.isEmpty()) {
|
|
if (examRecordDataList.isEmpty()) {
|
|
- throw new StatusException("100001", "找不到对应的考试记录");
|
|
|
|
|
|
+ System.out.println("找不到对应的考试记录! examId=" + examId + ", courseCode=" + courseCode);
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
System.out.println(String.format("total size is %s, start...", examRecordDataList.size()));
|
|
System.out.println(String.format("total size is %s, start...", examRecordDataList.size()));
|
|
@@ -160,6 +161,7 @@ public class FixCorrectAnswerAndResetScoreService {
|
|
for (ExamQuestionEntity eq : objectiveQuesList) {
|
|
for (ExamQuestionEntity eq : objectiveQuesList) {
|
|
if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
|
|
if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
|
|
&& !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
|
|
&& !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
|
|
|
|
+ // todo 兼容新结构
|
|
&& eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
|
|
&& eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
|
|
totalObjectiveScore += eq.getQuestionScore();
|
|
totalObjectiveScore += eq.getQuestionScore();
|
|
}
|
|
}
|
|
@@ -180,6 +182,7 @@ public class FixCorrectAnswerAndResetScoreService {
|
|
for (ExamQuestionEntity eq : objectiveQuesList) {
|
|
for (ExamQuestionEntity eq : objectiveQuesList) {
|
|
if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
|
|
if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
|
|
&& !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
|
|
&& !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
|
|
|
|
+ //todo 兼容新结构
|
|
&& eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
|
|
&& eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
|
|
correctNum += 1;
|
|
correctNum += 1;
|
|
}
|
|
}
|
|
@@ -270,6 +273,7 @@ public class FixCorrectAnswerAndResetScoreService {
|
|
Double studentUnitScore = 0D;
|
|
Double studentUnitScore = 0D;
|
|
if (!StringUtils.isNullOrEmpty(rightAnswer)
|
|
if (!StringUtils.isNullOrEmpty(rightAnswer)
|
|
&& !(StringUtils.isNullOrEmpty(studentAnswer))
|
|
&& !(StringUtils.isNullOrEmpty(studentAnswer))
|
|
|
|
+ //todo 兼容新结构
|
|
&& rightAnswer.equals(studentAnswer)) {
|
|
&& rightAnswer.equals(studentAnswer)) {
|
|
studentUnitScore = curQues.getQuestionScore();
|
|
studentUnitScore = curQues.getQuestionScore();
|
|
}
|
|
}
|