|
@@ -663,10 +663,14 @@ public class GenPaperService {
|
|
sum += unit.getScore() * unit.getQuestion().getDifficultyDegree();
|
|
sum += unit.getScore() * unit.getQuestion().getDifficultyDegree();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- BigDecimal b = new BigDecimal(sum / paper.getTotalScore());
|
|
|
|
- Double difficulty = b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
- //赋值难度
|
|
|
|
- paper.setDifficultyDegree(difficulty);
|
|
|
|
|
|
+ if(paper.getTotalScore()<0.1){
|
|
|
|
+ paper.setDifficultyDegree(0d);
|
|
|
|
+ }else {
|
|
|
|
+ BigDecimal b = new BigDecimal(sum / paper.getTotalScore());
|
|
|
|
+ Double difficulty = b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
|
|
|
+ //赋值难度
|
|
|
|
+ paper.setDifficultyDegree(difficulty);
|
|
|
|
+ }
|
|
paper = paperRepo.save(paper);
|
|
paper = paperRepo.save(paper);
|
|
int number = 0;
|
|
int number = 0;
|
|
int allQuesCount = 0;
|
|
int allQuesCount = 0;
|