|
@@ -284,7 +284,7 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
throw new BusinessException("试卷编码不匹配");
|
|
throw new BusinessException("试卷编码不匹配");
|
|
}
|
|
}
|
|
String structPath = paper.getStructPath();
|
|
String structPath = paper.getStructPath();
|
|
- structFile = new File(rootDir + SystemConstant.getUuid() + ".json");
|
|
|
|
|
|
+ structFile = new File(rootDir + SystemConstant.getUuid() + SystemConstant.JSON_PREFIX);
|
|
ossUtil.download(false, structPath, structFile.getAbsolutePath());
|
|
ossUtil.download(false, structPath, structFile.getAbsolutePath());
|
|
}
|
|
}
|
|
disposeAnswer(rootDir, paper, answerFile, structFile, attachmentDir);
|
|
disposeAnswer(rootDir, paper, answerFile, structFile, attachmentDir);
|
|
@@ -298,33 +298,33 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
private void disposeViewPaper(String rootDir, TEExamPaper paper, File paperFile, File attachmentDir)
|
|
private void disposeViewPaper(String rootDir, TEExamPaper paper, File paperFile, File attachmentDir)
|
|
throws IOException {
|
|
throws IOException {
|
|
JSONObject structJson = JSONObject.parseObject(FileUtil.readFileContent(paperFile));
|
|
JSONObject structJson = JSONObject.parseObject(FileUtil.readFileContent(paperFile));
|
|
- JSONArray structdetails = structJson.getJSONArray("details");
|
|
|
|
|
|
+ JSONArray structdetails = structJson.getJSONArray(SystemConstant.DETAILS);
|
|
if (structdetails == null || structdetails.size() == 0) {
|
|
if (structdetails == null || structdetails.size() == 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
for (int i = 0; i < structdetails.size(); i++) {
|
|
for (int i = 0; i < structdetails.size(); i++) {
|
|
- JSONArray structdetailquestions = structdetails.getJSONObject(i).getJSONArray("questions");
|
|
|
|
|
|
+ JSONArray structdetailquestions = structdetails.getJSONObject(i).getJSONArray(SystemConstant.QUESTIONS);
|
|
if (structdetailquestions != null && structdetailquestions.size() >= 0) {
|
|
if (structdetailquestions != null && structdetailquestions.size() >= 0) {
|
|
for (int j = 0; j < structdetailquestions.size(); j++) {
|
|
for (int j = 0; j < structdetailquestions.size(); j++) {
|
|
JSONObject structquestion = structdetailquestions.getJSONObject(j);
|
|
JSONObject structquestion = structdetailquestions.getJSONObject(j);
|
|
- JSONObject body = structquestion.getJSONObject("body");
|
|
|
|
|
|
+ JSONObject body = structquestion.getJSONObject(SystemConstant.BODY);
|
|
disposeQuestionBodyUrl(rootDir, body, paper.getId(), attachmentDir);
|
|
disposeQuestionBodyUrl(rootDir, body, paper.getId(), attachmentDir);
|
|
- JSONArray options = structquestion.getJSONArray("options");
|
|
|
|
|
|
+ JSONArray options = structquestion.getJSONArray(SystemConstant.OPTIONS);
|
|
disposeQuestionOptionsUrl(rootDir, options, paper.getId(), attachmentDir);
|
|
disposeQuestionOptionsUrl(rootDir, options, paper.getId(), attachmentDir);
|
|
- if (structquestion.getInteger("structType").intValue() == 6 || structquestion.getInteger("structType").intValue() == 8) {
|
|
|
|
- JSONArray structsubQuestions = structquestion.getJSONArray("subQuestions");
|
|
|
|
|
|
+ if (structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 6 || structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 8) {
|
|
|
|
+ JSONArray structsubQuestions = structquestion.getJSONArray(SystemConstant.SUB_QUESTIONS);
|
|
for (int k = 0; k < structsubQuestions.size(); k++) {
|
|
for (int k = 0; k < structsubQuestions.size(); k++) {
|
|
JSONObject structsubquestion = structsubQuestions.getJSONObject(k);
|
|
JSONObject structsubquestion = structsubQuestions.getJSONObject(k);
|
|
- JSONObject subbody = structsubquestion.getJSONObject("body");
|
|
|
|
|
|
+ JSONObject subbody = structsubquestion.getJSONObject(SystemConstant.BODY);
|
|
disposeQuestionBodyUrl(rootDir, subbody, paper.getId(), attachmentDir);
|
|
disposeQuestionBodyUrl(rootDir, subbody, paper.getId(), attachmentDir);
|
|
- JSONArray suboptions = structsubquestion.getJSONArray("options");
|
|
|
|
|
|
+ JSONArray suboptions = structsubquestion.getJSONArray(SystemConstant.OPTIONS);
|
|
disposeQuestionOptionsUrl(rootDir, suboptions, paper.getId(), attachmentDir);
|
|
disposeQuestionOptionsUrl(rootDir, suboptions, paper.getId(), attachmentDir);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".json";
|
|
|
|
|
|
+ String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + SystemConstant.JSON_PREFIX;
|
|
paper.setPaperViewPath(filePath);
|
|
paper.setPaperViewPath(filePath);
|
|
ossUtil.upload(false, filePath, structJson.toJSONString());
|
|
ossUtil.upload(false, filePath, structJson.toJSONString());
|
|
}
|
|
}
|
|
@@ -360,7 +360,7 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
for (int i = 0; i < options.size(); i++) {
|
|
for (int i = 0; i < options.size(); i++) {
|
|
JSONObject option = options.getJSONObject(i);
|
|
JSONObject option = options.getJSONObject(i);
|
|
if (option != null) {
|
|
if (option != null) {
|
|
- JSONObject body = option.getJSONObject("body");
|
|
|
|
|
|
+ JSONObject body = option.getJSONObject(SystemConstant.BODY);
|
|
if (body != null) {
|
|
if (body != null) {
|
|
JSONArray sections = body.getJSONArray("sections");
|
|
JSONArray sections = body.getJSONArray("sections");
|
|
if (sections != null && sections.size() > 0) {
|
|
if (sections != null && sections.size() > 0) {
|
|
@@ -409,18 +409,18 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject paperJson = JSONObject.parseObject(FileUtil.readFileContent(paperFile));
|
|
JSONObject paperJson = JSONObject.parseObject(FileUtil.readFileContent(paperFile));
|
|
- JSONArray details = paperJson.getJSONArray("details");
|
|
|
|
|
|
+ JSONArray details = paperJson.getJSONArray(SystemConstant.DETAILS);
|
|
for (int i = 0; i < details.size(); i++) {
|
|
for (int i = 0; i < details.size(); i++) {
|
|
- JSONArray questions = details.getJSONObject(i).getJSONArray("questions");
|
|
|
|
|
|
+ JSONArray questions = details.getJSONObject(i).getJSONArray(SystemConstant.QUESTIONS);
|
|
for (int j = 0; j < questions.size(); j++) {
|
|
for (int j = 0; j < questions.size(); j++) {
|
|
JSONObject question = questions.getJSONObject(j);
|
|
JSONObject question = questions.getJSONObject(j);
|
|
- question.remove("body");
|
|
|
|
- question.remove("options");
|
|
|
|
- Double score = question.getDouble("score");
|
|
|
|
|
|
+ question.remove(SystemConstant.BODY);
|
|
|
|
+ question.remove(SystemConstant.OPTIONS);
|
|
|
|
+ Double score = question.getDouble(SystemConstant.SCORE);
|
|
if (score == null) {
|
|
if (score == null) {
|
|
score = 0.0;
|
|
score = 0.0;
|
|
}
|
|
}
|
|
- Integer structType = question.getInteger("structType");
|
|
|
|
|
|
+ Integer structType = question.getInteger(SystemConstant.STRUCT_TYPE);
|
|
if (structType.intValue() != 1 && structType.intValue() != 2 && structType.intValue() != 3
|
|
if (structType.intValue() != 1 && structType.intValue() != 2 && structType.intValue() != 3
|
|
&& structType.intValue() != 6 && structType.intValue() != 8) {//主观题
|
|
&& structType.intValue() != 6 && structType.intValue() != 8) {//主观题
|
|
subTotal = subTotal.add(new BigDecimal(score));
|
|
subTotal = subTotal.add(new BigDecimal(score));
|
|
@@ -428,16 +428,16 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
obTotal = obTotal.add(new BigDecimal(score));
|
|
obTotal = obTotal.add(new BigDecimal(score));
|
|
}
|
|
}
|
|
if (structType.intValue() == 6 || structType.intValue() == 8) {
|
|
if (structType.intValue() == 6 || structType.intValue() == 8) {
|
|
- JSONArray subQuestions = question.getJSONArray("subQuestions");
|
|
|
|
|
|
+ JSONArray subQuestions = question.getJSONArray(SystemConstant.SUB_QUESTIONS);
|
|
for (int k = 0; k < subQuestions.size(); k++) {
|
|
for (int k = 0; k < subQuestions.size(); k++) {
|
|
JSONObject subquestion = subQuestions.getJSONObject(k);
|
|
JSONObject subquestion = subQuestions.getJSONObject(k);
|
|
- subquestion.remove("body");
|
|
|
|
- subquestion.remove("options");
|
|
|
|
- Double subScore = subquestion.getDouble("score");
|
|
|
|
|
|
+ subquestion.remove(SystemConstant.BODY);
|
|
|
|
+ subquestion.remove(SystemConstant.OPTIONS);
|
|
|
|
+ Double subScore = subquestion.getDouble(SystemConstant.SCORE);
|
|
if (subScore == null) {
|
|
if (subScore == null) {
|
|
subScore = 0.0;
|
|
subScore = 0.0;
|
|
}
|
|
}
|
|
- Integer subStructType = subquestion.getInteger("structType");
|
|
|
|
|
|
+ Integer subStructType = subquestion.getInteger(SystemConstant.STRUCT_TYPE);
|
|
if (subStructType.intValue() != 1 && subStructType.intValue() != 2
|
|
if (subStructType.intValue() != 1 && subStructType.intValue() != 2
|
|
&& subStructType.intValue() != 3) {//主观题
|
|
&& subStructType.intValue() != 3) {//主观题
|
|
subTotal = subTotal.add(new BigDecimal(subScore));
|
|
subTotal = subTotal.add(new BigDecimal(subScore));
|
|
@@ -448,7 +448,7 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".json";
|
|
|
|
|
|
+ String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + SystemConstant.JSON_PREFIX;
|
|
paper.setStructPath(filePath);
|
|
paper.setStructPath(filePath);
|
|
ByteArrayOutputStream out = null;
|
|
ByteArrayOutputStream out = null;
|
|
try {
|
|
try {
|
|
@@ -475,40 +475,40 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
JSONObject answerJson = JSONObject.parseObject(FileUtil.readFileContent(answerFile));
|
|
JSONObject answerJson = JSONObject.parseObject(FileUtil.readFileContent(answerFile));
|
|
- JSONArray answerdetails = answerJson.getJSONArray("details");
|
|
|
|
|
|
+ JSONArray answerdetails = answerJson.getJSONArray(SystemConstant.DETAILS);
|
|
JSONObject structJson = JSONObject.parseObject(FileUtil.readFileContent(structFile));
|
|
JSONObject structJson = JSONObject.parseObject(FileUtil.readFileContent(structFile));
|
|
- JSONArray structdetails = structJson.getJSONArray("details");
|
|
|
|
|
|
+ JSONArray structdetails = structJson.getJSONArray(SystemConstant.DETAILS);
|
|
for (int i = 0; i < answerdetails.size(); i++) {
|
|
for (int i = 0; i < answerdetails.size(); i++) {
|
|
- JSONArray answerdetailquestions = answerdetails.getJSONObject(i).getJSONArray("questions");
|
|
|
|
- JSONArray structdetailquestions = structdetails.getJSONObject(i).getJSONArray("questions");
|
|
|
|
|
|
+ JSONArray answerdetailquestions = answerdetails.getJSONObject(i).getJSONArray(SystemConstant.QUESTIONS);
|
|
|
|
+ JSONArray structdetailquestions = structdetails.getJSONObject(i).getJSONArray(SystemConstant.QUESTIONS);
|
|
for (int j = 0; j < answerdetailquestions.size(); j++) {
|
|
for (int j = 0; j < answerdetailquestions.size(); j++) {
|
|
JSONObject answerquestion = answerdetailquestions.getJSONObject(j);
|
|
JSONObject answerquestion = answerdetailquestions.getJSONObject(j);
|
|
JSONObject structquestion = structdetailquestions.getJSONObject(j);
|
|
JSONObject structquestion = structdetailquestions.getJSONObject(j);
|
|
- int structType = structquestion.getInteger("structType").intValue();
|
|
|
|
- answerquestion.put("structType", structType);
|
|
|
|
- answerquestion.put("score", structquestion.getDouble("score"));
|
|
|
|
|
|
+ int structType = structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue();
|
|
|
|
+ answerquestion.put(SystemConstant.STRUCT_TYPE, structType);
|
|
|
|
+ answerquestion.put(SystemConstant.SCORE, structquestion.getDouble(SystemConstant.SCORE));
|
|
if (structType != 1 && structType != 2 && structType != 3 && structType != 6 && structType != 8) {
|
|
if (structType != 1 && structType != 2 && structType != 3 && structType != 6 && structType != 8) {
|
|
- JSONArray answer = answerquestion.getJSONArray("answer");
|
|
|
|
|
|
+ JSONArray answer = answerquestion.getJSONArray(SystemConstant.ANSWER);
|
|
disposeAnswerUrl(rootDir, answer, paper.getId(), attachmentDir);
|
|
disposeAnswerUrl(rootDir, answer, paper.getId(), attachmentDir);
|
|
}
|
|
}
|
|
- if (structquestion.getInteger("structType").intValue() == 6 || structquestion.getInteger("structType").intValue() == 8) {
|
|
|
|
- JSONArray answersubQuestions = answerquestion.getJSONArray("subQuestions");
|
|
|
|
- JSONArray structsubQuestions = structquestion.getJSONArray("subQuestions");
|
|
|
|
|
|
+ if (structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 6 || structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 8) {
|
|
|
|
+ JSONArray answersubQuestions = answerquestion.getJSONArray(SystemConstant.SUB_QUESTIONS);
|
|
|
|
+ JSONArray structsubQuestions = structquestion.getJSONArray(SystemConstant.SUB_QUESTIONS);
|
|
for (int k = 0; k < answersubQuestions.size(); k++) {
|
|
for (int k = 0; k < answersubQuestions.size(); k++) {
|
|
JSONObject answersubquestion = answersubQuestions.getJSONObject(k);
|
|
JSONObject answersubquestion = answersubQuestions.getJSONObject(k);
|
|
JSONObject structsubquestion = structsubQuestions.getJSONObject(k);
|
|
JSONObject structsubquestion = structsubQuestions.getJSONObject(k);
|
|
- int subStructType = structsubquestion.getInteger("structType").intValue();
|
|
|
|
- answersubquestion.put("structType", subStructType);
|
|
|
|
- answersubquestion.put("score", structsubquestion.getDouble("score"));
|
|
|
|
|
|
+ int subStructType = structsubquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue();
|
|
|
|
+ answersubquestion.put(SystemConstant.STRUCT_TYPE, subStructType);
|
|
|
|
+ answersubquestion.put(SystemConstant.SCORE, structsubquestion.getDouble(SystemConstant.SCORE));
|
|
if (subStructType != 1 && subStructType != 2 && subStructType != 3) {
|
|
if (subStructType != 1 && subStructType != 2 && subStructType != 3) {
|
|
- JSONArray answer = answersubquestion.getJSONArray("answer");
|
|
|
|
|
|
+ JSONArray answer = answersubquestion.getJSONArray(SystemConstant.ANSWER);
|
|
disposeAnswerUrl(rootDir, answer, paper.getId(), attachmentDir);
|
|
disposeAnswerUrl(rootDir, answer, paper.getId(), attachmentDir);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + ".json";
|
|
|
|
|
|
+ String filePath = DateUtil.format(new Date(), Constants.DATE_PATTERN) + "/" + SystemConstant.getUuid() + SystemConstant.JSON_PREFIX;
|
|
paper.setAnswerPath(filePath);
|
|
paper.setAnswerPath(filePath);
|
|
ossUtil.upload(false, filePath, answerJson.toJSONString());
|
|
ossUtil.upload(false, filePath, answerJson.toJSONString());
|
|
}
|
|
}
|
|
@@ -694,15 +694,15 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
|
|
|
|
private void compareAnswerAndPaper(String courseCode, String paperCode, File answerFile, File structFile) {
|
|
private void compareAnswerAndPaper(String courseCode, String paperCode, File answerFile, File structFile) {
|
|
JSONObject answerJson = JSONObject.parseObject(FileUtil.readFileContent(answerFile));
|
|
JSONObject answerJson = JSONObject.parseObject(FileUtil.readFileContent(answerFile));
|
|
- JSONArray answerdetails = answerJson.getJSONArray("details");
|
|
|
|
|
|
+ JSONArray answerdetails = answerJson.getJSONArray(SystemConstant.DETAILS);
|
|
JSONObject structJson = JSONObject.parseObject(FileUtil.readFileContent(structFile));
|
|
JSONObject structJson = JSONObject.parseObject(FileUtil.readFileContent(structFile));
|
|
- JSONArray structdetails = structJson.getJSONArray("details");
|
|
|
|
|
|
+ JSONArray structdetails = structJson.getJSONArray(SystemConstant.DETAILS);
|
|
if (answerdetails.size() != structdetails.size()) {
|
|
if (answerdetails.size() != structdetails.size()) {
|
|
throw new BusinessException("科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷大题数量不一致");
|
|
throw new BusinessException("科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷大题数量不一致");
|
|
}
|
|
}
|
|
for (int i = 0; i < answerdetails.size(); i++) {
|
|
for (int i = 0; i < answerdetails.size(); i++) {
|
|
- JSONArray answerdetailquestions = answerdetails.getJSONObject(i).getJSONArray("questions");
|
|
|
|
- JSONArray structdetailquestions = structdetails.getJSONObject(i).getJSONArray("questions");
|
|
|
|
|
|
+ JSONArray answerdetailquestions = answerdetails.getJSONObject(i).getJSONArray(SystemConstant.QUESTIONS);
|
|
|
|
+ JSONArray structdetailquestions = structdetails.getJSONObject(i).getJSONArray(SystemConstant.QUESTIONS);
|
|
if (answerdetailquestions.size() != structdetailquestions.size()) {
|
|
if (answerdetailquestions.size() != structdetailquestions.size()) {
|
|
throw new BusinessException(
|
|
throw new BusinessException(
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题的小题数量不一致");
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题的小题数量不一致");
|
|
@@ -710,26 +710,26 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
for (int j = 0; j < answerdetailquestions.size(); j++) {
|
|
for (int j = 0; j < answerdetailquestions.size(); j++) {
|
|
JSONObject answerquestion = answerdetailquestions.getJSONObject(j);
|
|
JSONObject answerquestion = answerdetailquestions.getJSONObject(j);
|
|
JSONObject structquestion = structdetailquestions.getJSONObject(j);
|
|
JSONObject structquestion = structdetailquestions.getJSONObject(j);
|
|
- if (structquestion.getInteger("structType").intValue() == 1
|
|
|
|
- || structquestion.getInteger("structType").intValue() == 2) {
|
|
|
|
- JSONArray answer = answerquestion.getJSONArray("answer");
|
|
|
|
|
|
+ if (structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 1
|
|
|
|
+ || structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 2) {
|
|
|
|
+ JSONArray answer = answerquestion.getJSONArray(SystemConstant.ANSWER);
|
|
if (answer == null || answer.size() == 0) {
|
|
if (answer == null || answer.size() == 0) {
|
|
throw new BusinessException(
|
|
throw new BusinessException(
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
+ "小题没有答案");
|
|
+ "小题没有答案");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (structquestion.getInteger("structType").intValue() == 3) {
|
|
|
|
- Boolean answer = answerquestion.getBoolean("answer");
|
|
|
|
|
|
+ if (structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 3) {
|
|
|
|
+ Boolean answer = answerquestion.getBoolean(SystemConstant.ANSWER);
|
|
if (answer == null) {
|
|
if (answer == null) {
|
|
throw new BusinessException(
|
|
throw new BusinessException(
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
+ "小题没有答案");
|
|
+ "小题没有答案");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (structquestion.getInteger("structType").intValue() == 6) {
|
|
|
|
- JSONArray answersubQuestions = answerquestion.getJSONArray("subQuestions");
|
|
|
|
- JSONArray structsubQuestions = structquestion.getJSONArray("subQuestions");
|
|
|
|
|
|
+ if (structquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 6) {
|
|
|
|
+ JSONArray answersubQuestions = answerquestion.getJSONArray(SystemConstant.SUB_QUESTIONS);
|
|
|
|
+ JSONArray structsubQuestions = structquestion.getJSONArray(SystemConstant.SUB_QUESTIONS);
|
|
if (answersubQuestions.size() != structsubQuestions.size()) {
|
|
if (answersubQuestions.size() != structsubQuestions.size()) {
|
|
throw new BusinessException(
|
|
throw new BusinessException(
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
@@ -738,17 +738,17 @@ public class TaskExamPaperImportTemplete implements TaskImportTemplete {
|
|
for (int k = 0; k < answersubQuestions.size(); k++) {
|
|
for (int k = 0; k < answersubQuestions.size(); k++) {
|
|
JSONObject answersubquestion = answersubQuestions.getJSONObject(k);
|
|
JSONObject answersubquestion = answersubQuestions.getJSONObject(k);
|
|
JSONObject structsubquestion = structsubQuestions.getJSONObject(k);
|
|
JSONObject structsubquestion = structsubQuestions.getJSONObject(k);
|
|
- if (structsubquestion.getInteger("structType").intValue() == 1
|
|
|
|
- || structsubquestion.getInteger("structType").intValue() == 2) {
|
|
|
|
- JSONArray answer = answersubquestion.getJSONArray("answer");
|
|
|
|
|
|
+ if (structsubquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 1
|
|
|
|
+ || structsubquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 2) {
|
|
|
|
+ JSONArray answer = answersubquestion.getJSONArray(SystemConstant.ANSWER);
|
|
if (answer == null || answer.size() == 0) {
|
|
if (answer == null || answer.size() == 0) {
|
|
throw new BusinessException(
|
|
throw new BusinessException(
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
+ "小题第" + (k + 1) + "子题没有答案");
|
|
+ "小题第" + (k + 1) + "子题没有答案");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (structsubquestion.getInteger("structType").intValue() == 3) {
|
|
|
|
- Boolean answer = answersubquestion.getBoolean("answer");
|
|
|
|
|
|
+ if (structsubquestion.getInteger(SystemConstant.STRUCT_TYPE).intValue() == 3) {
|
|
|
|
+ Boolean answer = answersubquestion.getBoolean(SystemConstant.ANSWER);
|
|
if (answer == null) {
|
|
if (answer == null) {
|
|
throw new BusinessException(
|
|
throw new BusinessException(
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|
|
"科目 " + courseCode + " 试卷 " + paperCode + " 答案和试卷第" + (i + 1) + "大题第" + (j + 1)
|