xiatian 1 년 전
부모
커밋
a4cd32dc36

+ 4 - 1
src/main/java/cn/com/qmth/export/CusQuesStructType.java

@@ -3,9 +3,12 @@ package cn.com.qmth.export;
 public enum CusQuesStructType {
 	
 	singlechoice(1,"单选题",true),
+	multichoice(2,"多选题",true),
+	bijudgement(3,"判断题",true),
+	fillblank(4,"填空题",false),
+	textarea(5,"问答题",false),
 	cloze(6,"套题",false),
 	complex(6,"套题",false),
-	textarea(5,"问答",false),
 	;
 	
 	private Integer typeId;

+ 25 - 0
src/main/java/cn/com/qmth/export/FillBlankAnswerVo.java

@@ -0,0 +1,25 @@
+package cn.com.qmth.export;
+
+import java.util.List;
+
+public class FillBlankAnswerVo {
+	private List<List<String>> answer;
+	private List<String> subArea;
+
+	public List<List<String>> getAnswer() {
+		return answer;
+	}
+
+	public void setAnswer(List<List<String>> answer) {
+		this.answer = answer;
+	}
+
+	public List<String> getSubArea() {
+		return subArea;
+	}
+
+	public void setSubArea(List<String> subArea) {
+		this.subArea = subArea;
+	}
+
+}

+ 17 - 4
src/main/java/cn/com/qmth/export/ExportPaperByCourseCode.java → src/main/java/cn/com/qmth/export/GkExportPaperByCourseCode.java

@@ -8,14 +8,18 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 
-public class ExportPaperByCourseCode {
-	private static Logger logger = LogManager.getLogger(ExportPaperByCourseCode.class);
+public class GkExportPaperByCourseCode {
+	private static Logger logger = LogManager.getLogger(GkExportPaperByCourseCode.class);
 	//试卷后缀
-	private static String paperSuff = "(240318)";
+	private static String paperSuff = "(240407)";
 	//数据库名
-	private static String dbName="guangkai3";
+	private static String dbName="guangkai2";
 	private static AtomicInteger count=new AtomicInteger(0);
 	
+	private static AtomicInteger valid=new AtomicInteger(0);
+	
+	private static AtomicInteger rectify=new AtomicInteger(0);
+	
 	public static void main(String[] args) {
 		logger.debug("导出开始");
 		Date start=new Date();
@@ -28,6 +32,8 @@ public class ExportPaperByCourseCode {
 		} catch (Exception e) {
 			logger.error(e.getCause(), e);
 		}
+		logger.debug("导出结束,纠正:"+rectify);
+		logger.debug("导出结束,舍弃:"+valid);
 		Date end=new Date();
 		logger.debug("导出结束,耗时:"+((end.getTime()-start.getTime())/1000));
 	}
@@ -37,4 +43,11 @@ public class ExportPaperByCourseCode {
 		count.addAndGet(1);
 		logger.debug("处理了"+count);
 	}
+	
+	public static void  addRectify() {
+		rectify.addAndGet(1);
+	}
+	public static void  addValid() {
+		valid.addAndGet(1);
+	}
 }

+ 3 - 3
src/main/java/cn/com/qmth/export/ExportPaperByCourseCode2.java → src/main/java/cn/com/qmth/export/GkExportPaperByCourseCode2.java

@@ -8,10 +8,10 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 
-public class ExportPaperByCourseCode2 {
-	private static Logger logger = LogManager.getLogger(ExportPaperByCourseCode2.class);
+public class GkExportPaperByCourseCode2 {
+	private static Logger logger = LogManager.getLogger(GkExportPaperByCourseCode2.class);
 	//试卷后缀
-	private static String paperSuff = "(240318)";
+	private static String paperSuff = "(240401)";
 	//数据库名
 	private static String dbName="guangkai3";
 	private static AtomicInteger count=new AtomicInteger(0);

+ 237 - 91
src/main/java/cn/com/qmth/export/MyConsumer.java

@@ -19,6 +19,7 @@ import java.util.stream.Collectors;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 
+import com.alibaba.fastjson.JSONException;
 import com.alibaba.fastjson.JSONObject;
 
 public class MyConsumer extends Consumer<PaperExportDto> {
@@ -28,8 +29,11 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 	private int maxqc = 200;
 
 	private static String paperDir = "d:/guangkai/paper/";
+	private static String imgDir = "d:/guangkai";
 
-	private Pattern imgPat = Pattern.compile("<img[^<]+src=\"([^<\"]+)\"[^<]*>");
+	private Pattern imgPat = Pattern.compile("<img[^<]+src=['\"]([^<\"]+)['\"][^<]*>");
+	
+	private Pattern xieGangPat = Pattern.compile("\\\\([^\"]|(\",))");
 
 	@Override
 	public void consume(PaperExportDto dto) {
@@ -46,7 +50,7 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 			String password = "123456";
 			connect = DriverManager.getConnection(url, user, password);
 			exportPaper(connect, dto);
-			ExportPaperByCourseCode.addDisposeCount();
+			GkExportPaperByCourseCode.addDisposeCount();
 		} catch (Exception e) {
 			throw new RuntimeException(e);
 		} finally {
@@ -59,98 +63,169 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		}
 	}
 
-	private List<KdQuestion> of(List<QuestionVo> vos,List<QuestionVo> subvosList) {
-		List<KdQuestion> ret=new ArrayList<>();
-		Map<String,List<QuestionVo>> submap=new HashMap<>();
-		if(CollectionUtils.isNotEmpty(subvosList)) {
-			for(QuestionVo vo:subvosList) {
-				List<QuestionVo> tem=submap.get(vo.getPid());
-				if(tem==null) {
-					tem=new ArrayList<>();
+	private List<KdQuestion> of(List<QuestionVo> vos, List<QuestionVo> subvosList) {
+		List<KdQuestion> ret = new ArrayList<>();
+		Map<String, List<QuestionVo>> submap = new HashMap<>();
+		if (CollectionUtils.isNotEmpty(subvosList)) {
+			for (QuestionVo vo : subvosList) {
+				List<QuestionVo> tem = submap.get(vo.getPid());
+				if (tem == null) {
+					tem = new ArrayList<>();
 					submap.put(vo.getPid(), tem);
 				}
 				tem.add(vo);
 			}
 		}
-		for(QuestionVo vo:vos) {
-			KdQuestion q=of(vo);
-			ret.add(q);
-			if(QuesStructType.NESTED_ANSWER_QUESTION.equals(q.getQuesStructType())) {
-				List<QuestionVo> subvos=submap.get(q.getId());
-				q.setScore((double)subvos.size());
-				List<Double> subScores=new ArrayList<>();
-				List<KdQuestion> subQues=new ArrayList<>();
-				q.setSubScores(subScores);
-				q.setSubQuestions(subQues);
-				int num=0;
-				for(QuestionVo subvo:subvos) {
-					num++;
-					subScores.add(1.0);
-					KdQuestion subq=of(subvo);
-					subq.setId(null);
-					if(CusQuesStructType.cloze.equals(q.getCusType())&&StringUtils.isBlank(subq.getBody())) {
-						subq.setBody("___"+num+"___");
+		for (QuestionVo vo : vos) {
+			try {
+				KdQuestion q = of(vo);
+				if (QuesStructType.NESTED_ANSWER_QUESTION.equals(q.getQuesStructType())) {
+					List<QuestionVo> subvos = submap.get(q.getId());
+					q.setScore((double) subvos.size());
+					List<Double> subScores = new ArrayList<>();
+					List<KdQuestion> subQues = new ArrayList<>();
+					q.setSubScores(subScores);
+					q.setSubQuestions(subQues);
+					int num = 0;
+					for (QuestionVo subvo : subvos) {
+						num++;
+						subScores.add(1.0);
+						KdQuestion subq = of(subvo);
+						subq.setId(null);
+						if (CusQuesStructType.cloze.equals(q.getCusType()) && StringUtils.isBlank(subq.getBody())) {
+							subq.setBody("___" + num + "___");
+						}
+						subQues.add(subq);
 					}
-					subQues.add(subq);
-				}
-				if(CusQuesStructType.cloze.equals(q.getCusType())) {
-					q.setBody(changeCloze(q.getBody()));
 				}
+				ret.add(q);
+			} catch (StatusException e) {
+				GkExportPaperByCourseCode.addValid();
+				continue;
 			}
 		}
 		return ret;
 	}
-	
+
+	private String changeBlank(String text, int answerCount,String qid) {
+		StringBuffer buffer = new StringBuffer();
+		String regex = "<fillblank/>";
+
+		Pattern pattern = Pattern.compile(regex);
+		Matcher matcher = pattern.matcher(text);
+		// 使用find()方法查找匹配项
+		int num = 0;
+		while (matcher.find()) {
+			num++;
+			matcher.appendReplacement(buffer, "###");
+		}
+		matcher.appendTail(buffer);
+		if (answerCount != num) {
+			throw new StatusException("答案数不匹配:"+qid);
+		}
+		return buffer.toString();
+	}
+
 	private String changeCloze(String text) {
 		StringBuffer buffer = new StringBuffer();
-        String regex = "<fillblank/>";
-
-        Pattern pattern = Pattern.compile(regex);
-        Matcher matcher = pattern.matcher(text);
-        // 使用find()方法查找匹配项
-        int num=0;
-        while (matcher.find()) {
-        	num++;
-        	matcher.appendReplacement(buffer, "___"+num+"___");
-        }
-        matcher.appendTail(buffer);
-        return buffer.toString();
+		String regex = "<fillblank/>";
+
+		Pattern pattern = Pattern.compile(regex);
+		Matcher matcher = pattern.matcher(text);
+		// 使用find()方法查找匹配项
+		int num = 0;
+		while (matcher.find()) {
+			num++;
+			matcher.appendReplacement(buffer, "___" + num + "___");
+		}
+		matcher.appendTail(buffer);
+		return buffer.toString();
 	}
-	
+
 	private KdQuestion of(QuestionVo vo) {
-		KdQuestion q=new KdQuestion();
+		KdQuestion q = new KdQuestion();
 		q.setCusType(vo.getqType());
 		q.setQuesStructType(QuesStructType.getQuesStructTypeById(vo.getqType().getTypeId()));
-		if(QuesStructType.SINGLE_ANSWER_QUESTION.equals(q.getQuesStructType())) {
-			List<KdQuesOption> options=new ArrayList<>();
+		q.setTypeId(vo.getTypeId());
+		q.setDetailName(vo.getTypeName());
+		q.setBody(vo.getBody());
+		q.setDifficulty(YunkaiDifficulty.ZHONGDENG);
+		q.setHaveAudio(false);
+		q.setId(vo.getQid());
+		q.setScore(1.0);
+		if (QuesStructType.SINGLE_ANSWER_QUESTION.equals(q.getQuesStructType())) {
+			List<KdQuesOption> options = new ArrayList<>();
 			q.setOptions(options);
-			int num=0;
-			boolean cel=false;
-			for(String a:vo.getAnswer().getSubArea()) {
+			int num = 0;
+			int answerCount = 0;
+			for (String a : vo.getAnswer().getSubArea()) {
 				num++;
-				KdQuesOption o=new KdQuesOption();
+				KdQuesOption o = new KdQuesOption();
 				options.add(o);
 				o.setNumber(num);
 				o.setBody(a);
-				o.setSelect(vo.getAnswer().getAnswer().contains(""+(num-1)));
-				if(o.getSelect()) {
-					cel=true;
+				o.setSelect(vo.getAnswer().getAnswer().contains("" + (num - 1)));
+				if (o.getSelect()) {
+					answerCount++;
 				}
 			}
-			if(!cel) {
+			if (answerCount == 0) {
+				throw new StatusException("没有答案:"+q.getId());
+			}
+			if (answerCount > 1) {
+				throw new StatusException("答案过多");
+			}
+		} else if (QuesStructType.MULTIPLE_ANSWER_QUESTION.equals(q.getQuesStructType())) {
+			List<KdQuesOption> options = new ArrayList<>();
+			q.setOptions(options);
+			int num = 0;
+			int answerCount = 0;
+			for (String a : vo.getAnswer().getSubArea()) {
+				num++;
+				KdQuesOption o = new KdQuesOption();
+				options.add(o);
+				o.setNumber(num);
+				o.setBody(a);
+				o.setSelect(vo.getAnswer().getAnswer().contains("" + (num - 1)));
+				if (o.getSelect()) {
+					answerCount++;
+				}
+			}
+			if (answerCount == 0) {
 				throw new StatusException("没有答案");
 			}
+			if (answerCount > 10) {
+				throw new StatusException("答案超过10个:" + vo.getQid());
+			}
+		} else if (QuesStructType.BOOL_ANSWER_QUESTION.equals(q.getQuesStructType())) {
+			if (vo.getAnswer().getAnswer().contains("0")) {
+				q.setAnswer("正确");
+			} else if (vo.getAnswer().getAnswer().contains("1")) {
+				q.setAnswer("错误");
+			} else {
+				throw new StatusException("答案有误");
+			}
+		} else if (QuesStructType.FILL_BLANK_QUESTION.equals(q.getQuesStructType())) {
+			int aCount = 0;
+			List<String> tem = new ArrayList<>();
+			for (List<String> ss : vo.getfAnswer().getAnswer()) {
+				for (String s : ss) {
+					aCount++;
+					tem.add(s);
+				}
+			}
+			q.setAnswer(StringUtils.join(tem, "##"));
+			q.setBody(changeBlank(q.getBody(), aCount,q.getId()));
+		} else if (QuesStructType.TEXT_ANSWER_QUESTION.equals(q.getQuesStructType())) {
+			q.setAnswer(StringUtils.join(vo.getAnswer().getAnswer(), ""));
+		} else if (QuesStructType.NESTED_ANSWER_QUESTION.equals(q.getQuesStructType())) {
+			if (CusQuesStructType.cloze.equals(q.getCusType())) {
+				q.setBody(changeCloze(q.getBody()));
+			}
+		} else {
+			throw new StatusException("题型有误");
 		}
-		if(!QuesStructType.NESTED_ANSWER_QUESTION.equals(q.getQuesStructType())) {
-			q.setAnswer(StringUtils.join(vo.getAnswer().getAnswer(),""));
-		}
-		q.setTypeId(vo.getTypeId());
-		q.setDetailName(vo.getTypeName());
-		q.setBody(vo.getBody());
-		q.setDifficulty(YunkaiDifficulty.ZHONGDENG);
-		q.setHaveAudio(false);
-		q.setId(vo.getQid());
-		q.setScore(1.0);
+		disposeQuestionImg(q);
 		return q;
 	}
 
@@ -159,10 +234,10 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		PreparedStatement preState = null;
 		ResultSet resultSet = null;
 		try {
-			String sql = " select q.TYPE_ID typeId,f.name typeName,f.ANSWER_TYPE qType " + " ,q.ID qid,q.TITLE body,q.FATHER_ID pid "
-					+ " ,q.answer,q.SHOW_ORDER seq  " + " from pe_question_bank t  "
-					+ " INNER JOIN pe_questions q on t.id=q.BANK_ID "
-					+ " INNER JOIN pe_question_type f on f.id=q.TYPE_ID " + " where t.course_id=" + courseCode;
+			String sql = " select q.TYPE_ID typeId,f.name typeName,f.ANSWER_TYPE qType "
+					+ " ,q.ID qid,q.TITLE body,q.FATHER_ID pid " + " ,q.answer,q.SHOW_ORDER seq  "
+					+ " from pe_question_bank t  " + " INNER JOIN pe_questions q on t.id=q.BANK_ID "
+					+ " INNER JOIN pe_question_type f on f.id=q.TYPE_ID " + " where t.course_id='" + courseCode + "'";
 
 			preState = connect.prepareStatement(sql);
 
@@ -175,9 +250,32 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 				q.setTypeName(resultSet.getString("typeName"));
 				q.setPid(resultSet.getString("pid"));
 				q.setqType(CusQuesStructType.valueOf(resultSet.getString("qType")));
-				q.setBody(disposeImg(resultSet.getString("body"), courseCode));
-				q.setAnswer(JSONObject.parseObject(resultSet.getString("answer"), AnswerVo.class));
+				q.setBody(resultSet.getString("body"));
 				q.setSeq(resultSet.getInt("seq"));
+				String an=resultSet.getString("answer");
+				try {
+					if (CusQuesStructType.fillblank.equals(q.getqType())) {
+						q.setfAnswer(JSONObject.parseObject(an, FillBlankAnswerVo.class));
+					} else {
+						q.setAnswer(JSONObject.parseObject(an, AnswerVo.class));
+					}
+				} catch (JSONException e) {
+					try {
+						System.out.println("old#############qid:" + q.getQid()+" "+an);
+						an=fomat(an);
+						System.out.println("new#############qid:" + q.getQid()+" "+an);
+						if (CusQuesStructType.fillblank.equals(q.getqType())) {
+							q.setfAnswer(JSONObject.parseObject(an, FillBlankAnswerVo.class));
+						} else {
+							q.setAnswer(JSONObject.parseObject(an, AnswerVo.class));
+						}
+						
+						GkExportPaperByCourseCode.addRectify();
+					} catch (Exception e1) {
+						GkExportPaperByCourseCode.addValid();
+						continue;
+					}
+				}
 				qs.add(q);
 			}
 			return qs;
@@ -190,7 +288,26 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 			}
 		}
 	}
-
+	
+	private String fomat(String text) {
+		StringBuffer buffer = new StringBuffer();
+		Matcher matcher = xieGangPat.matcher(text);
+		// 使用find()方法查找匹配项
+		while (matcher.find()) {
+			String tem=matcher.group(1);
+			matcher.appendReplacement(buffer, "\\\\\\\\"+tem);
+		}
+		matcher.appendTail(buffer);
+		return buffer.toString();
+	}
+	
+//	public static void main(String[] args) {
+//		String s="a\"\\\",b\\h";
+//		System.out.println(s);
+//		System.out.println(fomat(s));
+//	}
+	
+	
 	private List<QuestionVo> getSubQuestion(Connection connect, String courseCode, List<String> pids)
 			throws SQLException, IOException {
 		List<QuestionVo> qs = new ArrayList<>();
@@ -212,7 +329,7 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 				q.setTypeName(resultSet.getString("typeName"));
 				q.setPid(resultSet.getString("pid"));
 				q.setqType(CusQuesStructType.valueOf(resultSet.getString("qType")));
-				q.setBody(disposeImg(resultSet.getString("body"), courseCode));
+				q.setBody(resultSet.getString("body"));
 				q.setAnswer(JSONObject.parseObject(resultSet.getString("answer"), AnswerVo.class));
 				q.setSeq(resultSet.getInt("seq"));
 				qs.add(q);
@@ -228,7 +345,17 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		}
 	}
 
-	private String disposeImg(String str, String courseCode) {
+	private void disposeQuestionImg(KdQuestion q) {
+		q.setBody(disposeImg(q.getBody(), q.getId()));
+		if (CollectionUtils.isNotEmpty(q.getOptions())) {
+			for (KdQuesOption o : q.getOptions()) {
+				o.setBody(disposeImg(o.getBody(), q.getId()));
+			}
+		}
+		q.setAnswer(disposeImg(q.getAnswer(), q.getId()));
+	}
+
+	private String disposeImg(String str, String qid) {
 		if (StringUtils.isBlank(str)) {
 			return str;
 		}
@@ -236,15 +363,35 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		Map<String, String> srcMap = new HashMap<>();
 		while (matcher.find()) {
 			String imgSrc = matcher.group(1).trim();
-			if (imgSrc.toLowerCase().trim().startsWith("http")) {
+			if (imgSrc.startsWith("data:image/")) {
+
+			} else if (imgSrc.startsWith("/resourcefile/bdeditor")) {
 				if (srcMap.get(imgSrc) == null) {
-					String suff = imgSrc.substring(imgSrc.lastIndexOf(".") + 1).toLowerCase();
-					File img = new File(paperDir + courseCode + "/" + UUID.randomUUID() + "." + suff);
+					File img = new File(imgDir + imgSrc);
+					if (!img.exists()) {
+						throw new StatusException("图片有误:" + qid);
+					}
+					String base64 = FileUtil.fileToBase64Src(img);
+					srcMap.put(imgSrc, base64);
+				}
+			} else if (imgSrc.toLowerCase().trim().startsWith("http")) {
+				if (srcMap.get(imgSrc) == null) {
+					File img = new File(imgDir + "/" + UUID.randomUUID() + ".png");
 					FileUtil.saveUrlAs(imgSrc, img.getAbsolutePath());
 					String base64 = FileUtil.fileToBase64Src(img);
 					img.delete();
 					srcMap.put(imgSrc, base64);
 				}
+			} else if (imgSrc.toLowerCase().trim().startsWith("/formula")) {
+				if (srcMap.get(imgSrc) == null) {
+					File img = new File(imgDir + "/" + UUID.randomUUID() + ".png");
+					FileUtil.saveUrlAs("https://ougd-exam.webtrn.cn" + imgSrc, img.getAbsolutePath());
+					String base64 = FileUtil.fileToBase64Src(img);
+					img.delete();
+					srcMap.put(imgSrc, base64);
+				}
+			} else {
+				throw new StatusException("图片有误:" + qid);
 			}
 		}
 		for (String imgSrc : srcMap.keySet()) {
@@ -253,7 +400,6 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		return str;
 	}
 
-
 	private void exportPaper(Connection connect, PaperExportDto dto) throws Exception {
 		List<QuestionVo> vos = getQuestion(connect, dto.getCourseCode());
 		if (CollectionUtils.isEmpty(vos)) {
@@ -261,14 +407,14 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		}
 		List<String> pids = vos.stream().filter(e -> e.getqType().getTypeId() == 6).map(QuestionVo::getQid)
 				.collect(Collectors.toList());
-		List<QuestionVo> subvos = getSubQuestion(connect, dto.getCourseCode(),pids);
-		List<KdQuestion> qs=of(vos,subvos);
+		List<QuestionVo> subvos = getSubQuestion(connect, dto.getCourseCode(), pids);
+		List<KdQuestion> qs = of(vos, subvos);
 //		fillProp(connect, qs);
 //		fillAnswer(connect, qs, dto.getCourseCode());
 
 		Map<DetailDto, List<KdQuestion>> qmap = new HashMap<>();
 		for (KdQuestion q : qs) {
-			DetailDto tem=new DetailDto(q.getTypeId(), q.getDetailName());
+			DetailDto tem = new DetailDto(q.getTypeId(), q.getDetailName());
 			List<KdQuestion> list = qmap.get(tem);
 			if (list == null) {
 				list = new ArrayList<>();
@@ -304,15 +450,15 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		if (qs.size() == 0) {
 			return;
 		}
-		double score=0.0;
-		int unit=0;
-		for(KdQuestion q:qs) {
-			if(CollectionUtils.isNotEmpty(q.getSubQuestions())) {
-				unit=unit+q.getSubQuestions().size();
-			}else {
+		double score = 0.0;
+		int unit = 0;
+		for (KdQuestion q : qs) {
+			if (CollectionUtils.isNotEmpty(q.getSubQuestions())) {
+				unit = unit + q.getSubQuestions().size();
+			} else {
 				unit++;
 			}
-			score=Calculator.add(score, q.getScore(),1);
+			score = Calculator.add(score, q.getScore(), 1);
 		}
 		String detailName = qt.getTypeName();
 		KdPaper paper = new KdPaper();
@@ -332,7 +478,7 @@ public class MyConsumer extends Consumer<PaperExportDto> {
 		paper.setDetails(des);
 		paper.setDetailCount(1);
 		paper.setUnitCount(qs.size());
-		File paperdir = new File(paperDir + dto.getCourseCode() + "/" + qt.getTypeId()+ "/");
+		File paperdir = new File(paperDir + dto.getCourseCode() + "/" + qt.getTypeId() + "/");
 		paperdir.mkdirs();
 		try {
 			FileUtil.writeFile(paperdir.getAbsolutePath(), "/paper_" + indx + ".json", JSONObject.toJSONString(paper));

+ 5 - 4
src/main/java/cn/com/qmth/export/MyConsumer2.java

@@ -26,7 +26,7 @@ public class MyConsumer2 extends Consumer<PaperExportDto> {
 //	private static String[] sucStr = new String[] { "对", "正确", "√", "是", "True" };
 //	private static String[] errStr = new String[] { "错", "错误", "×", "不正确", "否", "False" };
 //	private static String paperSuff = "(231205)";
-	private int maxqc = 200;
+	private int maxqc = 20000000;
 
 	private static String paperDir = "d:/guangkai/paper/";
 
@@ -47,7 +47,7 @@ public class MyConsumer2 extends Consumer<PaperExportDto> {
 			String password = "123456";
 			connect = DriverManager.getConnection(url, user, password);
 			exportPaper(connect, dto);
-			ExportPaperByCourseCode.addDisposeCount();
+			GkExportPaperByCourseCode2.addDisposeCount();
 		} catch (Exception e) {
 			throw new RuntimeException(e);
 		} finally {
@@ -344,7 +344,8 @@ public class MyConsumer2 extends Consumer<PaperExportDto> {
 		paper.setDetailCount(1);
 		paper.setUnitCount(unit);
 		paper.setTotalScore(score);
-		paper.setName(dto.getPaperSuff() + qt.getPname()+qt.getTname() + "_" + indx);
+//		paper.setName(dto.getPaperSuff() + qt.getPname()+qt.getTname() + "_" + indx);
+		paper.setName(dto.getPaperSuff() + qt.getPname()+qt.getTname());
 		paper.setCourseCode(dto.getCourseCode());
 		List<KdDetail> des = new ArrayList<>();
 		KdDetail d = new KdDetail();
@@ -360,7 +361,7 @@ public class MyConsumer2 extends Consumer<PaperExportDto> {
 		try {
 			File paperdir = new File(paperDir + dto.getCourseCode() + "/" + MD5Util.encoder(qt.getPname()+qt.getTname())+ "/");
 			paperdir.mkdirs();
-			FileUtil.writeFile(paperdir.getAbsolutePath(), "/paper_" + indx + ".json", JSONObject.toJSONString(paper));
+			FileUtil.writeFile(paperdir.getAbsolutePath(), "/paper.json", JSONObject.toJSONString(paper));
 		} catch (IOException e) {
 			throw new RuntimeException(e);
 		} catch (NoSuchAlgorithmException e) {

+ 9 - 0
src/main/java/cn/com/qmth/export/QuestionVo.java

@@ -11,6 +11,7 @@ public class QuestionVo {
 	private String body;
 	private String pid;
 	private AnswerVo answer;
+	private FillBlankAnswerVo fAnswer;
 	private Integer seq;
 
 	public String getTypeName() {
@@ -101,4 +102,12 @@ public class QuestionVo {
 		this.cname = cname;
 	}
 
+	public FillBlankAnswerVo getfAnswer() {
+		return fAnswer;
+	}
+
+	public void setfAnswer(FillBlankAnswerVo fAnswer) {
+		this.fAnswer = fAnswer;
+	}
+
 }