|
@@ -95,6 +95,25 @@ public class PaperDetailUnitServiceImpl implements PaperDetailUnitService{
|
|
// 匹配到子题
|
|
// 匹配到子题
|
|
subScoreList.set(index - 1, pduExp.getScore());
|
|
subScoreList.set(index - 1, pduExp.getScore());
|
|
oldPdu.getQuestion().getSubQuestions().set(index - 1, pduExp.getQuestion());
|
|
oldPdu.getQuestion().getSubQuestions().set(index - 1, pduExp.getQuestion());
|
|
|
|
+ //重新计算套题的难度,公开度
|
|
|
|
+ boolean publicity = false;
|
|
|
|
+ double totalSum = 0d;
|
|
|
|
+ double totalDou = 0d;
|
|
|
|
+ for(Question subQuestion:oldPdu.getQuestion().getSubQuestions()){
|
|
|
|
+ //设置公开度
|
|
|
|
+ if(subQuestion.getPublicity()){
|
|
|
|
+ publicity = true;
|
|
|
|
+ }
|
|
|
|
+ if(subQuestion.getDifficultyDegree() == null){
|
|
|
|
+ subQuestion.setDifficultyDegree(0.5);
|
|
|
|
+ }
|
|
|
|
+ totalSum = subQuestion.getDifficultyDegree()*subQuestion.getScore() + totalSum;
|
|
|
|
+ totalDou = subQuestion.getScore() + totalDou;
|
|
|
|
+ }
|
|
|
|
+ BigDecimal b = new BigDecimal(totalSum / totalDou);
|
|
|
|
+ Double difficulty = b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
+ oldPdu.getQuestion().setDifficultyDegree(difficulty);
|
|
|
|
+ oldPdu.getQuestion().setPublicity(publicity);
|
|
match = true;
|
|
match = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -103,23 +122,7 @@ public class PaperDetailUnitServiceImpl implements PaperDetailUnitService{
|
|
}
|
|
}
|
|
// 更新套题unit当前总分与子题分数
|
|
// 更新套题unit当前总分与子题分数
|
|
oldPdu.setSubScoreList(subScoreList);
|
|
oldPdu.setSubScoreList(subScoreList);
|
|
- //重新计算套题的难度,公开度
|
|
|
|
- boolean publicity = false;
|
|
|
|
- double totalSum = 0d;
|
|
|
|
- for(Question subQuestion:oldPdu.getQuestion().getSubQuestions()){
|
|
|
|
- //设置公开度
|
|
|
|
- if(subQuestion.getPublicity()){
|
|
|
|
- publicity = true;
|
|
|
|
- }
|
|
|
|
- if(subQuestion.getDifficultyDegree() == null){
|
|
|
|
- subQuestion.setDifficultyDegree(0.5);
|
|
|
|
- }
|
|
|
|
- totalSum = subQuestion.getDifficultyDegree() + totalSum;
|
|
|
|
- }
|
|
|
|
- BigDecimal b = new BigDecimal(totalSum / (oldPdu.getQuestion().getSubQuestions().size()));
|
|
|
|
- Double difficulty = b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- oldPdu.getQuestion().setDifficultyDegree(difficulty);
|
|
|
|
- oldPdu.getQuestion().setPublicity(publicity);
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
oldPdu.setQuestion(quesService.saveQues(pduExp.getQuestion()));
|
|
oldPdu.setQuestion(quesService.saveQues(pduExp.getQuestion()));
|