【修改】 wps 判分文件名称判断
This commit is contained in:
@@ -415,94 +415,98 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
||||
}
|
||||
// wps 类型存在多级文文件夹,需要个性化设置
|
||||
if ("文字".equals(one_file.getName().split("\\.")[0])) {
|
||||
String judgementStrWord = "";
|
||||
SourceAndText wordpojo = judgementWpsWordService.judgementWpsWord(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrWord);
|
||||
double wps_word_score = wordpojo.getScore();
|
||||
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||
judgementStr += wordpojo.getText();
|
||||
// 通过学号+试卷ID+试题ID进行查询
|
||||
StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId());
|
||||
if (stuPaperInfoDO != null) {
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO);
|
||||
} else {
|
||||
stuPaperInfoDO = new StuPaperInfoDO();
|
||||
stuPaperInfoDO.setStuId(stuId);
|
||||
stuPaperInfoDO.setPaperId(paperId);
|
||||
stuPaperInfoDO.setQuId(examQuestion.getQuId());
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO);
|
||||
if (file_one.getPath().contains("文档")) {
|
||||
String judgementStrWord = "";
|
||||
SourceAndText wordpojo = judgementWpsWordService.judgementWpsWord(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrWord);
|
||||
double wps_word_score = wordpojo.getScore();
|
||||
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||
judgementStr += wordpojo.getText();
|
||||
// 通过学号+试卷ID+试题ID进行查询
|
||||
StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId());
|
||||
if (stuPaperInfoDO != null) {
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO);
|
||||
} else {
|
||||
stuPaperInfoDO = new StuPaperInfoDO();
|
||||
stuPaperInfoDO.setStuId(stuId);
|
||||
stuPaperInfoDO.setPaperId(paperId);
|
||||
stuPaperInfoDO.setQuId(examQuestion.getQuId());
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO);
|
||||
}
|
||||
score += wps_word_score;
|
||||
stuPaperScoreDO.setScore(new BigDecimal(wps_word_score));
|
||||
// 原始正确分数
|
||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
||||
// 判断题是否正确
|
||||
if (wps_word_score == Double.parseDouble(quScore)) {
|
||||
stuPaperScoreDO.setIsTrue(0);
|
||||
} else if (wps_word_score == 0) {
|
||||
stuPaperScoreDO.setIsTrue(1);
|
||||
} else {
|
||||
stuPaperScoreDO.setIsTrue(2);
|
||||
}
|
||||
stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName());
|
||||
if (isNull) {
|
||||
// 如果之前没做过,则插入该题的分数
|
||||
stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO);
|
||||
} else {
|
||||
// 如果之前做过,则更新该题的分数
|
||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
||||
}
|
||||
System.out.println(wps_word_score+"wps_word得分");
|
||||
break;
|
||||
}
|
||||
score += wps_word_score;
|
||||
stuPaperScoreDO.setScore(new BigDecimal(wps_word_score));
|
||||
// 原始正确分数
|
||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
||||
// 判断题是否正确
|
||||
if (wps_word_score == Double.parseDouble(quScore)) {
|
||||
stuPaperScoreDO.setIsTrue(0);
|
||||
} else if (wps_word_score == 0) {
|
||||
stuPaperScoreDO.setIsTrue(1);
|
||||
} else {
|
||||
stuPaperScoreDO.setIsTrue(2);
|
||||
}
|
||||
stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName());
|
||||
if (isNull) {
|
||||
// 如果之前没做过,则插入该题的分数
|
||||
stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO);
|
||||
} else {
|
||||
// 如果之前做过,则更新该题的分数
|
||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
||||
}
|
||||
System.out.println(wps_word_score+"wps_word得分");
|
||||
break;
|
||||
}
|
||||
if ("演示".equals(one_file.getName().split("\\.")[0])) {
|
||||
String judgementStrPptx = "";
|
||||
SourceAndText pptxpojo = judgementWpsPptxService.judgementWpsPptx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrPptx);
|
||||
double wps_pptx_score = pptxpojo.getScore();
|
||||
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||
judgementStr += pptxpojo.getText();
|
||||
// 通过学号+试卷ID+试题ID进行查询
|
||||
StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId());
|
||||
if (stuPaperInfoDO != null) {
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO);
|
||||
} else {
|
||||
stuPaperInfoDO = new StuPaperInfoDO();
|
||||
stuPaperInfoDO.setStuId(stuId);
|
||||
stuPaperInfoDO.setPaperId(paperId);
|
||||
stuPaperInfoDO.setQuId(examQuestion.getQuId());
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO);
|
||||
if (file_one.getPath().contains("文档")) {
|
||||
String judgementStrPptx = "";
|
||||
SourceAndText pptxpojo = judgementWpsPptxService.judgementWpsPptx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrPptx);
|
||||
double wps_pptx_score = pptxpojo.getScore();
|
||||
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||
judgementStr += pptxpojo.getText();
|
||||
// 通过学号+试卷ID+试题ID进行查询
|
||||
StuPaperInfoDO stuPaperInfoDO = stuPaperInfoService.findByStuIDAndPaperIdAndExamId(stuId, paperId, examQuestion.getQuId());
|
||||
if (stuPaperInfoDO != null) {
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.updateStuPaperInfo(stuPaperInfoDO);
|
||||
} else {
|
||||
stuPaperInfoDO = new StuPaperInfoDO();
|
||||
stuPaperInfoDO.setStuId(stuId);
|
||||
stuPaperInfoDO.setPaperId(paperId);
|
||||
stuPaperInfoDO.setQuId(examQuestion.getQuId());
|
||||
stuPaperInfoDO.setContent(judgementStr);
|
||||
stuPaperInfoDO.setSort(stuPaperScoreDO.getSort());
|
||||
stuPaperInfoService.insertStuPaperInfo(stuPaperInfoDO);
|
||||
}
|
||||
score += wps_pptx_score;
|
||||
stuPaperScoreDO.setScore(new BigDecimal(wps_pptx_score));
|
||||
// 原始正确分数
|
||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
||||
// 判断题是否正确
|
||||
if (wps_pptx_score == Double.parseDouble(quScore)) {
|
||||
stuPaperScoreDO.setIsTrue(0);
|
||||
} else if (wps_pptx_score == 0) {
|
||||
stuPaperScoreDO.setIsTrue(1);
|
||||
} else {
|
||||
stuPaperScoreDO.setIsTrue(2);
|
||||
}
|
||||
stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName());
|
||||
if (isNull) {
|
||||
// 如果之前没做过,则插入该题的分数
|
||||
stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO);
|
||||
} else {
|
||||
// 如果之前做过,则更新该题的分数
|
||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
||||
}
|
||||
System.out.println(wps_pptx_score+"wps_ppt得分");
|
||||
break;
|
||||
}
|
||||
score += wps_pptx_score;
|
||||
stuPaperScoreDO.setScore(new BigDecimal(wps_pptx_score));
|
||||
// 原始正确分数
|
||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
||||
// 判断题是否正确
|
||||
if (wps_pptx_score == Double.parseDouble(quScore)) {
|
||||
stuPaperScoreDO.setIsTrue(0);
|
||||
} else if (wps_pptx_score == 0) {
|
||||
stuPaperScoreDO.setIsTrue(1);
|
||||
} else {
|
||||
stuPaperScoreDO.setIsTrue(2);
|
||||
}
|
||||
stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName());
|
||||
if (isNull) {
|
||||
// 如果之前没做过,则插入该题的分数
|
||||
stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO);
|
||||
} else {
|
||||
// 如果之前做过,则更新该题的分数
|
||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
||||
}
|
||||
System.out.println(wps_pptx_score+"wps_ppt得分");
|
||||
break;
|
||||
}
|
||||
// if ("表格".equals(one_file.getName().split("\\.")[0])) {
|
||||
// double wps_excel_score = judgementWpsExcelService.judgementWpsXlsx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion);
|
||||
|
Reference in New Issue
Block a user