|
|
@ -43,19 +43,27 @@ public class BuildExamRecordDomainServiceImpl implements BuildExamRecordDomainSe |
|
|
|
|
|
|
|
|
if (QuestionTypeEnum.SINGLE_CHOICE.getValue().equals(answerSnapshotDTO.getType())) { |
|
|
if (QuestionTypeEnum.SINGLE_CHOICE.getValue().equals(answerSnapshotDTO.getType())) { |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getSingleChoiceScore()); |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getSingleChoiceScore()); |
|
|
|
|
|
answerSnapshotDTO.setScoreStr(buildeScore(dto.getTaskDTO().getSingleChoiceScore())); |
|
|
answerSnapshotDTO.setUserScore(BooleanUtil.isTrue(answerSnapshotDTO.getIsRight()) ? |
|
|
answerSnapshotDTO.setUserScore(BooleanUtil.isTrue(answerSnapshotDTO.getIsRight()) ? |
|
|
dto.getTaskDTO().getSingleChoiceScore() : 0); |
|
|
dto.getTaskDTO().getSingleChoiceScore() : 0); |
|
|
|
|
|
answerSnapshotDTO.setUserScoreStr(buildeScore(answerSnapshotDTO.getUserScore())); |
|
|
} else if (QuestionTypeEnum.TRUE_FALSE.getValue().equals(answerSnapshotDTO.getType())) { |
|
|
} else if (QuestionTypeEnum.TRUE_FALSE.getValue().equals(answerSnapshotDTO.getType())) { |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getTrueFalseScore()); |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getTrueFalseScore()); |
|
|
|
|
|
answerSnapshotDTO.setScoreStr(buildeScore(dto.getTaskDTO().getTrueFalseScore())); |
|
|
answerSnapshotDTO.setUserScore(BooleanUtil.isTrue(answerSnapshotDTO.getIsRight()) ? |
|
|
answerSnapshotDTO.setUserScore(BooleanUtil.isTrue(answerSnapshotDTO.getIsRight()) ? |
|
|
dto.getTaskDTO().getTrueFalseScore() : 0); |
|
|
dto.getTaskDTO().getTrueFalseScore() : 0); |
|
|
|
|
|
answerSnapshotDTO.setUserScoreStr(buildeScore(answerSnapshotDTO.getUserScore())); |
|
|
} else if (QuestionTypeEnum.MULTIPLE_CHOICE.getValue().equals(answerSnapshotDTO.getType())){ |
|
|
} else if (QuestionTypeEnum.MULTIPLE_CHOICE.getValue().equals(answerSnapshotDTO.getType())){ |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getMultipleChoiceScore()); |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getMultipleChoiceScore()); |
|
|
|
|
|
answerSnapshotDTO.setScoreStr(buildeScore(dto.getTaskDTO().getMultipleChoiceScore())); |
|
|
answerSnapshotDTO.setUserScore(BooleanUtil.isTrue(answerSnapshotDTO.getIsRight()) ? |
|
|
answerSnapshotDTO.setUserScore(BooleanUtil.isTrue(answerSnapshotDTO.getIsRight()) ? |
|
|
dto.getTaskDTO().getMultipleChoiceScore() : 0); |
|
|
dto.getTaskDTO().getMultipleChoiceScore() : 0); |
|
|
|
|
|
answerSnapshotDTO.setUserScoreStr(buildeScore(answerSnapshotDTO.getUserScore())); |
|
|
}else{ |
|
|
}else{ |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getShortAnswerScore()); |
|
|
answerSnapshotDTO.setScore(dto.getTaskDTO().getShortAnswerScore()); |
|
|
|
|
|
answerSnapshotDTO.setScoreStr(buildeScore(dto.getTaskDTO().getShortAnswerScore())); |
|
|
answerSnapshotDTO.setUserScore(answerSnapshotDTO.getAiScore()); |
|
|
answerSnapshotDTO.setUserScore(answerSnapshotDTO.getAiScore()); |
|
|
|
|
|
answerSnapshotDTO.setUserScoreStr(buildeScore(answerSnapshotDTO.getUserScore())); |
|
|
} |
|
|
} |
|
|
answerSnapshotDTO.setTypeText(Try.of(() -> |
|
|
answerSnapshotDTO.setTypeText(Try.of(() -> |
|
|
QuestionTypeEnum.findByValue(answerSnapshotDTO.getType()).getDescription()) |
|
|
QuestionTypeEnum.findByValue(answerSnapshotDTO.getType()).getDescription()) |
|
|
@ -99,10 +107,15 @@ public class BuildExamRecordDomainServiceImpl implements BuildExamRecordDomainSe |
|
|
if (QuestionTypeEnum.SHORT_ANSWER.getValue().equals(answerSnapshotDTO.getType()) |
|
|
if (QuestionTypeEnum.SHORT_ANSWER.getValue().equals(answerSnapshotDTO.getType()) |
|
|
&& AppealStatusEnum.PASS_REVIEW.getValue().equals(appeal.getStatus())) { |
|
|
&& AppealStatusEnum.PASS_REVIEW.getValue().equals(appeal.getStatus())) { |
|
|
answerSnapshotDTO.setUserScore(appeal.getRevisedScore()); |
|
|
answerSnapshotDTO.setUserScore(appeal.getRevisedScore()); |
|
|
|
|
|
answerSnapshotDTO.setUserScoreStr(buildeScore(appeal.getRevisedScore())); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
return dto; |
|
|
return dto; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String buildeScore(Double score){ |
|
|
|
|
|
return score == score.longValue() ? String.valueOf(score.longValue()) : String.format("%.2f", score); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|