|
|
|
@ -88,16 +88,38 @@ public class ClassicTaskConfigStrategy implements TaskConfigStrategy { |
|
|
|
* 经典模式下题目数量和分数来自套卷,DTO 中可能为 null,赋默认值 0 避免 NPE |
|
|
|
*/ |
|
|
|
private void fillDefaults(TaskDTO dto) { |
|
|
|
if (dto.getSingleChoiceNum() == null) dto.setSingleChoiceNum(0); |
|
|
|
if (dto.getMultipleChoiceNum() == null) dto.setMultipleChoiceNum(0); |
|
|
|
if (dto.getTrueFalseNum() == null) dto.setTrueFalseNum(0); |
|
|
|
if (dto.getShortAnswerNum() == null) dto.setShortAnswerNum(0); |
|
|
|
if (dto.getSingleChoiceScore() == null) dto.setSingleChoiceScore(0.0); |
|
|
|
if (dto.getMultipleChoiceScore() == null) dto.setMultipleChoiceScore(0.0); |
|
|
|
if (dto.getTrueFalseScore() == null) dto.setTrueFalseScore(0.0); |
|
|
|
if (dto.getShortAnswerScore() == null) dto.setShortAnswerScore(0.0); |
|
|
|
if (dto.getAccurateGraspNum() == null) dto.setAccurateGraspNum(0); |
|
|
|
if (dto.getVagueGraspNum() == null) dto.setVagueGraspNum(0); |
|
|
|
if (dto.getTotalScore() == null) dto.setTotalScore(0); |
|
|
|
if (dto.getSingleChoiceNum() == null) { |
|
|
|
dto.setSingleChoiceNum(0); |
|
|
|
} |
|
|
|
if (dto.getMultipleChoiceNum() == null) { |
|
|
|
dto.setMultipleChoiceNum(0); |
|
|
|
} |
|
|
|
if (dto.getTrueFalseNum() == null) { |
|
|
|
dto.setTrueFalseNum(0); |
|
|
|
} |
|
|
|
if (dto.getShortAnswerNum() == null) { |
|
|
|
dto.setShortAnswerNum(0); |
|
|
|
} |
|
|
|
if (dto.getSingleChoiceScore() == null) { |
|
|
|
dto.setSingleChoiceScore(0.0); |
|
|
|
} |
|
|
|
if (dto.getMultipleChoiceScore() == null) { |
|
|
|
dto.setMultipleChoiceScore(0.0); |
|
|
|
} |
|
|
|
if (dto.getTrueFalseScore() == null) { |
|
|
|
dto.setTrueFalseScore(0.0); |
|
|
|
} |
|
|
|
if (dto.getShortAnswerScore() == null) { |
|
|
|
dto.setShortAnswerScore(0.0); |
|
|
|
} |
|
|
|
if (dto.getAccurateGraspNum() == null) { |
|
|
|
dto.setAccurateGraspNum(0); |
|
|
|
} |
|
|
|
if (dto.getVagueGraspNum() == null) { |
|
|
|
dto.setVagueGraspNum(0); |
|
|
|
} |
|
|
|
if (dto.getTotalScore() == null) { |
|
|
|
dto.setTotalScore(0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|