|
|
@@ -572,19 +572,19 @@ public class PaperService {
|
|
|
KnowTypeAssign knowTypeAssign = knowTypeAssignList.get(idx);
|
|
|
if(knowTypeAssign.getExclCount() > knowTypeAssign.getExclAssign()) {
|
|
|
List<LearnQuestions> questions = typeQuestionMap.get(knowTypeAssign.getType());
|
|
|
- if(null == questions) {
|
|
|
+ if (null == questions) {
|
|
|
qCond.setKnowledgeId(knowTypeAssign.getKnowId());
|
|
|
qCond.setQtpye(knowTypeAssign.getType());
|
|
|
qCond.setId(studentId);
|
|
|
- qCond.setNumber(knowTypeAssign.exclCount > 500 ? (long) random.nextInt(knowTypeAssign.exclCount.intValue() - 500) : 0L);
|
|
|
+ qCond.setNumber(knowTypeAssign.exclCount > 500 ? (long) random.nextInt(knowTypeAssign.exclCount.intValue() - 500) : 0L);
|
|
|
qCond.setIsSubType("2");
|
|
|
questions = questionsService.selectQuestionsForPaper(qCond);
|
|
|
typeQuestionMap.put(knowTypeAssign.getType(), questions);
|
|
|
}
|
|
|
- if(!questions.isEmpty()) {
|
|
|
+ if (!questions.isEmpty()) {
|
|
|
int oldSize = pqList.size();
|
|
|
addRandomList(knowTypeAssign.getKnowId(), QuestionType.of(knowTypeAssign.getType()), questions, random, total.longValue(), 1L, 1.0, existQuestionSet, 1, pqList);
|
|
|
- if(oldSize != pqList.size()) {
|
|
|
+ if (oldSize != pqList.size()) {
|
|
|
knowTypeAssign.exclAssign++;
|
|
|
} else {
|
|
|
knowTypeAssignList.remove(idx);
|
|
|
@@ -592,6 +592,27 @@ public class PaperService {
|
|
|
} else {
|
|
|
knowTypeAssignList.remove(idx);
|
|
|
}
|
|
|
+ } else if(knowTypeAssign.getTotal() > knowTypeAssign.getAssign()) {
|
|
|
+ List<LearnQuestions> questions = typeQuestionMap.get(knowTypeAssign.getType());
|
|
|
+ if (null == questions) {
|
|
|
+ qCond.setKnowledgeId(knowTypeAssign.getKnowId());
|
|
|
+ qCond.setQtpye(knowTypeAssign.getType());
|
|
|
+ qCond.setNumber(knowTypeAssign.exclCount > 500 ? (long) random.nextInt(knowTypeAssign.exclCount.intValue() - 500) : 0L);
|
|
|
+ qCond.setIsSubType("2");
|
|
|
+ questions = questionsService.selectQuestionsForPaper(qCond);
|
|
|
+ typeQuestionMap.put(knowTypeAssign.getType(), questions);
|
|
|
+ }
|
|
|
+ if (!questions.isEmpty()) {
|
|
|
+ int oldSize = pqList.size();
|
|
|
+ addRandomList(knowTypeAssign.getKnowId(), QuestionType.of(knowTypeAssign.getType()), questions, random, total.longValue(), 1L, 1.0, existQuestionSet, 1, pqList);
|
|
|
+ if (oldSize != pqList.size()) {
|
|
|
+ knowTypeAssign.assign++;
|
|
|
+ } else {
|
|
|
+ knowTypeAssignList.remove(idx);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ knowTypeAssignList.remove(idx);
|
|
|
+ }
|
|
|
} else {
|
|
|
knowTypeAssignList.remove(idx);
|
|
|
}
|