【修改】 修改成绩明细中,试卷分析没有按照题目排序的问题
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
package pc.exam.pp.module.exam.dal.dataobject.student;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
import pc.exam.pp.framework.tenant.core.db.TenantBaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生-试卷-判分详情表 DO
|
||||||
|
*
|
||||||
|
* @author rwb
|
||||||
|
*/
|
||||||
|
@TableName("exam_stu_paper_info")
|
||||||
|
@Data
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StuPaperInfoDO extends TenantBaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 学生号
|
||||||
|
*/
|
||||||
|
private Long stuId;
|
||||||
|
/**
|
||||||
|
* 试卷ID
|
||||||
|
*/
|
||||||
|
private String paperId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判分详情,富文本格式
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 试题排序
|
||||||
|
*/
|
||||||
|
private int sort;
|
||||||
|
|
||||||
|
private String quId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package pc.exam.pp.module.exam.dal.mysql.student;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import pc.exam.pp.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperInfoDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生-试卷-判分详情 Mapper
|
||||||
|
*
|
||||||
|
* @author rwb
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface StuPaperInfoMapper extends BaseMapperX<StuPaperInfoDO> {
|
||||||
|
List<StuPaperInfoDO> findByStuIdAndPaperId(@Param("stuId") Long stuId, @Param("paperId") String paperId);
|
||||||
|
|
||||||
|
default StuPaperInfoDO findByStuIdAndPaperIdAndQuId(Long stuId, String paperId, String quId) {
|
||||||
|
return selectOne(StuPaperInfoDO::getStuId, stuId, StuPaperInfoDO::getPaperId, paperId, StuPaperInfoDO::getQuId, quId);
|
||||||
|
}
|
||||||
|
List<StuPaperInfoDO> findOneByStuIdAndPaperId(@Param("stuId")Long stuId, @Param("paperId")String paperId,@Param("type") int type);
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package pc.exam.pp.module.exam.service.stuPaperInfo;
|
||||||
|
|
||||||
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||||
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperInfoDO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生-试卷-判分详情 Service 接口
|
||||||
|
*
|
||||||
|
* @author rwb
|
||||||
|
*/
|
||||||
|
public interface StuPaperInfoService {
|
||||||
|
|
||||||
|
List<StuPaperInfoDO> findByStuIDAndPaperId(Long stuID, String paperID);
|
||||||
|
|
||||||
|
StuPaperInfoDO findByStuIDAndPaperIdAndExamId(Long stuID, String paperID, String quId);
|
||||||
|
|
||||||
|
void insertStuPaperInfo(StuPaperInfoDO stuPaperInfoDO);
|
||||||
|
|
||||||
|
void updateStuPaperInfo(StuPaperInfoDO stuPaperInfoDO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package pc.exam.pp.module.exam.service.stuPaperInfo;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||||
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperInfoDO;
|
||||||
|
import pc.exam.pp.module.exam.dal.mysql.student.StuPaperFileMapper;
|
||||||
|
import pc.exam.pp.module.exam.dal.mysql.student.StuPaperInfoMapper;
|
||||||
|
import pc.exam.pp.module.exam.service.stu_paper_file.StuPaperFileService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生-试卷-判分详情 Service 实现类
|
||||||
|
*
|
||||||
|
* @author rwb
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class StuPaperInfoServiceImpl implements StuPaperInfoService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StuPaperInfoMapper stuPaperInfoMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StuPaperInfoDO> findByStuIDAndPaperId(Long stuID, String paperID) {
|
||||||
|
return stuPaperInfoMapper.findByStuIdAndPaperId(stuID, paperID);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StuPaperInfoDO findByStuIDAndPaperIdAndExamId(Long stuID, String paperID, String quId) {
|
||||||
|
return stuPaperInfoMapper.findByStuIdAndPaperIdAndQuId(stuID, paperID, quId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertStuPaperInfo(StuPaperInfoDO stuPaperInfoDO) {
|
||||||
|
stuPaperInfoMapper.insert(stuPaperInfoDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateStuPaperInfo(StuPaperInfoDO stuPaperInfoDO) {
|
||||||
|
stuPaperInfoMapper.updateById(stuPaperInfoDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="pc.exam.pp.module.exam.dal.mysql.student.StuPaperInfoMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
<select id="findByStuIdAndPaperId" resultType="pc.exam.pp.module.exam.dal.dataobject.student.StuPaperInfoDO">
|
||||||
|
SELECT * FROM exam_stu_paper_info WHERE stu_id = #{stuId} AND paper_id = #{paperId} ORDER BY sort ASC
|
||||||
|
</select>
|
||||||
|
<select id="findOneByStuIdAndPaperId"
|
||||||
|
resultType="pc.exam.pp.module.exam.dal.dataobject.student.StuPaperInfoDO">
|
||||||
|
SELECT * FROM exam_stu_paper_info WHERE stu_id = #{stuId} AND paper_id = #{paperId} and type =#{type}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -11,10 +11,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import pc.exam.pp.framework.common.pojo.CommonResult;
|
import pc.exam.pp.framework.common.pojo.CommonResult;
|
||||||
import pc.exam.pp.module.exam.dal.dataobject.ExamQuestion;
|
import pc.exam.pp.module.exam.dal.dataobject.ExamQuestion;
|
||||||
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||||
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperInfoDO;
|
||||||
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperQuMapper;
|
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperQuMapper;
|
||||||
import pc.exam.pp.module.exam.dal.mysql.question.ExamQuestionMapper;
|
import pc.exam.pp.module.exam.dal.mysql.question.ExamQuestionMapper;
|
||||||
import pc.exam.pp.module.exam.dal.mysql.student.StuScoreVo;
|
import pc.exam.pp.module.exam.dal.mysql.student.StuScoreVo;
|
||||||
import pc.exam.pp.module.exam.service.question.IExamQuestionService;
|
import pc.exam.pp.module.exam.service.question.IExamQuestionService;
|
||||||
|
import pc.exam.pp.module.exam.service.stuPaperInfo.StuPaperInfoService;
|
||||||
import pc.exam.pp.module.exam.service.stuPaperScore.StuPaperScoreService;
|
import pc.exam.pp.module.exam.service.stuPaperScore.StuPaperScoreService;
|
||||||
import pc.exam.pp.module.exam.service.stu_paper_file.StuPaperFileService;
|
import pc.exam.pp.module.exam.service.stu_paper_file.StuPaperFileService;
|
||||||
import pc.exam.pp.module.judgement.controller.admin.autoTools.vo.StuPaperReqVo;
|
import pc.exam.pp.module.judgement.controller.admin.autoTools.vo.StuPaperReqVo;
|
||||||
@@ -55,7 +57,7 @@ public class AutoToolsController {
|
|||||||
@Resource
|
@Resource
|
||||||
IExamQuestionService examQuestionService;
|
IExamQuestionService examQuestionService;
|
||||||
@Resource
|
@Resource
|
||||||
StuPaperFileService stuPaperFileService;
|
StuPaperInfoService stuPaperInfoService;
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
public CommonResult<BigDecimal> get(StuPaperReqVo stuPaperReqVo) throws Exception {
|
public CommonResult<BigDecimal> get(StuPaperReqVo stuPaperReqVo) throws Exception {
|
||||||
@@ -96,14 +98,11 @@ public class AutoToolsController {
|
|||||||
List<ExamQuestion> examQuestionList = examQuestionMapper.selectExamQuestionListByQuIds(quIds);
|
List<ExamQuestion> examQuestionList = examQuestionMapper.selectExamQuestionListByQuIds(quIds);
|
||||||
stuPaperScoreInfoVos.setExamQuestionList(examQuestionList);
|
stuPaperScoreInfoVos.setExamQuestionList(examQuestionList);
|
||||||
// 5、查询学生试卷分析
|
// 5、查询学生试卷分析
|
||||||
List<StuPaperFileDO> stuPaperFileDOList = stuPaperFileService.findByStuIDAndPaperId(stuPaperReqVo.getStuId(), stuPaperReqVo.getPaperId());
|
List<StuPaperInfoDO> stuPaperInfoDOList = stuPaperInfoService.findByStuIDAndPaperId(stuPaperReqVo.getStuId(), stuPaperReqVo.getPaperId());
|
||||||
String judgementStr = " ";
|
String judgementStr = "<p>试卷分析</p>";
|
||||||
for (StuPaperFileDO stuPaperFileDOs : stuPaperFileDOList) {
|
for (StuPaperInfoDO stuPaperInfoDO : stuPaperInfoDOList) {
|
||||||
if (stuPaperFileDOs.getType() == 0) {
|
judgementStr += "<p></p>";
|
||||||
if (stuPaperFileDOs.getContent() != null) {
|
judgementStr += stuPaperInfoDO.getContent();
|
||||||
judgementStr = stuPaperFileDOs.getContent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
stuPaperScoreInfoVos.setPaperAnalysis(judgementStr);
|
stuPaperScoreInfoVos.setPaperAnalysis(judgementStr);
|
||||||
return CommonResult.success(stuPaperScoreInfoVos);
|
return CommonResult.success(stuPaperScoreInfoVos);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import pc.exam.pp.module.exam.dal.dataobject.EducationPaperQu;
|
|||||||
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperScheme;
|
import pc.exam.pp.module.exam.dal.dataobject.EducationPaperScheme;
|
||||||
import pc.exam.pp.module.exam.dal.dataobject.ExamQuestion;
|
import pc.exam.pp.module.exam.dal.dataobject.ExamQuestion;
|
||||||
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperFileDO;
|
||||||
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperInfoDO;
|
||||||
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperScoreDO;
|
import pc.exam.pp.module.exam.dal.dataobject.student.StuPaperScoreDO;
|
||||||
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperMapper;
|
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperMapper;
|
||||||
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperQuMapper;
|
import pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperQuMapper;
|
||||||
@@ -24,6 +25,7 @@ import pc.exam.pp.module.exam.dal.mysql.question.ExamQuestionMapper;
|
|||||||
import pc.exam.pp.module.exam.dal.mysql.student.StuPaperScoreMapper;
|
import pc.exam.pp.module.exam.dal.mysql.student.StuPaperScoreMapper;
|
||||||
import pc.exam.pp.module.exam.service.paper.IEducationPaperQuService;
|
import pc.exam.pp.module.exam.service.paper.IEducationPaperQuService;
|
||||||
import pc.exam.pp.module.exam.service.question.IExamQuestionService;
|
import pc.exam.pp.module.exam.service.question.IExamQuestionService;
|
||||||
|
import pc.exam.pp.module.exam.service.stuPaperInfo.StuPaperInfoService;
|
||||||
import pc.exam.pp.module.exam.service.stuPaperScore.StuPaperScoreService;
|
import pc.exam.pp.module.exam.service.stuPaperScore.StuPaperScoreService;
|
||||||
import pc.exam.pp.module.exam.service.stu_paper_file.StuPaperFileService;
|
import pc.exam.pp.module.exam.service.stu_paper_file.StuPaperFileService;
|
||||||
import pc.exam.pp.module.infra.dal.dataobject.config.ConfigDO;
|
import pc.exam.pp.module.infra.dal.dataobject.config.ConfigDO;
|
||||||
@@ -59,6 +61,8 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
@Resource
|
@Resource
|
||||||
private StuPaperFileService stuPaperFileService;
|
private StuPaperFileService stuPaperFileService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private StuPaperInfoService stuPaperInfoService;
|
||||||
|
@Resource
|
||||||
ConfigService configService;
|
ConfigService configService;
|
||||||
@Resource
|
@Resource
|
||||||
IExamQuestionService examQuestionService;
|
IExamQuestionService examQuestionService;
|
||||||
@@ -94,8 +98,6 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
EducationPaperSchemeMapper educationPaperSchemeMapper;
|
EducationPaperSchemeMapper educationPaperSchemeMapper;
|
||||||
@Resource
|
@Resource
|
||||||
EducationPaperMapper educationPaperMapper;
|
EducationPaperMapper educationPaperMapper;
|
||||||
@Resource
|
|
||||||
IEducationPaperQuService iEducationPaperQuService;
|
|
||||||
@Override
|
@Override
|
||||||
public String downloadStudentFile(String fileUrl, String filePath) {
|
public String downloadStudentFile(String fileUrl, String filePath) {
|
||||||
try {
|
try {
|
||||||
@@ -197,7 +199,6 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
List<StuPaperFileDO> stuPaperFileDOList = stuPaperFileService.findByStuIDAndPaperId(stuId, paperId);
|
List<StuPaperFileDO> stuPaperFileDOList = stuPaperFileService.findByStuIDAndPaperId(stuId, paperId);
|
||||||
StuPaperFileDO stuPaperFileDO = null;
|
StuPaperFileDO stuPaperFileDO = null;
|
||||||
StuPaperFileDO noZipFileDO = null;
|
StuPaperFileDO noZipFileDO = null;
|
||||||
String judgementStr = " ";
|
|
||||||
for (StuPaperFileDO stuPaperFileDOs : stuPaperFileDOList) {
|
for (StuPaperFileDO stuPaperFileDOs : stuPaperFileDOList) {
|
||||||
if (stuPaperFileDOs.getType() == 1) {
|
if (stuPaperFileDOs.getType() == 1) {
|
||||||
noZipFileDO = stuPaperFileDOs;
|
noZipFileDO = stuPaperFileDOs;
|
||||||
@@ -205,9 +206,6 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
}
|
}
|
||||||
if (stuPaperFileDOs.getType() == 0) {
|
if (stuPaperFileDOs.getType() == 0) {
|
||||||
stuPaperFileDO = stuPaperFileDOs;
|
stuPaperFileDO = stuPaperFileDOs;
|
||||||
if (stuPaperFileDOs.getContent() != null) {
|
|
||||||
judgementStr = stuPaperFileDOs.getContent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,8 +370,26 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
String judgementStr_C = "";
|
String judgementStr_C = "";
|
||||||
SourceAndText cpojo = judgementService.ProgrammingC(Double.parseDouble(quScore), one_file.getPath(), file_one.getName(), examQuestion, judgementStr_C);
|
SourceAndText cpojo = judgementService.ProgrammingC(Double.parseDouble(quScore), one_file.getPath(), file_one.getName(), examQuestion, judgementStr_C);
|
||||||
double c_score = cpojo.getScore();
|
double c_score = cpojo.getScore();
|
||||||
judgementStr += "<p>-----------------------------------------------------------</p>";
|
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||||
|
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||||
judgementStr += cpojo.getText();
|
judgementStr += cpojo.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 += c_score;
|
score += c_score;
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(c_score));
|
stuPaperScoreDO.setScore(new BigDecimal(c_score));
|
||||||
// 原始正确分数
|
// 原始正确分数
|
||||||
@@ -402,8 +418,24 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
String judgementStrWord = "";
|
String judgementStrWord = "";
|
||||||
SourceAndText wordpojo = judgementWpsWordService.judgementWpsWord(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrWord);
|
SourceAndText wordpojo = judgementWpsWordService.judgementWpsWord(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrWord);
|
||||||
double wps_word_score = wordpojo.getScore();
|
double wps_word_score = wordpojo.getScore();
|
||||||
judgementStr += "<p>-----------------------------------------------------------</p>";
|
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||||
|
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||||
judgementStr += wordpojo.getText();
|
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;
|
score += wps_word_score;
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(wps_word_score));
|
stuPaperScoreDO.setScore(new BigDecimal(wps_word_score));
|
||||||
// 原始正确分数
|
// 原始正确分数
|
||||||
@@ -431,8 +463,24 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
String judgementStrPptx = "";
|
String judgementStrPptx = "";
|
||||||
SourceAndText pptxpojo = judgementWpsPptxService.judgementWpsPptx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrPptx);
|
SourceAndText pptxpojo = judgementWpsPptxService.judgementWpsPptx(Double.parseDouble(quScore), one_file.getPath(), file_one.getPath(), examQuestion, judgementStrPptx);
|
||||||
double wps_pptx_score = pptxpojo.getScore();
|
double wps_pptx_score = pptxpojo.getScore();
|
||||||
judgementStr += "<p>-----------------------------------------------------------</p>";
|
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||||
|
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||||
judgementStr += pptxpojo.getText();
|
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;
|
score += wps_pptx_score;
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(wps_pptx_score));
|
stuPaperScoreDO.setScore(new BigDecimal(wps_pptx_score));
|
||||||
// 原始正确分数
|
// 原始正确分数
|
||||||
@@ -487,8 +535,24 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
File win_file = new File(one_file.getPath());
|
File win_file = new File(one_file.getPath());
|
||||||
SourceAndText winfilepojo = fileServerice.run_file_point(Double.parseDouble(quScore),win_file, examQuestion, judgementStrFile);
|
SourceAndText winfilepojo = fileServerice.run_file_point(Double.parseDouble(quScore),win_file, examQuestion, judgementStrFile);
|
||||||
double win_file_score = winfilepojo.getScore();
|
double win_file_score = winfilepojo.getScore();
|
||||||
judgementStr += "<p>-----------------------------------------------------------</p>";
|
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||||
|
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||||
judgementStr += winfilepojo.getText();
|
judgementStr += winfilepojo.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 += win_file_score;
|
score += win_file_score;
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(win_file_score));
|
stuPaperScoreDO.setScore(new BigDecimal(win_file_score));
|
||||||
// 原始正确分数
|
// 原始正确分数
|
||||||
@@ -520,8 +584,24 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
File edge_file = new File(one_file.getPath());
|
File edge_file = new File(one_file.getPath());
|
||||||
SourceAndText browsepojo= browserServerice.Judgement(Double.parseDouble(quScore),edge_file,examQuestion, judgementStrBrow);
|
SourceAndText browsepojo= browserServerice.Judgement(Double.parseDouble(quScore),edge_file,examQuestion, judgementStrBrow);
|
||||||
double browse_score = browsepojo.getScore();
|
double browse_score = browsepojo.getScore();
|
||||||
judgementStr += "<p>-----------------------------------------------------------</p>";
|
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||||
|
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||||
judgementStr += browsepojo.getText();
|
judgementStr += browsepojo.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 += browse_score;
|
score += browse_score;
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(browse_score));
|
stuPaperScoreDO.setScore(new BigDecimal(browse_score));
|
||||||
// 原始正确分数
|
// 原始正确分数
|
||||||
@@ -552,8 +632,24 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
File mysql_file = new File(one_file.getPath());
|
File mysql_file = new File(one_file.getPath());
|
||||||
SourceAndText judgementpojo = mysqlServerice.Judgement(Double.parseDouble(quScore),mysql_file, examQuestion, judgementStrMysql);
|
SourceAndText judgementpojo = mysqlServerice.Judgement(Double.parseDouble(quScore),mysql_file, examQuestion, judgementStrMysql);
|
||||||
double judgement = judgementpojo.getScore();
|
double judgement = judgementpojo.getScore();
|
||||||
judgementStr += "<p>-----------------------------------------------------------</p>";
|
String judgementStr = "<p>-----------------------------------------------------------</p>";
|
||||||
|
judgementStr += "<p>试题编号" + examQuestion.getQuNum() + "</p>";
|
||||||
judgementStr += judgementpojo.getText();
|
judgementStr += judgementpojo.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+=judgement;
|
score+=judgement;
|
||||||
stuPaperScoreDO.setScore(new BigDecimal(judgement));
|
stuPaperScoreDO.setScore(new BigDecimal(judgement));
|
||||||
// 原始正确分数
|
// 原始正确分数
|
||||||
@@ -589,10 +685,6 @@ public class AutoToolsServiceImpl implements AutoToolsService{
|
|||||||
// 9、上传文件
|
// 9、上传文件
|
||||||
MultipartFile file = new CustomMultipartFile(zipPath);
|
MultipartFile file = new CustomMultipartFile(zipPath);
|
||||||
String path = null;
|
String path = null;
|
||||||
if (stuPaperFileDO != null) {
|
|
||||||
stuPaperFileDO.setContent(judgementStr);
|
|
||||||
stuPaperFileService.updateStuPaperFile(stuPaperFileDO);
|
|
||||||
}
|
|
||||||
fileService.createStuFile(stuId, paperId, file.getOriginalFilename(), path, IoUtil.readBytes(file.getInputStream()));
|
fileService.createStuFile(stuId, paperId, file.getOriginalFilename(), path, IoUtil.readBytes(file.getInputStream()));
|
||||||
// 更新学生分数
|
// 更新学生分数
|
||||||
endStuMonitorUtils.endStuMonitor(String.valueOf(stuId),paperId,score);
|
endStuMonitorUtils.endStuMonitor(String.valueOf(stuId),paperId,score);
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package pc.exam.pp.module.judgement.utils.wps_pptx;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class ReflectionAnalyzer {
|
||||||
|
|
||||||
|
public static String analyzeReflection(String reflectionTag) {
|
||||||
|
Map<String, String> attrMap = new HashMap<>();
|
||||||
|
|
||||||
|
// 提取属性
|
||||||
|
Pattern pattern = Pattern.compile("(\\w+)=\"([^\"]+)\"");
|
||||||
|
Matcher matcher = pattern.matcher(reflectionTag);
|
||||||
|
while (matcher.find()) {
|
||||||
|
attrMap.put(matcher.group(1), matcher.group(2));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 读取关键属性
|
||||||
|
int sy = Integer.parseInt(attrMap.getOrDefault("sy", "0"));
|
||||||
|
String algn = attrMap.getOrDefault("algn", "");
|
||||||
|
|
||||||
|
// 分类 sy 类型
|
||||||
|
String scaleType;
|
||||||
|
if (sy == -100000) {
|
||||||
|
scaleType = "镜像倒影";
|
||||||
|
} else if (sy < -100000) {
|
||||||
|
scaleType = "放大倒影";
|
||||||
|
} else if (sy < 0) {
|
||||||
|
scaleType = "缩小倒影";
|
||||||
|
} else {
|
||||||
|
scaleType = "非倒影或非法值";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分类 algn 类型
|
||||||
|
String contactType = switch (algn) {
|
||||||
|
case "bl", "b" -> "接触";
|
||||||
|
case "ctr", "t", "tl", "tr" -> "不接触";
|
||||||
|
default -> "未知";
|
||||||
|
};
|
||||||
|
|
||||||
|
return scaleType + "," + contactType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String input1 = "<a:reflection blurRad=\"6350\" stA=\"52000\" endA=\"300\" endPos=\"35000\" dir=\"5400000\" sy=\"-100000\" algn=\"bl\" rotWithShape=\"0\"/>";
|
||||||
|
String input2 = "<a:reflection blurRad=\"4000\" stA=\"60000\" endA=\"5000\" endPos=\"20000\" dir=\"5400000\" sy=\"-80000\" algn=\"ctr\"/>";
|
||||||
|
String input3 = "<a:reflection sy=\"-120000\" algn=\"b\"/>";
|
||||||
|
String input4 = "<a:reflection sy=\"50000\" algn=\"tr\"/>";
|
||||||
|
|
||||||
|
System.out.println(analyzeReflection(input1)); // 镜像倒影,接触
|
||||||
|
System.out.println(analyzeReflection(input2)); // 缩小倒影,不接触
|
||||||
|
System.out.println(analyzeReflection(input3)); // 放大倒影,接触
|
||||||
|
System.out.println(analyzeReflection(input4)); // 非倒影或非法值,不接触
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -160,7 +160,7 @@ public class WpsPptxUtils {
|
|||||||
if (dur == null) {
|
if (dur == null) {
|
||||||
value = "0秒";
|
value = "0秒";
|
||||||
} else {
|
} else {
|
||||||
value = Integer.parseInt(dur) / 1000 + "秒";
|
value = String.valueOf((double) Integer.parseInt(dur) / 1000);
|
||||||
}
|
}
|
||||||
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||||
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||||
@@ -186,6 +186,18 @@ public class WpsPptxUtils {
|
|||||||
judgementDto.setScoreRate("1");
|
judgementDto.setScoreRate("1");
|
||||||
judgementList.add(judgementDto);
|
judgementList.add(judgementDto);
|
||||||
}
|
}
|
||||||
|
} else if (pptxInfoPointsVo.getName().contains("形状效果") && pptxInfoPointsVo.getName().contains("预设")) {
|
||||||
|
slideCursor.selectPath(namespace + pptxInfoPointsVo.getFunction().replace("-", ""));
|
||||||
|
if (slideCursor.toNextSelection()) {
|
||||||
|
String value = slideCursor.xmlText();
|
||||||
|
value = ReflectionAnalyzer.analyzeReflection(value);
|
||||||
|
WpsPptxJudgementDto judgementDto = new WpsPptxJudgementDto();
|
||||||
|
judgementDto.setContentIn(getStringName(pptxInfoPointsVo.getEnglishName()) + pptxInfoPointsVo.getName() + value);
|
||||||
|
judgementDto.setContent(pptxInfoPointsVo.getEnglishName()+"?"+pptxInfoPointsVo.getFunction()+"?"+ value);
|
||||||
|
judgementDto.setImage(pptxInfoPointsVo.getType()+"-"+pptxInfoPointsVo.getBelongTo()+"-"+pptxInfoPointsVo.getIsboo()+"-"+pptxInfoPointsVo.getUnit());
|
||||||
|
judgementDto.setScoreRate("1");
|
||||||
|
judgementList.add(judgementDto);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
slideCursor.selectPath(namespace + pptxInfoPointsVo.getFunction().replace("-", ""));
|
slideCursor.selectPath(namespace + pptxInfoPointsVo.getFunction().replace("-", ""));
|
||||||
if (slideCursor.toNextSelection()) {
|
if (slideCursor.toNextSelection()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user