|
@@ -156,8 +156,13 @@ public class FixCorrectAnswerAndResetScoreService {
|
|
|
*/
|
|
|
private double calcTotalObjectiveScore(List<ExamQuestionEntity> objectiveQuesList) {
|
|
|
double totalObjectiveScore = 0d;//客观题总分
|
|
|
+
|
|
|
for (ExamQuestionEntity eq : objectiveQuesList) {
|
|
|
- totalObjectiveScore += eq.getStudentScore();
|
|
|
+ if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
|
|
|
+ && !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
|
|
|
+ && eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
|
|
|
+ totalObjectiveScore += eq.getQuestionScore();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return totalObjectiveScore;
|
|
@@ -234,9 +239,15 @@ public class FixCorrectAnswerAndResetScoreService {
|
|
|
for (int i = 0; i < questionUnitList.size(); i++) {
|
|
|
String rightAnswer = rightAnswerList.get(i);
|
|
|
ExamQuestionEntity curQues = questionUnitList.get(i);
|
|
|
+ String curCorrectAnswer =curQues.getCorrectAnswer();
|
|
|
+
|
|
|
+ //只有无答案,或者有答案,答案不一致的才更新
|
|
|
+ if (StringUtils.isNullOrEmpty(curCorrectAnswer)
|
|
|
+ || (!StringUtils.isNullOrEmpty(curCorrectAnswer) && !curCorrectAnswer.equals(rightAnswer))) {
|
|
|
+ updatePartialQuestionAnswer(examRecordQuestionsId, curQues.getOrder(),
|
|
|
+ rightAnswer, calcStudentUnitScore(rightAnswer, curQues));
|
|
|
+ }
|
|
|
|
|
|
- updatePartialQuestionAnswer(examRecordQuestionsId, curQues.getOrder(),
|
|
|
- rightAnswer, calcStudentUnitScore(rightAnswer, curQues));
|
|
|
}
|
|
|
}
|
|
|
System.out.println(String.format("1.更新第%d条作答记录成功---examRecordDataId=%s", ++effectiveNum, record.getId()));
|