|
@@ -41,7 +41,7 @@ public class PaperService {
|
|
|
Set<QuestionType> chooseTypes = Sets.newHashSet(QuestionType.Judgment, QuestionType.Multiple, QuestionType.Single);
|
|
Set<QuestionType> chooseTypes = Sets.newHashSet(QuestionType.Judgment, QuestionType.Multiple, QuestionType.Single);
|
|
|
private final LearnPaperMapper paperMapper;
|
|
private final LearnPaperMapper paperMapper;
|
|
|
private final LearnPaperQuestionMapper paperQuestionMapper;
|
|
private final LearnPaperQuestionMapper paperQuestionMapper;
|
|
|
- private final LearnQuestionsMapper questionsMapper;
|
|
|
|
|
|
|
+ private final ILearnQuestionsService questionsService;
|
|
|
private final ILearnQuestionsService learnQuestionsService;
|
|
private final ILearnQuestionsService learnQuestionsService;
|
|
|
private final LearnDirectedKnowledgeMapper learnDirectedKnowledgeMapper;
|
|
private final LearnDirectedKnowledgeMapper learnDirectedKnowledgeMapper;
|
|
|
private final IBBusiWishUniversitiesService wishUniversitiesService;
|
|
private final IBBusiWishUniversitiesService wishUniversitiesService;
|
|
@@ -50,10 +50,10 @@ public class PaperService {
|
|
|
private final LearnCultureKnowledgeMapper learnCultureKnowledgeMapper;
|
|
private final LearnCultureKnowledgeMapper learnCultureKnowledgeMapper;
|
|
|
private final DzSubjectMapper dzSubjectMapper;
|
|
private final DzSubjectMapper dzSubjectMapper;
|
|
|
|
|
|
|
|
- PaperService(LearnPaperMapper paperMapper, LearnPaperQuestionMapper paperQuestionMapper, LearnQuestionsMapper questionsMapper, ILearnQuestionsService learnQuestionsService, LearnDirectedKnowledgeMapper learnDirectedKnowledgeMapper, IBBusiWishUniversitiesService wishUniversitiesService, BBusiWishUniversitiesMapper bBusiWishUniversitiesMapper, LearnKnowledgeTreeMapper learnKnowledgeTreeMapper, LearnCultureKnowledgeMapper learnCultureKnowledgeMapper, DzSubjectMapper dzSubjectMapper) {
|
|
|
|
|
|
|
+ PaperService(LearnPaperMapper paperMapper, LearnPaperQuestionMapper paperQuestionMapper, ILearnQuestionsService questionsService, ILearnQuestionsService learnQuestionsService, LearnDirectedKnowledgeMapper learnDirectedKnowledgeMapper, IBBusiWishUniversitiesService wishUniversitiesService, BBusiWishUniversitiesMapper bBusiWishUniversitiesMapper, LearnKnowledgeTreeMapper learnKnowledgeTreeMapper, LearnCultureKnowledgeMapper learnCultureKnowledgeMapper, DzSubjectMapper dzSubjectMapper) {
|
|
|
this.paperMapper = paperMapper;
|
|
this.paperMapper = paperMapper;
|
|
|
this.paperQuestionMapper = paperQuestionMapper;
|
|
this.paperQuestionMapper = paperQuestionMapper;
|
|
|
- this.questionsMapper = questionsMapper;
|
|
|
|
|
|
|
+ this.questionsService = questionsService;
|
|
|
this.learnQuestionsService = learnQuestionsService;
|
|
this.learnQuestionsService = learnQuestionsService;
|
|
|
this.learnDirectedKnowledgeMapper = learnDirectedKnowledgeMapper;
|
|
this.learnDirectedKnowledgeMapper = learnDirectedKnowledgeMapper;
|
|
|
this.wishUniversitiesService = wishUniversitiesService;
|
|
this.wishUniversitiesService = wishUniversitiesService;
|
|
@@ -94,7 +94,7 @@ public class PaperService {
|
|
|
do {
|
|
do {
|
|
|
cond.setId(id);
|
|
cond.setId(id);
|
|
|
PageHelper.startPage(1, pageSize, null);
|
|
PageHelper.startPage(1, pageSize, null);
|
|
|
- questionsList = questionsMapper.selectLearnQuestionsList(cond);
|
|
|
|
|
|
|
+ questionsList = questionsService.selectLearnQuestionsList(cond);
|
|
|
for(LearnQuestions q : questionsList) {
|
|
for(LearnQuestions q : questionsList) {
|
|
|
boolean updated = false;
|
|
boolean updated = false;
|
|
|
LearnQuestions up = new LearnQuestions();
|
|
LearnQuestions up = new LearnQuestions();
|
|
@@ -165,7 +165,7 @@ public class PaperService {
|
|
|
}
|
|
}
|
|
|
if(updated) {
|
|
if(updated) {
|
|
|
up.setIsUpdate(1L);
|
|
up.setIsUpdate(1L);
|
|
|
- questionsMapper.updateLearnQuestions(up);
|
|
|
|
|
|
|
+ questionsService.updateLearnQuestions(up);
|
|
|
}
|
|
}
|
|
|
id = q.getId();
|
|
id = q.getId();
|
|
|
}
|
|
}
|
|
@@ -342,7 +342,7 @@ public class PaperService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public List<PaperVO.QuestionSeq> loadPaperQuestions(Long paperId) {
|
|
public List<PaperVO.QuestionSeq> loadPaperQuestions(Long paperId) {
|
|
|
- List<LearnQuestions> questions = questionsMapper.selectQuestionByPaperId(paperId);
|
|
|
|
|
|
|
+ List<LearnQuestions> questions = questionsService.selectQuestionByPaperId(paperId);
|
|
|
Map<String, PaperVO.QuestionSeq> gropuMap = Maps.newHashMap();
|
|
Map<String, PaperVO.QuestionSeq> gropuMap = Maps.newHashMap();
|
|
|
List<PaperVO.QuestionSeq> paperQuestionList = Lists.newArrayList();
|
|
List<PaperVO.QuestionSeq> paperQuestionList = Lists.newArrayList();
|
|
|
for(LearnQuestions lqs : questions) {
|
|
for(LearnQuestions lqs : questions) {
|
|
@@ -376,8 +376,7 @@ public class PaperService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<PaperVO.QuestionAnswer> loadPaperQuestionAnswers(Long userId, Long paperId, Map<Long, LearnAnswer> answerMap, boolean withParse) {
|
|
public List<PaperVO.QuestionAnswer> loadPaperQuestionAnswers(Long userId, Long paperId, Map<Long, LearnAnswer> answerMap, boolean withParse) {
|
|
|
- List<LearnQuestions> questions = questionsMapper.selectQuestionByPaperId(paperId);
|
|
|
|
|
- learnQuestionsService.fillCollectInfo(userId, questions);
|
|
|
|
|
|
|
+ List<LearnQuestions> questions = questionsService.selectQuestionByPaperId(paperId);
|
|
|
Map<String, PaperVO.QuestionAnswer> gropuMap = Maps.newHashMap();
|
|
Map<String, PaperVO.QuestionAnswer> gropuMap = Maps.newHashMap();
|
|
|
List<PaperVO.QuestionAnswer> paperQuestionList = Lists.newArrayList();
|
|
List<PaperVO.QuestionAnswer> paperQuestionList = Lists.newArrayList();
|
|
|
LearnAnswer answer;
|
|
LearnAnswer answer;
|
|
@@ -578,7 +577,7 @@ public class PaperService {
|
|
|
qCond.setId(studentId);
|
|
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");
|
|
qCond.setIsSubType("2");
|
|
|
- questions = questionsMapper.selectQuestionsForPaper(qCond);
|
|
|
|
|
|
|
+ questions = questionsService.selectQuestionsForPaper(qCond);
|
|
|
typeQuestionMap.put(knowTypeAssign.getType(), questions);
|
|
typeQuestionMap.put(knowTypeAssign.getType(), questions);
|
|
|
}
|
|
}
|
|
|
if(!questions.isEmpty()) {
|
|
if(!questions.isEmpty()) {
|
|
@@ -928,7 +927,7 @@ public class PaperService {
|
|
|
if(ktc.exclAssign > 0){
|
|
if(ktc.exclAssign > 0){
|
|
|
qCond.setId(studentId);
|
|
qCond.setId(studentId);
|
|
|
qCond.setNumber(ktc.exclAssign > 500 ? (long) random.nextInt(ktc.exclAssign.intValue() - 500) : 0L);
|
|
qCond.setNumber(ktc.exclAssign > 500 ? (long) random.nextInt(ktc.exclAssign.intValue() - 500) : 0L);
|
|
|
- List<LearnQuestions> questions = questionsMapper.selectQuestionsForPaper(qCond);
|
|
|
|
|
|
|
+ List<LearnQuestions> questions = questionsService.selectQuestionsForPaper(qCond);
|
|
|
ktc.exclAssign = addRandomList(knowId, qt, questions, random, paperDef.getTotal(), ktc.exclAssign, typeDef.getScore().doubleValue(), existQuestionSet, 1, pqList);
|
|
ktc.exclAssign = addRandomList(knowId, qt, questions, random, paperDef.getTotal(), ktc.exclAssign, typeDef.getScore().doubleValue(), existQuestionSet, 1, pqList);
|
|
|
if(pqList.size() == total) {
|
|
if(pqList.size() == total) {
|
|
|
break;
|
|
break;
|
|
@@ -937,7 +936,7 @@ public class PaperService {
|
|
|
if(ktc.assign > 0L) {
|
|
if(ktc.assign > 0L) {
|
|
|
qCond.setId(null);
|
|
qCond.setId(null);
|
|
|
qCond.setNumber(ktc.assign > 500 ? (long) random.nextInt(ktc.assign.intValue() - 500) : 0L);
|
|
qCond.setNumber(ktc.assign > 500 ? (long) random.nextInt(ktc.assign.intValue() - 500) : 0L);
|
|
|
- List<LearnQuestions> questions = questionsMapper.selectQuestionsForPaper(qCond);
|
|
|
|
|
|
|
+ List<LearnQuestions> questions = questionsService.selectQuestionsForPaper(qCond);
|
|
|
ktc.assign = addRandomList(knowId, qt, questions, random, paperDef.getTotal(), ktc.assign, typeDef.getScore().doubleValue(), existQuestionSet, 1, pqList);
|
|
ktc.assign = addRandomList(knowId, qt, questions, random, paperDef.getTotal(), ktc.assign, typeDef.getScore().doubleValue(), existQuestionSet, 1, pqList);
|
|
|
if(pqList.size() == total) {
|
|
if(pqList.size() == total) {
|
|
|
break;
|
|
break;
|
|
@@ -977,7 +976,7 @@ public class PaperService {
|
|
|
if(ktc.exclAssign > 0){
|
|
if(ktc.exclAssign > 0){
|
|
|
qCond.setId(studentId);
|
|
qCond.setId(studentId);
|
|
|
qCond.setNumber(ktc.exclAssign > 500 ? (long) random.nextInt(ktc.exclAssign.intValue() - 500) : 0L);
|
|
qCond.setNumber(ktc.exclAssign > 500 ? (long) random.nextInt(ktc.exclAssign.intValue() - 500) : 0L);
|
|
|
- List<LearnQuestions> questions = questionsMapper.selectQuestionsForPaper(qCond);
|
|
|
|
|
|
|
+ List<LearnQuestions> questions = questionsService.selectQuestionsForPaper(qCond);
|
|
|
ktc.exclAssign = addRandomList(knowId, typeDef.getType(), questions, random, total.longValue(), ktc.exclAssign, typeDef.getScore(), existQuestionSet, seqId, pqList);
|
|
ktc.exclAssign = addRandomList(knowId, typeDef.getType(), questions, random, total.longValue(), ktc.exclAssign, typeDef.getScore(), existQuestionSet, seqId, pqList);
|
|
|
if(pqList.size() == total) {
|
|
if(pqList.size() == total) {
|
|
|
break;
|
|
break;
|
|
@@ -986,7 +985,7 @@ public class PaperService {
|
|
|
if(ktc.assign > 0L) {
|
|
if(ktc.assign > 0L) {
|
|
|
qCond.setId(null);
|
|
qCond.setId(null);
|
|
|
qCond.setNumber(ktc.assign > 1000 ? (long) random.nextInt(ktc.assign.intValue() - 1000) : 0L);
|
|
qCond.setNumber(ktc.assign > 1000 ? (long) random.nextInt(ktc.assign.intValue() - 1000) : 0L);
|
|
|
- List<LearnQuestions> questions = questionsMapper.selectQuestionsForPaper(qCond);
|
|
|
|
|
|
|
+ List<LearnQuestions> questions = questionsService.selectQuestionsForPaper(qCond);
|
|
|
ktc.assign = addRandomList(knowId, typeDef.getType(), questions, random, total.longValue(), ktc.assign, typeDef.getScore(), existQuestionSet, seqId, pqList);
|
|
ktc.assign = addRandomList(knowId, typeDef.getType(), questions, random, total.longValue(), ktc.assign, typeDef.getScore(), existQuestionSet, seqId, pqList);
|
|
|
if(pqList.size() == total) {
|
|
if(pqList.size() == total) {
|
|
|
break;
|
|
break;
|
|
@@ -1059,7 +1058,7 @@ public class PaperService {
|
|
|
if("1".equals(q.getIsSubType())) {
|
|
if("1".equals(q.getIsSubType())) {
|
|
|
LearnQuestions subCond = new LearnQuestions();
|
|
LearnQuestions subCond = new LearnQuestions();
|
|
|
subCond.setKnowId(q.getId());
|
|
subCond.setKnowId(q.getId());
|
|
|
- for(LearnQuestions sq : questionsMapper.selectLearnQuestionsList(subCond)) {
|
|
|
|
|
|
|
+ for(LearnQuestions sq : questionsService.selectLearnQuestionsList(subCond)) {
|
|
|
LearnPaperQuestion pq = new LearnPaperQuestion();
|
|
LearnPaperQuestion pq = new LearnPaperQuestion();
|
|
|
pq.setSeq(baseSeq + pqList.size());
|
|
pq.setSeq(baseSeq + pqList.size());
|
|
|
pq.setKnowledgeId(knowId);
|
|
pq.setKnowledgeId(knowId);
|
|
@@ -1151,7 +1150,7 @@ public class PaperService {
|
|
|
* @param index 1 free 2 used
|
|
* @param index 1 free 2 used
|
|
|
*/
|
|
*/
|
|
|
private void setValue(Map<String, KnowTypeAssign> knowTypeAssignMap, Map cond, Integer index) {
|
|
private void setValue(Map<String, KnowTypeAssign> knowTypeAssignMap, Map cond, Integer index) {
|
|
|
- for (LearnQuestions q : questionsMapper.statByKnowledgeType(cond)) {
|
|
|
|
|
|
|
+ for (LearnQuestions q : questionsService.statByKnowledgeType(cond)) {
|
|
|
String key = q.getKnowledgeId() + "_" + q.getQtpye();
|
|
String key = q.getKnowledgeId() + "_" + q.getQtpye();
|
|
|
KnowTypeAssign knowTypeAssign = knowTypeAssignMap.get(key);
|
|
KnowTypeAssign knowTypeAssign = knowTypeAssignMap.get(key);
|
|
|
if (null == knowTypeAssign) {
|
|
if (null == knowTypeAssign) {
|