|
@@ -246,7 +246,7 @@ public class PaperStructService {
|
|
|
}
|
|
|
paperStruct.setPaperStrucType(PaperStructType.BLUEPRINT);
|
|
|
//计算试卷结构难度
|
|
|
- Double difficulty = getDifficulty(paperDetailStructs);
|
|
|
+ Double difficulty = getDifficulty(paperDetailStructs,paperStruct.getTotalScore());
|
|
|
paperStruct.setDifficulty(difficulty);
|
|
|
}
|
|
|
paperStruct.setOrgId(user.getRootOrgId().toString());
|
|
@@ -264,7 +264,8 @@ public class PaperStructService {
|
|
|
return unitStruct.getPropertyId() + "-" + String.valueOf(unitStruct.getPublicity()) + "-" + unitStruct.getDifficulty();
|
|
|
}
|
|
|
|
|
|
- public Double getDifficulty(List<PaperDetailStruct> paperDetailStructs) {
|
|
|
+ public Double getDifficulty(List<PaperDetailStruct> paperDetailStructs,Double totalScore) {
|
|
|
+ Double sum = 0.0;
|
|
|
if(paperDetailStructs != null && paperDetailStructs.size() >0){
|
|
|
Integer simpleCount = 0;
|
|
|
Integer mediumCount = 0;
|
|
@@ -273,8 +274,9 @@ public class PaperStructService {
|
|
|
simpleCount = paperDetailStruct.getPublicSimpleCount() + paperDetailStruct.getNoPublicSimpleCount();
|
|
|
mediumCount = paperDetailStruct.getPublicMediumCount() + paperDetailStruct.getNoPublicMediumCount();
|
|
|
difficultyCount = paperDetailStruct.getPublicDifficultyCount() + paperDetailStruct.getNoPublicDifficultyCount();
|
|
|
+ sum = simpleCount * paperDetailStruct.getScore() * 0.8 + mediumCount * paperDetailStruct.getScore() * 0.5 + difficultyCount * paperDetailStruct.getScore() * 0.2 + sum;
|
|
|
}
|
|
|
- Double dif = ((simpleCount * 0.8) + (mediumCount * 0.5) + (difficultyCount * 0.2))/(simpleCount + mediumCount + difficultyCount);
|
|
|
+ Double dif = sum / totalScore;
|
|
|
BigDecimal b = new BigDecimal(dif);
|
|
|
Double difficulty = b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
return difficulty;
|