【单操打分规则逻辑修改】

This commit is contained in:
weizhihong 2023-05-04 15:14:10 +08:00
parent 6825eb02bd
commit 943c46bda7

View File

@ -283,8 +283,11 @@ public class Training2Service {
return 0D;
}
List<ScoringRule2> scoringRules = training2.getScoringRules();
if (CollectionUtils.isEmpty(scoreDetailList) || CollectionUtils.isEmpty(scoringRules)) {
if (CollectionUtils.isEmpty(scoreDetailList)) {
return 0D;
} else if (CollectionUtils.isEmpty(scoringRules)) { // 如果没有打分规则直接取平均分
long rightStepCount = scoreDetailList.stream().filter(PaperTrainAnswerDetail::isSuccess).count();
return 100D * rightStepCount / scoreDetailList.size();
} else {
List<Long> rightStepList = scoreDetailList.stream().filter(PaperTrainAnswerDetail::isSuccess)
.map(PaperTrainAnswerDetail::getStepId).collect(Collectors.toList());