|
@@ -2,18 +2,14 @@ package cn.com.qmth.examcloud.core.questions.service.impl;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
-import cn.com.qmth.examcloud.core.questions.base.Model;
|
|
|
|
-import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
|
|
|
|
import cn.com.qmth.examcloud.core.questions.base.CommonUtils;
|
|
import cn.com.qmth.examcloud.core.questions.base.CommonUtils;
|
|
import cn.com.qmth.examcloud.core.questions.base.FileDisposeUtil;
|
|
import cn.com.qmth.examcloud.core.questions.base.FileDisposeUtil;
|
|
|
|
+import cn.com.qmth.examcloud.core.questions.base.Model;
|
|
import cn.com.qmth.examcloud.core.questions.base.SpringContextUtils;
|
|
import cn.com.qmth.examcloud.core.questions.base.SpringContextUtils;
|
|
import cn.com.qmth.examcloud.core.questions.base.enums.ExamFileType;
|
|
import cn.com.qmth.examcloud.core.questions.base.enums.ExamFileType;
|
|
|
|
+import cn.com.qmth.examcloud.core.questions.base.question.enums.QuesStructType;
|
|
import cn.com.qmth.examcloud.core.questions.base.word.DocxProcessUtil;
|
|
import cn.com.qmth.examcloud.core.questions.base.word.DocxProcessUtil;
|
|
-import cn.com.qmth.examcloud.core.questions.dao.CoursePropertyRepo;
|
|
|
|
-import cn.com.qmth.examcloud.core.questions.dao.PaperDetailUnitRepo;
|
|
|
|
-import cn.com.qmth.examcloud.core.questions.dao.PaperRepo;
|
|
|
|
-import cn.com.qmth.examcloud.core.questions.dao.QuesPkgPathRepo;
|
|
|
|
-import cn.com.qmth.examcloud.core.questions.dao.QuestionAudioRepo;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.core.questions.dao.*;
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.*;
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.*;
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.computerTestModel.*;
|
|
import cn.com.qmth.examcloud.core.questions.dao.entity.computerTestModel.*;
|
|
import cn.com.qmth.examcloud.core.questions.service.ExportPaperService;
|
|
import cn.com.qmth.examcloud.core.questions.service.ExportPaperService;
|
|
@@ -24,12 +20,9 @@ import cn.com.qmth.examcloud.core.questions.service.bean.dto.PaperExp;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.QuestionDistributeDto;
|
|
import cn.com.qmth.examcloud.core.questions.service.bean.dto.QuestionDistributeDto;
|
|
import cn.com.qmth.examcloud.core.questions.service.converter.PrintExamPaperService;
|
|
import cn.com.qmth.examcloud.core.questions.service.converter.PrintExamPaperService;
|
|
import cn.com.qmth.examcloud.core.questions.service.export.ExportPaperAbstractService;
|
|
import cn.com.qmth.examcloud.core.questions.service.export.ExportPaperAbstractService;
|
|
-
|
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
-
|
|
|
|
import main.java.com.UpYun;
|
|
import main.java.com.UpYun;
|
|
-
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.io.IOUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -47,7 +40,6 @@ import org.springframework.data.mongodb.core.query.Query;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
-
|
|
|
|
import java.io.*;
|
|
import java.io.*;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
@@ -561,8 +553,14 @@ public class ExportPaperServiceImpl implements ExportPaperService {
|
|
List<Question> mulList = questionList(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, sonProperty);
|
|
List<Question> mulList = questionList(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, sonProperty);
|
|
//判断题集合
|
|
//判断题集合
|
|
List<Question> bolList = questionList(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, sonProperty);
|
|
List<Question> bolList = questionList(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, sonProperty);
|
|
|
|
+
|
|
|
|
+ List<Question> fillList = null;
|
|
|
|
+ //fillList = questionList(courseNo, courseProperty, QuesStructType.FILL_BLANK_QUESTION, parentProperty, sonProperty);
|
|
|
|
+ List<Question> textList = null;
|
|
|
|
+ //textList = questionList(courseNo, courseProperty, QuesStructType.TEXT_ANSWER_QUESTION, parentProperty, sonProperty);
|
|
|
|
+
|
|
//计算所有题型数量
|
|
//计算所有题型数量
|
|
- Map<Long, Long> map = countQuesType(sinList, mulList, bolList);
|
|
|
|
|
|
+ Map<Long, Long> map = countQuesType(sinList, mulList, bolList, fillList, textList);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), sonProperty.getName(), map);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), sonProperty.getName(), map);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
}
|
|
}
|
|
@@ -574,8 +572,14 @@ public class ExportPaperServiceImpl implements ExportPaperService {
|
|
List<Question> mulList = questionList(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, null);
|
|
List<Question> mulList = questionList(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, null);
|
|
//判断题集合
|
|
//判断题集合
|
|
List<Question> bolList = questionList(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, null);
|
|
List<Question> bolList = questionList(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, null);
|
|
|
|
+
|
|
|
|
+ List<Question> fillList = null;
|
|
|
|
+ //fillList = questionList(courseNo, courseProperty, QuesStructType.FILL_BLANK_QUESTION, parentProperty, null);
|
|
|
|
+ List<Question> textList = null;
|
|
|
|
+ //textList = questionList(courseNo, courseProperty, QuesStructType.TEXT_ANSWER_QUESTION, parentProperty, null);
|
|
|
|
+
|
|
//计算所有题型数量
|
|
//计算所有题型数量
|
|
- Map<Long, Long> map = countQuesType(sinList, mulList, bolList);
|
|
|
|
|
|
+ Map<Long, Long> map = countQuesType(sinList, mulList, bolList, fillList, textList);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), null, map);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), null, map);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
}
|
|
}
|
|
@@ -639,11 +643,19 @@ public class ExportPaperServiceImpl implements ExportPaperService {
|
|
FileUtils.deleteQuietly(file);
|
|
FileUtils.deleteQuietly(file);
|
|
}
|
|
}
|
|
|
|
|
|
- private Map<Long, Long> countQuesType(List<Question> sinList, List<Question> mulList, List<Question> bolList) {
|
|
|
|
- Map<Long, Long> map = new TreeMap<Long, Long>();
|
|
|
|
|
|
+ private Map<Long, Long> countQuesType(List<Question> sinList, List<Question> mulList, List<Question> bolList, List<Question> fillList, List<Question> textList) {
|
|
|
|
+ Map<Long, Long> map = new TreeMap<>();
|
|
map = buildMap(sinList, map, 1);
|
|
map = buildMap(sinList, map, 1);
|
|
map = buildMap(mulList, map, 2);
|
|
map = buildMap(mulList, map, 2);
|
|
map = buildMap(bolList, map, 3);
|
|
map = buildMap(bolList, map, 3);
|
|
|
|
+
|
|
|
|
+ if (fillList != null) {
|
|
|
|
+ map = buildMap(fillList, map, 4);
|
|
|
|
+ }
|
|
|
|
+ if (textList != null) {
|
|
|
|
+ map = buildMap(textList, map, 5);
|
|
|
|
+ }
|
|
|
|
+
|
|
//给map的键排序
|
|
//给map的键排序
|
|
Map<Long, Long> resultMap = sortMapByKey(map);
|
|
Map<Long, Long> resultMap = sortMapByKey(map);
|
|
return resultMap;
|
|
return resultMap;
|
|
@@ -833,8 +845,14 @@ public class ExportPaperServiceImpl implements ExportPaperService {
|
|
List<Question> mulList = questionList2(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, sonProperty, questions);
|
|
List<Question> mulList = questionList2(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, sonProperty, questions);
|
|
//判断题集合
|
|
//判断题集合
|
|
List<Question> bolList = questionList2(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, sonProperty, questions);
|
|
List<Question> bolList = questionList2(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, sonProperty, questions);
|
|
|
|
+
|
|
|
|
+ List<Question> fillList = null;
|
|
|
|
+ //fillList = questionList2(courseNo, courseProperty, QuesStructType.FILL_BLANK_QUESTION, parentProperty, sonProperty, questions);
|
|
|
|
+ List<Question> textList = null;
|
|
|
|
+ //textList = questionList2(courseNo, courseProperty, QuesStructType.TEXT_ANSWER_QUESTION, parentProperty, sonProperty, questions);
|
|
|
|
+
|
|
//计算所有题型数量
|
|
//计算所有题型数量
|
|
- Map<Long, Long> map = countQuesType(sinList, mulList, bolList);
|
|
|
|
|
|
+ Map<Long, Long> map = countQuesType(sinList, mulList, bolList, fillList, textList);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), sonProperty.getName(), map);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), sonProperty.getName(), map);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
}
|
|
}
|
|
@@ -846,8 +864,14 @@ public class ExportPaperServiceImpl implements ExportPaperService {
|
|
List<Question> mulList = questionList2(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, null, questions);
|
|
List<Question> mulList = questionList2(courseNo, courseProperty, QuesStructType.MULTIPLE_ANSWER_QUESTION, parentProperty, null, questions);
|
|
//判断题集合
|
|
//判断题集合
|
|
List<Question> bolList = questionList2(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, null, questions);
|
|
List<Question> bolList = questionList2(courseNo, courseProperty, QuesStructType.BOOL_ANSWER_QUESTION, parentProperty, null, questions);
|
|
|
|
+
|
|
|
|
+ List<Question> fillList = null;
|
|
|
|
+ //fillList = questionList2(courseNo, courseProperty, QuesStructType.FILL_BLANK_QUESTION, parentProperty, null, questions);
|
|
|
|
+ List<Question> textList = null;
|
|
|
|
+ //textList = questionList2(courseNo, courseProperty, QuesStructType.TEXT_ANSWER_QUESTION, parentProperty, null, questions);
|
|
|
|
+
|
|
//计算所有题型数量
|
|
//计算所有题型数量
|
|
- Map<Long, Long> map = countQuesType(sinList, mulList, bolList);
|
|
|
|
|
|
+ Map<Long, Long> map = countQuesType(sinList, mulList, bolList, fillList, textList);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), null, map);
|
|
QuestionDistributeDto questionDistributeDto = new QuestionDistributeDto(courseProperty.getName(), parentProperty.getName(), null, map);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
questionDistributeDtos.add(questionDistributeDto);
|
|
}
|
|
}
|