|
|
|
@ -74,7 +74,7 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain |
|
|
|
dto.setTrueFalseScore(dto.getTrueFalseNum() > 0 ? Math.round(base * examScoreRatioConfig.getTrueFalse() * 100) / 100.0 : 0.0); |
|
|
|
|
|
|
|
// 3. 余数平差:从配置中读取总分进行逆向补齐,确保总分 100% 对应配置
|
|
|
|
double configTotal = examScoreRatioConfig.getTotalScore().doubleValue(); |
|
|
|
double configTotal = examScoreRatioConfig.getTotalScore(); |
|
|
|
|
|
|
|
if (dto.getTrueFalseNum() > 0) { |
|
|
|
dto.setTrueFalseScore(Math.round((configTotal - dto.getSingleChoiceNum() * dto.getSingleChoiceScore() - dto.getMultipleChoiceNum() * dto.getMultipleChoiceScore()) / dto.getTrueFalseNum() * 100) / 100.0); |
|
|
|
@ -84,7 +84,7 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain |
|
|
|
dto.setSingleChoiceScore(Math.round(configTotal / dto.getSingleChoiceNum() * 100) / 100.0); |
|
|
|
} |
|
|
|
|
|
|
|
dto.setTotalScore(configTotal); |
|
|
|
dto.setTotalScore((int) configTotal); |
|
|
|
// 补全冗余字段
|
|
|
|
ProductLineEntity subProductLine = productLineBaseService.getById(dto.getSubLineId()); |
|
|
|
dto.setSubLineName(subProductLine.getName()); |
|
|
|
|