【新增】 临时ID,防止考试数据继续互相干扰
This commit is contained in:
@@ -1,24 +0,0 @@
|
|||||||
package com.example.exam.exam.controller;
|
|
||||||
|
|
||||||
import com.example.exam.exam.dal.ExamAppCheck;
|
|
||||||
import com.example.exam.exam.service.appcheck.ExamAppCheckService;
|
|
||||||
import com.example.exam.exam.utils.Result;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/exam/app")
|
|
||||||
public class ExamAppCheckController {
|
|
||||||
@Resource
|
|
||||||
ExamAppCheckService examAppCheckService;
|
|
||||||
|
|
||||||
@GetMapping("/getAppCheck")
|
|
||||||
public Result<ExamAppCheck> getAppCheckList(){
|
|
||||||
// 使用传入的IP,进行ping,查看是否存在连接,并返回信号的强度
|
|
||||||
return Result.success(examAppCheckService.getAppList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -60,7 +60,7 @@ public class AutoController {
|
|||||||
@GetMapping("/getStuSource")
|
@GetMapping("/getStuSource")
|
||||||
public Result<BigDecimal> getStuSource(StuInfoVo stuInfoVo){
|
public Result<BigDecimal> getStuSource(StuInfoVo stuInfoVo){
|
||||||
BigDecimal source = new BigDecimal(0);
|
BigDecimal source = new BigDecimal(0);
|
||||||
List<StuPaperScoreDO> stuPaperScoreDOList = stuPaperScoreService.findByStuIDAndPaperId(stuInfoVo.getStuId(), stuInfoVo.getPaperId());
|
List<StuPaperScoreDO> stuPaperScoreDOList = stuPaperScoreService.findByStuIDAndPaperId(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), stuInfoVo.getTemporaryId());
|
||||||
for (StuPaperScoreDO stuPaperScoreDO : stuPaperScoreDOList){
|
for (StuPaperScoreDO stuPaperScoreDO : stuPaperScoreDOList){
|
||||||
source = source.add(stuPaperScoreDO.getScore());
|
source = source.add(stuPaperScoreDO.getScore());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,4 +31,7 @@ public class StuInfoVo {
|
|||||||
|
|
||||||
// 学校名称
|
// 学校名称
|
||||||
private String schoolName;
|
private String schoolName;
|
||||||
|
|
||||||
|
// 随机ID
|
||||||
|
private String temporaryId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ public class StuPaperScoreDO{
|
|||||||
* 试题ID
|
* 试题ID
|
||||||
*/
|
*/
|
||||||
private String quId;
|
private String quId;
|
||||||
|
/**
|
||||||
|
* 临时ID,每次做题都会变
|
||||||
|
*/
|
||||||
|
private String temporaryId;
|
||||||
/**
|
/**
|
||||||
* 得分
|
* 得分
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface StuPaperScoreMapper extends BaseMapper<StuPaperScoreDO> {
|
public interface StuPaperScoreMapper extends BaseMapper<StuPaperScoreDO> {
|
||||||
|
|
||||||
List<StuPaperScoreDO> findByStuIdAndPaperId(@Param("stuId") Long stuId, @Param("paperId") String paperId);
|
List<StuPaperScoreDO> findByStuIdAndPaperId(@Param("stuId") Long stuId, @Param("paperId") String paperId, @Param("temporaryId") String temporaryId);
|
||||||
|
|
||||||
// 通过学生ID,试卷ID ,试题ID,查询数据
|
// 通过学生ID,试卷ID ,试题ID,查询数据
|
||||||
StuPaperScoreDO findByStuIdAndPaperIdAndQuestionId(@Param("stuId") Long stuId, @Param("paperId") String paperId, @Param("quId") String questionId);
|
StuPaperScoreDO findByStuIdAndPaperIdAndQuestionId(@Param("stuId") Long stuId, @Param("paperId") String paperId, @Param("quId") String questionId);
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public class ExamAppCheckServiceImpl implements ExamAppCheckService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ExamAppCheck getAppList() {
|
public ExamAppCheck getAppList() {
|
||||||
ExamAppCheck appList = examAppCheckMapper.selectById("1");
|
return examAppCheckMapper.selectById("1");
|
||||||
return appList;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,8 +40,10 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe
|
|||||||
SystemTenantService systemTenantService;
|
SystemTenantService systemTenantService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EducationPaperMapper educationPaperMapper;
|
private EducationPaperMapper educationPaperMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动判题选择题
|
* 自动判题选择题
|
||||||
|
*
|
||||||
* @param stuInfoVo 学生考试信息
|
* @param stuInfoVo 学生考试信息
|
||||||
* @return 是否通过
|
* @return 是否通过
|
||||||
*/
|
*/
|
||||||
@@ -54,13 +56,13 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe
|
|||||||
String edgeAnswerValue = stuInfoVo.getEdgeAnswerValues();
|
String edgeAnswerValue = stuInfoVo.getEdgeAnswerValues();
|
||||||
// 保存ID路径
|
// 保存ID路径
|
||||||
String filePath = stuInfoVo.getFilePath();
|
String filePath = stuInfoVo.getFilePath();
|
||||||
File file = new File(filePath + "/"+ quId +"@EdgeDummy.json");
|
File file = new File(filePath + "/" + quId + "@EdgeDummy.json");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
LogFileUtils.createFile(filePath + "/"+ quId +"@EdgeDummy.json");
|
LogFileUtils.createFile(filePath + "/" + quId + "@EdgeDummy.json");
|
||||||
}
|
}
|
||||||
Map<String, String> map = new HashMap<>();
|
Map<String, String> map = new HashMap<>();
|
||||||
map.put(edgeAnswerKey, edgeAnswerValue);
|
map.put(edgeAnswerKey, edgeAnswerValue);
|
||||||
return writeMapToJson(map, filePath + "/"+ quId +"@EdgeDummy.json");
|
return writeMapToJson(map, filePath + "/" + quId + "@EdgeDummy.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -105,7 +107,7 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 查询哪些文件已经进行获取到学生作答文件了
|
// 查询哪些文件已经进行获取到学生作答文件了
|
||||||
for (String str: trueFileQuid) {
|
for (String str : trueFileQuid) {
|
||||||
// 查询到学生文件
|
// 查询到学生文件
|
||||||
Optional<File> fileResult = resultFile.stream().filter(resultFiles -> resultFiles.getName().contains(str)).findFirst();
|
Optional<File> fileResult = resultFile.stream().filter(resultFiles -> resultFiles.getName().contains(str)).findFirst();
|
||||||
if (fileResult.isPresent()) {
|
if (fileResult.isPresent()) {
|
||||||
@@ -174,19 +176,6 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
judgementStr += "<p>试题得分: " + oneScore + " </p>";
|
judgementStr += "<p>试题得分: " + oneScore + " </p>";
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(oneScore));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName("windows网络设置");
|
|
||||||
int isTrue = oneScore == 0 ? 1 : oneScore == Double.parseDouble(quScore) ? 0 : 2;
|
|
||||||
stuPaperScoreDO.setIsTrue(isTrue);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -198,9 +187,9 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe
|
|||||||
int isTrue = oneScore == 0 ? 1 : oneScore == Double.parseDouble(quScore) ? 0 : 2;
|
int isTrue = oneScore == 0 ? 1 : oneScore == Double.parseDouble(quScore) ? 0 : 2;
|
||||||
insertInfo.setIsTrue(isTrue);
|
insertInfo.setIsTrue(isTrue);
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
if (fileInputStream != null) {
|
if (fileInputStream != null) {
|
||||||
try {
|
try {
|
||||||
fileInputStream.close();
|
fileInputStream.close();
|
||||||
@@ -215,7 +204,7 @@ public class AutoForWinEdgeSettingServiceImpl implements AutoForWinEdgeSettingSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 没有作答的题目直接0分
|
// 没有作答的题目直接0分
|
||||||
for (String str: noFileQuid) {
|
for (String str : noFileQuid) {
|
||||||
String quId = str;
|
String quId = str;
|
||||||
List<EducationPaperQu> educationPaperQus = educationPaperQuMapper.selectPaperQuListByPaperId(stuInfoVo.getPaperId());
|
List<EducationPaperQu> educationPaperQus = educationPaperQuMapper.selectPaperQuListByPaperId(stuInfoVo.getPaperId());
|
||||||
Optional<EducationPaperQu> resultss = educationPaperQus.stream().filter(entry -> entry.getQuId().equals(quId))
|
Optional<EducationPaperQu> resultss = educationPaperQus.stream().filter(entry -> entry.getQuId().equals(quId))
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ public class AutoForBrowerServiceImpl implements AutoForBrowerService {
|
|||||||
StuPaperScoreService stuPaperScoreService;
|
StuPaperScoreService stuPaperScoreService;
|
||||||
@Resource
|
@Resource
|
||||||
SystemTenantService systemTenantService;
|
SystemTenantService systemTenantService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动判题文件处理
|
* 自动判题文件处理
|
||||||
|
*
|
||||||
* @param stuInfoVo 学生考试信息
|
* @param stuInfoVo 学生考试信息
|
||||||
* @return 是否通过
|
* @return 是否通过
|
||||||
*/
|
*/
|
||||||
@@ -80,20 +82,7 @@ public class AutoForBrowerServiceImpl implements AutoForBrowerService {
|
|||||||
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||||
judgementStr = cpojo.getText();
|
judgementStr = cpojo.getText();
|
||||||
judgementStr += "<p>试题得分:" + cpojo.getScore() + "</p>";
|
judgementStr += "<p>试题得分:" + cpojo.getScore() + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要更新学生试题得分
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -104,9 +93,9 @@ public class AutoForBrowerServiceImpl implements AutoForBrowerService {
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,10 @@ public class AutoForCServiceImpl implements AutoForCService {
|
|||||||
StuPaperScoreService stuPaperScoreService;
|
StuPaperScoreService stuPaperScoreService;
|
||||||
@Resource
|
@Resource
|
||||||
SystemTenantService systemTenantService;
|
SystemTenantService systemTenantService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动判题C语言
|
* 自动判题C语言
|
||||||
|
*
|
||||||
* @param stuInfoVo 学生考试信息
|
* @param stuInfoVo 学生考试信息
|
||||||
* @return 是否通过
|
* @return 是否通过
|
||||||
*/
|
*/
|
||||||
@@ -81,20 +83,8 @@ public class AutoForCServiceImpl implements AutoForCService {
|
|||||||
BigDecimal dangSource = new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
BigDecimal dangSource = new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
||||||
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||||
if (stuPaperScoreDO != null) {
|
// 直接进行新增,不需要进行更新
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(dangSource);
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -105,9 +95,9 @@ public class AutoForCServiceImpl implements AutoForCService {
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,10 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
SystemTenantService systemTenantService;
|
SystemTenantService systemTenantService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private EducationPaperMapper educationPaperMapper;
|
private EducationPaperMapper educationPaperMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动判题选择题
|
* 自动判题选择题
|
||||||
|
*
|
||||||
* @param stuInfoVo 学生考试信息
|
* @param stuInfoVo 学生考试信息
|
||||||
* @return 是否通过
|
* @return 是否通过
|
||||||
*/
|
*/
|
||||||
@@ -138,18 +140,6 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
judgementStr += "<p>得分:0 </p>";
|
judgementStr += "<p>得分:0 </p>";
|
||||||
isRight = false;
|
isRight = false;
|
||||||
}
|
}
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(isRight ? new BigDecimal(quScore) : new BigDecimal(0));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName("选择题");
|
|
||||||
stuPaperScoreDO.setIsTrue(isRight ? 0 : 1);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -160,9 +150,9 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
insertInfo.setSubjectName("选择题");
|
insertInfo.setSubjectName("选择题");
|
||||||
insertInfo.setIsTrue(isRight ? 0 : 1);
|
insertInfo.setIsTrue(isRight ? 0 : 1);
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// 根据ID查询试题
|
// 根据ID查询试题
|
||||||
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(quId);
|
||||||
@@ -182,18 +172,6 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
judgementStr += "<p>学生答案: 未作答 </p>";
|
judgementStr += "<p>学生答案: 未作答 </p>";
|
||||||
judgementStr += "<p>正确答案:" + trueAbswerSort + "</p>";
|
judgementStr += "<p>正确答案:" + trueAbswerSort + "</p>";
|
||||||
judgementStr += "<p>得分:0 </p>";
|
judgementStr += "<p>得分:0 </p>";
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(0));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName("选择题");
|
|
||||||
stuPaperScoreDO.setIsTrue(1);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -204,11 +182,11 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
insertInfo.setSubjectName("选择题");
|
insertInfo.setSubjectName("选择题");
|
||||||
insertInfo.setIsTrue(1);
|
insertInfo.setIsTrue(1);
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (fileInputStream != null) {
|
if (fileInputStream != null) {
|
||||||
try {
|
try {
|
||||||
fileInputStream.close();
|
fileInputStream.close();
|
||||||
@@ -244,18 +222,6 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
judgementStr += "<p>学生答案: 未作答 </p>";
|
judgementStr += "<p>学生答案: 未作答 </p>";
|
||||||
judgementStr += "<p>正确答案:" + trueAbswerSort + "</p>";
|
judgementStr += "<p>正确答案:" + trueAbswerSort + "</p>";
|
||||||
judgementStr += "<p>得分:0 </p>";
|
judgementStr += "<p>得分:0 </p>";
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(0));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName("选择题");
|
|
||||||
stuPaperScoreDO.setIsTrue(1);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -266,11 +232,11 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
insertInfo.setSubjectName("选择题");
|
insertInfo.setSubjectName("选择题");
|
||||||
insertInfo.setIsTrue(1);
|
insertInfo.setIsTrue(1);
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return score;
|
return score;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +275,6 @@ public class AutoForChoiceServiceImpl implements AutoForChoiceService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String convertToLetter(int number) {
|
public static String convertToLetter(int number) {
|
||||||
// 判断是否在 1 到 26 的范围内
|
// 判断是否在 1 到 26 的范围内
|
||||||
if (number >= 1 && number <= 26) {
|
if (number >= 1 && number <= 26) {
|
||||||
|
|||||||
@@ -40,8 +40,10 @@ public class AutoForFileServiceImpl implements AutoForFileService {
|
|||||||
StuPaperScoreService stuPaperScoreService;
|
StuPaperScoreService stuPaperScoreService;
|
||||||
@Resource
|
@Resource
|
||||||
SystemTenantService systemTenantService;
|
SystemTenantService systemTenantService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动判题文件处理
|
* 自动判题文件处理
|
||||||
|
*
|
||||||
* @param stuInfoVo 学生考试信息
|
* @param stuInfoVo 学生考试信息
|
||||||
* @return 是否通过
|
* @return 是否通过
|
||||||
*/
|
*/
|
||||||
@@ -86,20 +88,7 @@ public class AutoForFileServiceImpl implements AutoForFileService {
|
|||||||
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||||
judgementStr = cpojo.getText();
|
judgementStr = cpojo.getText();
|
||||||
judgementStr += "<p>试题得分:" + cpojo.getScore() + "</p>";
|
judgementStr += "<p>试题得分:" + cpojo.getScore() + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要更新学生试题得分
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -110,9 +99,9 @@ public class AutoForFileServiceImpl implements AutoForFileService {
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,8 +34,10 @@ public class AutoForMysqlServiceImpl implements AutoForMysqlService {
|
|||||||
StuPaperScoreService stuPaperScoreService;
|
StuPaperScoreService stuPaperScoreService;
|
||||||
@Resource
|
@Resource
|
||||||
SystemTenantService systemTenantService;
|
SystemTenantService systemTenantService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自动判题C语言
|
* 自动判题C语言
|
||||||
|
*
|
||||||
* @param stuInfoVo 学生考试信息
|
* @param stuInfoVo 学生考试信息
|
||||||
* @return 是否通过
|
* @return 是否通过
|
||||||
*/
|
*/
|
||||||
@@ -84,20 +86,7 @@ public class AutoForMysqlServiceImpl implements AutoForMysqlService {
|
|||||||
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
score = score.add(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||||
judgementStr = cpojo.getText();
|
judgementStr = cpojo.getText();
|
||||||
judgementStr += "<p>试题得分:" + cpojo.getScore() + "</p>";
|
judgementStr += "<p>试题得分:" + cpojo.getScore() + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要更新学生试题得分
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(cpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -108,9 +97,9 @@ public class AutoForMysqlServiceImpl implements AutoForMysqlService {
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(cpojo.getScore() == 0 ? 1 : cpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
System.out.println(judgementStr);
|
System.out.println(judgementStr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import java.util.List;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class AutoForPsServiceImpl implements AutoForPsService{
|
public class AutoForPsServiceImpl implements AutoForPsService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
PsService psService;
|
PsService psService;
|
||||||
@@ -77,20 +77,7 @@ public class AutoForPsServiceImpl implements AutoForPsService{
|
|||||||
score = score.add(new BigDecimal(wordpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
score = score.add(new BigDecimal(wordpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
||||||
judgementStr = wordpojo.getText();
|
judgementStr = wordpojo.getText();
|
||||||
judgementStr += "<p>试题得分:" + wordpojo.getScore() + "</p>";
|
judgementStr += "<p>试题得分:" + wordpojo.getScore() + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要更新学生试题得分
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(wordpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP));
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -101,9 +88,9 @@ public class AutoForPsServiceImpl implements AutoForPsService{
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() == Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class PsServiceImpl implements PsService{
|
public class PsServiceImpl implements PsService {
|
||||||
static String answerLogPath ; // 文件路径
|
static String answerLogPath; // 文件路径
|
||||||
@Resource
|
@Resource
|
||||||
private ExamQuestionAnswerMapper examQuestionAnswerMapper;
|
private ExamQuestionAnswerMapper examQuestionAnswerMapper;
|
||||||
private static final DateTimeFormatter formatter =
|
private static final DateTimeFormatter formatter =
|
||||||
@@ -61,10 +61,10 @@ public class PsServiceImpl implements PsService{
|
|||||||
String sthJsonPath = path.replaceAll("(?i)\\.psd$", ".json");
|
String sthJsonPath = path.replaceAll("(?i)\\.psd$", ".json");
|
||||||
Path jsonFilePath = Paths.get(sthJsonPath);
|
Path jsonFilePath = Paths.get(sthJsonPath);
|
||||||
|
|
||||||
Path jsxPath=null;
|
Path jsxPath = null;
|
||||||
// 执行 Photoshop 脚本
|
// 执行 Photoshop 脚本
|
||||||
try {
|
try {
|
||||||
String jsxTargetPath= PsUtil.runTwoPsdsInOneScript(path, jsxTemplatePath, photoshopExe);
|
String jsxTargetPath = PsUtil.runTwoPsdsInOneScript(path, jsxTemplatePath, photoshopExe);
|
||||||
jsxPath = Paths.get(jsxTargetPath);
|
jsxPath = Paths.get(jsxTargetPath);
|
||||||
|
|
||||||
appendToFile(answerLogPath, "Photoshop脚本执行完毕");
|
appendToFile(answerLogPath, "Photoshop脚本执行完毕");
|
||||||
@@ -103,7 +103,7 @@ public class PsServiceImpl implements PsService{
|
|||||||
sourceAndText.setText(judgementStr);
|
sourceAndText.setText(judgementStr);
|
||||||
sourceAndText.setScore(0.0);
|
sourceAndText.setScore(0.0);
|
||||||
return sourceAndText;
|
return sourceAndText;
|
||||||
}finally {
|
} finally {
|
||||||
// 检查文件是否存在
|
// 检查文件是否存在
|
||||||
if (Files.exists(jsonFilePath)) {
|
if (Files.exists(jsonFilePath)) {
|
||||||
try {
|
try {
|
||||||
@@ -141,11 +141,11 @@ public class PsServiceImpl implements PsService{
|
|||||||
|
|
||||||
if (isCorrect) {
|
if (isCorrect) {
|
||||||
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, currentPath + "【" + correctValue + "】【✅】");
|
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, currentPath + "【" + correctValue + "】【✅】");
|
||||||
appendToFile(answerLogPath, currentPath + "【" + correctValue + "】"+"【√】");
|
appendToFile(answerLogPath, currentPath + "【" + correctValue + "】" + "【√】");
|
||||||
result.setScore(result.getScore() + Double.parseDouble(item.getRate()));
|
result.setScore(result.getScore() + Double.parseDouble(item.getRate()));
|
||||||
} else {
|
} else {
|
||||||
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, currentPath + "【" + correctValue + "】"+"【❌】");
|
judgementStr = HtmlAppender.appendHtmlLine(judgementStr, currentPath + "【" + correctValue + "】" + "【❌】");
|
||||||
appendToFile(answerLogPath, currentPath + "【" + correctValue + "】"+"【×】");
|
appendToFile(answerLogPath, currentPath + "【" + correctValue + "】" + "【×】");
|
||||||
}
|
}
|
||||||
|
|
||||||
result.setText(judgementStr);
|
result.setText(judgementStr);
|
||||||
@@ -220,9 +220,6 @@ public class PsServiceImpl implements PsService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建答案树形结构
|
* 构建答案树形结构
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface StuPaperScoreService {
|
public interface StuPaperScoreService {
|
||||||
|
|
||||||
List<StuPaperScoreDO> findByStuIDAndPaperId(Long stuId, String paperId);
|
List<StuPaperScoreDO> findByStuIDAndPaperId(Long stuId, String paperId, String temporaryId);
|
||||||
|
|
||||||
void insertStuPaperScore(StuPaperScoreDO stuPaperScoreDO);
|
void insertStuPaperScore(StuPaperScoreDO stuPaperScoreDO);
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ public class StuPaperScoreServiceImpl implements StuPaperScoreService {
|
|||||||
private EducationPaperMapper educationPaperMapper;
|
private EducationPaperMapper educationPaperMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StuPaperScoreDO> findByStuIDAndPaperId(Long stuId, String paperId) {
|
public List<StuPaperScoreDO> findByStuIDAndPaperId(Long stuId, String paperId, String temporaryId) {
|
||||||
return stuPaperScoreMapper.findByStuIdAndPaperId(stuId, paperId);
|
return stuPaperScoreMapper.findByStuIdAndPaperId(stuId, paperId, temporaryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -83,20 +83,7 @@ public class JudgementForExcelServiceImpl implements JudgementForExcelService {
|
|||||||
judgementStr = excelpojo.getText();
|
judgementStr = excelpojo.getText();
|
||||||
BigDecimal dangSource = new BigDecimal(excelpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
BigDecimal dangSource = new BigDecimal(excelpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
||||||
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要新增生试题得分
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(dangSource);
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(excelpojo.getScore() == 0 ? 1 : excelpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -107,9 +94,9 @@ public class JudgementForExcelServiceImpl implements JudgementForExcelService {
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(excelpojo.getScore() == 0 ? 1 : excelpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(excelpojo.getScore() == 0 ? 1 : excelpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,20 +83,7 @@ public class JudgementForPptxServiceImpl implements JudgementForPptxService {
|
|||||||
judgementStr = pptxpojo.getText();
|
judgementStr = pptxpojo.getText();
|
||||||
BigDecimal dangSource = new BigDecimal(pptxpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
BigDecimal dangSource = new BigDecimal(pptxpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
||||||
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要新增生试题得分
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(dangSource);
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(pptxpojo.getScore() == 0 ? 1 : pptxpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -107,9 +94,9 @@ public class JudgementForPptxServiceImpl implements JudgementForPptxService {
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(pptxpojo.getScore() == 0 ? 1 : pptxpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(pptxpojo.getScore() == 0 ? 1 : pptxpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ public class EndNoteing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取尾注内容
|
* 获取尾注内容
|
||||||
* "declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' "
|
* "declare namespace w='http://schemas.openxmlformats.org/wordprocessingml/2006/main' "
|
||||||
@@ -114,5 +113,4 @@ public class EndNoteing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -80,20 +80,7 @@ public class JudgementForWordServiceImpl implements JudgementForWordService {
|
|||||||
judgementStr = wordpojo.getText();
|
judgementStr = wordpojo.getText();
|
||||||
BigDecimal dangSource = new BigDecimal(wordpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
BigDecimal dangSource = new BigDecimal(wordpojo.getScore()).setScale(1, BigDecimal.ROUND_HALF_UP);
|
||||||
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
judgementStr += "<p>试题得分:" + dangSource + "</p>";
|
||||||
// 4、需要更新学生试题得分,首先需要查询试题的数据库是否保存信息
|
// 4、需要新增学生试题得分
|
||||||
// 通过 quId,stuId,paperId 查询
|
|
||||||
StuPaperScoreDO stuPaperScoreDO = stuPaperScoreService.getStuScoreByPaperIdAndQuid(stuInfoVo.getStuId(), stuInfoVo.getPaperId(), quId);
|
|
||||||
if (stuPaperScoreDO != null) {
|
|
||||||
// 说明已经是做过该题,需要更新数据
|
|
||||||
stuPaperScoreDO.setScore(dangSource);
|
|
||||||
stuPaperScoreDO.setContent(judgementStr);
|
|
||||||
stuPaperScoreDO.setSort(educationPaperQu.getSort());
|
|
||||||
stuPaperScoreDO.setSubjectName(name);
|
|
||||||
stuPaperScoreDO.setIsTrue(wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
|
||||||
stuPaperScoreDO.setTrueScore(new BigDecimal(quScore));
|
|
||||||
stuPaperScoreDO.setTenantId(systemTenant.getId());
|
|
||||||
stuPaperScoreService.updateStuPaperScore(stuPaperScoreDO);
|
|
||||||
} else {
|
|
||||||
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
StuPaperScoreDO insertInfo = new StuPaperScoreDO();
|
||||||
insertInfo.setStuId(stuInfoVo.getStuId());
|
insertInfo.setStuId(stuInfoVo.getStuId());
|
||||||
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
insertInfo.setPaperId(stuInfoVo.getPaperId());
|
||||||
@@ -104,9 +91,9 @@ public class JudgementForWordServiceImpl implements JudgementForWordService {
|
|||||||
insertInfo.setSubjectName(name);
|
insertInfo.setSubjectName(name);
|
||||||
insertInfo.setTrueScore(new BigDecimal(quScore));
|
insertInfo.setTrueScore(new BigDecimal(quScore));
|
||||||
insertInfo.setTenantId(systemTenant.getId());
|
insertInfo.setTenantId(systemTenant.getId());
|
||||||
|
insertInfo.setTemporaryId(stuInfoVo.getTemporaryId());
|
||||||
insertInfo.setIsTrue(wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
insertInfo.setIsTrue(wordpojo.getScore() == 0 ? 1 : wordpojo.getScore() >= Double.parseDouble(quScore) ? 0 : 2);
|
||||||
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
stuPaperScoreService.insertStuPaperScore(insertInfo);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,25 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
<select id="findByStuIdAndPaperId" resultType="com.example.exam.exam.dal.StuPaperScoreDO">
|
<select id="findByStuIdAndPaperId" resultType="com.example.exam.exam.dal.StuPaperScoreDO">
|
||||||
SELECT * FROM exam_stu_paper_score WHERE stu_id = #{stuId} AND paper_id = #{paperId} order by sort ASC
|
SELECT *
|
||||||
|
FROM exam_stu_paper_score
|
||||||
|
WHERE stu_id = #{stuId}
|
||||||
|
AND paper_id = #{paperId}
|
||||||
|
AND temporary_id = #{temporaryId}
|
||||||
|
order by sort ASC
|
||||||
</select>
|
</select>
|
||||||
<select id="findByStuIdAndPaperIdAndQuestionId" resultType="com.example.exam.exam.dal.StuPaperScoreDO">
|
<select id="findByStuIdAndPaperIdAndQuestionId" resultType="com.example.exam.exam.dal.StuPaperScoreDO">
|
||||||
SELECT * FROM exam_stu_paper_score WHERE stu_id = #{stuId} AND paper_id = #{paperId} AND qu_id = #{quId}
|
SELECT *
|
||||||
|
FROM exam_stu_paper_score
|
||||||
|
WHERE stu_id = #{stuId}
|
||||||
|
AND paper_id = #{paperId}
|
||||||
|
AND qu_id = #{quId}
|
||||||
</select>
|
</select>
|
||||||
<delete id="deleteByStuIdAndPaperId">
|
<delete id="deleteByStuIdAndPaperId">
|
||||||
DELETE FROM exam_stu_paper_score WHERE stu_id = #{stuId} AND paper_id = #{paperId}
|
DELETE
|
||||||
|
FROM exam_stu_paper_score
|
||||||
|
WHERE stu_id = #{stuId}
|
||||||
|
AND paper_id = #{paperId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user