|
@@ -54,7 +54,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionDao, QuestionEntity
|
|
|
private Pattern scoreRex = Pattern.compile("\\[\\[([0-9][0-9]*(.[0-9]+){0,1})分\\]\\]");
|
|
|
|
|
|
private static final String[] EXCEL_HEADER = new String[] { "考试ID", "科目代码", "科目名称", "题目名称", "大题号", "小题号", "满分",
|
|
|
- "试题内容", "试题答案", "作答区域类型", "作答坐标", "模版文件" };
|
|
|
+ "试题内容", "试题答案", "评分档次", "补充说明", "作答区域类型", "作答坐标", "模版文件" };
|
|
|
|
|
|
@Autowired
|
|
|
private SysProperty sysProperty;
|
|
@@ -272,12 +272,18 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionDao, QuestionEntity
|
|
|
imp.setContent(content);
|
|
|
|
|
|
String answer = trimAndNullIfBlank(line.get(EXCEL_HEADER[8]));
|
|
|
- // if (StringUtils.isBlank(answer)) {
|
|
|
- // msg.append(" 试题答案不能为空");
|
|
|
- // }
|
|
|
+ if (StringUtils.isBlank(answer)) {
|
|
|
+ msg.append(" 试题答案不能为空");
|
|
|
+ }
|
|
|
imp.setAnswer(getStandardAnswer(answer));
|
|
|
|
|
|
- String rangeType = trimAndNullIfBlank(line.get(EXCEL_HEADER[9]));
|
|
|
+ String scoreGrades = trimAndNullIfBlank(line.get(EXCEL_HEADER[9]));
|
|
|
+ imp.setScoreGrades(scoreGrades);
|
|
|
+
|
|
|
+ String ext = trimAndNullIfBlank(line.get(EXCEL_HEADER[10]));
|
|
|
+ imp.setExt(ext);
|
|
|
+
|
|
|
+ String rangeType = trimAndNullIfBlank(line.get(EXCEL_HEADER[11]));
|
|
|
AnswerRangeType answerRangeType = null;
|
|
|
if (StringUtils.isBlank(rangeType)) {
|
|
|
msg.append(" 作答区域类型不能为空");
|
|
@@ -291,7 +297,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionDao, QuestionEntity
|
|
|
}
|
|
|
|
|
|
if (AnswerRangeType.FIXED.equals(answerRangeType)) {
|
|
|
- String imageSlice = trimAndNullIfBlank(line.get(EXCEL_HEADER[10]));
|
|
|
+ String imageSlice = trimAndNullIfBlank(line.get(EXCEL_HEADER[12]));
|
|
|
if (StringUtils.isBlank(imageSlice)) {
|
|
|
msg.append(" 作答坐标不能为空");
|
|
|
} else if (imageSlice.length() > 1000) {
|
|
@@ -306,7 +312,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionDao, QuestionEntity
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String template = trimAndNullIfBlank(line.get(EXCEL_HEADER[11]));
|
|
|
+ String template = trimAndNullIfBlank(line.get(EXCEL_HEADER[13]));
|
|
|
if (StringUtils.isBlank(template)) {
|
|
|
msg.append(" 模版文件不能为空");
|
|
|
} else {
|
|
@@ -314,7 +320,11 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionDao, QuestionEntity
|
|
|
if (val == null) {
|
|
|
msg.append(" 模版文件有误");
|
|
|
} else {
|
|
|
- imp.setPromptTemplate(val);
|
|
|
+ if (PromptTemplate.TRANSLATION.equals(val) && StringUtils.isBlank(imp.getScoreGrades())) {
|
|
|
+ msg.append(" 评分档次不能为空");
|
|
|
+ } else {
|
|
|
+ imp.setPromptTemplate(val);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|