|
@@ -450,24 +450,24 @@ public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, Que
|
|
|
|
|
|
int randomNum = 0;
|
|
|
for (int j = 0; j < difficult; j++) {
|
|
|
- randomNum = random.nextInt(9);
|
|
|
-
|
|
|
if(qt.getSubject()==1 || (qt.getSubject()==4 && easyMultiple==0)) {
|
|
|
- if (randomNum <= 4) { //判断题
|
|
|
+ randomNum = random.nextInt(2); //随机出现 0和1 0表示判断 1表示单选
|
|
|
+ if (randomNum == 0) { //判断题
|
|
|
diffJudeg++;
|
|
|
easyJudge--;
|
|
|
- } else if (randomNum <= 9) { //单选题
|
|
|
+ } else if (randomNum == 1) { //单选题
|
|
|
diffChoice++;
|
|
|
easyChoice--;
|
|
|
}
|
|
|
} else if(qt.getSubject()==4){
|
|
|
- if (randomNum <= 2) { //判断题
|
|
|
+ randomNum = random.nextInt(3); //随机出现 0、1、2 0表示判断 1表示单选 2多选
|
|
|
+ if (randomNum == 0) { //判断题
|
|
|
diffJudeg++;
|
|
|
easyJudge--;
|
|
|
- } else if (randomNum <= 5) { //单选题
|
|
|
+ } else if (randomNum == 1) { //单选题
|
|
|
diffChoice++;
|
|
|
easyChoice--;
|
|
|
- } else if (randomNum <= 8) { //多选题
|
|
|
+ } else if (randomNum == 2) { //多选题
|
|
|
diffMultiple++;
|
|
|
easyMultiple--;
|
|
|
}
|