【修改】选择题非空判断
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package pc.exam.pp.module.judgement.service.auto_tools;
|
package pc.exam.pp.module.judgement.service.auto_tools;
|
||||||
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
|
import com.alibaba.excel.util.StringUtils;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -193,22 +194,24 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
// 1-1-2、读取内容转换成json
|
// 1-1-2、读取内容转换成json
|
||||||
String select_string = readFileAsString(select_file.getPath());
|
String select_string = readFileAsString(select_file.getPath());
|
||||||
Stu stu = stringToJson(select_string);
|
Stu stu = stringToJson(select_string);
|
||||||
// 1-1-3、进行选择题判分
|
if(stu!=null){
|
||||||
for (String key : stu.getQuestionResultMap().keySet()) {
|
// 1-1-3、进行选择题判分
|
||||||
// 查询该题的成绩
|
for (String key : stu.getQuestionResultMap().keySet()) {
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuId, paperId, key);
|
// 查询该题的成绩
|
||||||
// 判断是否做过该题
|
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuId, paperId, key);
|
||||||
boolean isNull = false;
|
// 判断是否做过该题
|
||||||
if (stuPaperScoreDO == null) {
|
boolean isNull = false;
|
||||||
stuPaperScoreDO = new StuPaperScoreDO();
|
if (stuPaperScoreDO == null) {
|
||||||
stuPaperScoreDO.setStuId(stuId);
|
stuPaperScoreDO = new StuPaperScoreDO();
|
||||||
stuPaperScoreDO.setQuId(key);
|
stuPaperScoreDO.setStuId(stuId);
|
||||||
stuPaperScoreDO.setPaperId(paperId);
|
stuPaperScoreDO.setQuId(key);
|
||||||
isNull = true;
|
stuPaperScoreDO.setPaperId(paperId);
|
||||||
|
isNull = true;
|
||||||
|
}
|
||||||
|
String value = stu.getQuestionResultMap().get(key);
|
||||||
|
double selectScore = judgementChoiceService.programmingChoice(2.0, key, value, stuPaperScoreDO, isNull);
|
||||||
|
score += selectScore;
|
||||||
}
|
}
|
||||||
String value = stu.getQuestionResultMap().get(key);
|
|
||||||
double selectScore = judgementChoiceService.programmingChoice(2.0, key, value, stuPaperScoreDO, isNull);
|
|
||||||
score += selectScore;
|
|
||||||
}
|
}
|
||||||
// 1-1-4、删除文件
|
// 1-1-4、删除文件
|
||||||
select_file.delete();
|
select_file.delete();
|
||||||
|
Reference in New Issue
Block a user