【修改】笔试试卷 表格格式,返回试卷sort顺序等

This commit is contained in:
YOHO\20373
2025-05-29 17:57:35 +08:00
parent 06054139c7
commit 19bd805831
32 changed files with 478 additions and 86 deletions

View File

@@ -3,6 +3,7 @@ package pc.exam.pp.module.judgement.controller.admin.getpoints;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pc.exam.pp.framework.common.pojo.CommonResult;
import pc.exam.pp.framework.tenant.core.aop.TenantIgnore;
import pc.exam.pp.module.exam.dal.dataobject.ExamQuestionAnswer;
import pc.exam.pp.module.judgement.controller.admin.getpoints.vo.Points;
import pc.exam.pp.module.judgement.controller.admin.getpoints.vo.PointsVo;
@@ -23,6 +24,7 @@ public class GetPointsController {
* @return 得分
*/
@PostMapping("/get_filePoint")
@TenantIgnore
public CommonResult get_file_point(@RequestBody PointsVo pointsVo) throws IOException {
return CommonResult.success(examGetPointsService.get_file_point(pointsVo));
}
@@ -31,6 +33,7 @@ public class GetPointsController {
* @return 得分
*/
@PostMapping("/get_mysql_point")
@TenantIgnore
public CommonResult get_mysql_point(@RequestBody PointsVo pointsVo) throws IOException {
return CommonResult.success(examGetPointsService.get_mysql_point(pointsVo));
}
@@ -47,11 +50,13 @@ public class GetPointsController {
* @return 得分
*/
@PostMapping("/update_mysql_point")
@TenantIgnore
public CommonResult update_mysql_point(@RequestBody Points points) {
return CommonResult.success(examGetPointsService.update_mysql_point(points));
}
@GetMapping("/get_Point_id/{quId}")
@TenantIgnore
public CommonResult getPointById(@PathVariable("quId") String quId) {
return CommonResult.success(examGetPointsService.getPointById(quId));
}
@@ -60,6 +65,7 @@ public class GetPointsController {
* @return 得分
*/
@PostMapping("/set_browser_point")
@TenantIgnore
//todo 老师自己设置,不读文件
public CommonResult get_browser_point(@RequestBody Points points) {
return CommonResult.success(examGetPointsService.get_browser_point(points));

View File

@@ -78,7 +78,7 @@ public class ExamGetPointsServiceImpl implements ExamGetPointsService{
answer.setContent(key); // 设置文件路径
answer.setScoreRate("1");
//这里设置answer的排序按照循环次数来
answer.setSort(String.valueOf(sortCounter.getAndIncrement())); // 按顺序设置排序值
answer.setSort(sortCounter.getAndIncrement()); // 按顺序设置排序值
if (value.startsWith("仅存在于 "+stuFilePath)) {
answer.setContentIn("考察删除");
} else if (value.startsWith("仅存在于 "+answerFilePath)) {
@@ -89,7 +89,7 @@ public class ExamGetPointsServiceImpl implements ExamGetPointsService{
}
return answer;
})
.sorted(Comparator.comparingInt(answer -> Integer.parseInt(answer.getSort()))) // 按 sort 排序
.sorted(Comparator.comparingInt(answer -> answer.getSort())) // 按 sort 排序
.collect(Collectors.toList());
answerList.addAll(formattedDifferences);
zip_file_sth.delete();
@@ -188,7 +188,7 @@ public class ExamGetPointsServiceImpl implements ExamGetPointsService{
//设置sort
AtomicInteger sortCounter = new AtomicInteger(1);
points.getQuestionAnswerList().forEach(answer -> {
answer.setSort(String.valueOf(sortCounter.getAndIncrement()));
answer.setSort(sortCounter.getAndIncrement());
});
List<ExamQuestionAnswer> questionAnswerList = points.getQuestionAnswerList();
for (ExamQuestionAnswer examQuestionAnswer : questionAnswerList) {
@@ -267,7 +267,7 @@ public class ExamGetPointsServiceImpl implements ExamGetPointsService{
String answerId = IdUtils.simpleUUID();
answer.setAnswerId(answerId);
answer.setQuId(quId); // 以防前端未传
answer.setSort(String.valueOf(counter.getAndIncrement())); // 设置排序字段String 类型)
answer.setSort(counter.getAndIncrement()); // 设置排序字段String 类型)
List<ExamMysqlKeyword> keywordList = answer.getExamMysqlKeywordList();
if (!CollectionUtils.isEmpty(keywordList)) {
for (ExamMysqlKeyword keyword : keywordList) {

View File

@@ -15,6 +15,7 @@ import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
import pc.exam.pp.module.exam.dal.mysql.monitor.MonitorMapper;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperMapper;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperParamMapper;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperSessionMapper;
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperTaskMapper;
import pc.exam.pp.module.exam.dal.mysql.student.StuPaperFileMapper;
import pc.exam.pp.module.exam.utils.uuid.IdUtils;