【修改】 学生交卷后的数据展示

This commit is contained in:
DESKTOP-932OMT8\REN
2025-05-18 17:00:54 +08:00
parent ea76bee9ce
commit e3729b47cd
6 changed files with 19 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
package pc.exam.pp.module.exam.dal.dataobject.student; package pc.exam.pp.module.exam.dal.dataobject.student;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
@@ -49,6 +50,9 @@ public class StuPaperScoreDO extends TenantBaseDO {
* 是否正确 * 是否正确
*/ */
private int isTrue; private int isTrue;
/**
* 题型名称
*/
private String subjectName;
} }

View File

@@ -22,4 +22,8 @@ public class StuScoreVo {
@Schema(description = "正确得分") @Schema(description = "正确得分")
private BigDecimal trueScore; private BigDecimal trueScore;
@Schema(description = "头像地址")
private String picUrl;
} }

View File

@@ -51,10 +51,12 @@ public class StuPaperScoreServiceImpl implements StuPaperScoreService {
String stuNumber = ""; String stuNumber = "";
String nickName = ""; String nickName = "";
String taskId = ""; String taskId = "";
String picUrl = "";
List<StuScoreVo> stuScoreVos = stuPaperScoreMapper.getStuScore(stuId, paperId); List<StuScoreVo> stuScoreVos = stuPaperScoreMapper.getStuScore(stuId, paperId);
for (StuScoreVo scoreVo : stuScoreVos) { for (StuScoreVo scoreVo : stuScoreVos) {
stuNumber = scoreVo.getStuNumber(); stuNumber = scoreVo.getStuNumber();
nickName = scoreVo.getNickName(); nickName = scoreVo.getNickName();
picUrl = scoreVo.getPicUrl();
// 3、查询出来的所有分数进行相加 // 3、查询出来的所有分数进行相加
score = score.add(scoreVo.getScore()); score = score.add(scoreVo.getScore());
trueScore = trueScore.add(scoreVo.getTrueScore()); trueScore = trueScore.add(scoreVo.getTrueScore());
@@ -63,6 +65,7 @@ public class StuPaperScoreServiceImpl implements StuPaperScoreService {
stuScoreVo.setTrueScore(trueScore); stuScoreVo.setTrueScore(trueScore);
stuScoreVo.setStuNumber(stuNumber); stuScoreVo.setStuNumber(stuNumber);
stuScoreVo.setNickName(nickName); stuScoreVo.setNickName(nickName);
stuScoreVo.setPicUrl(picUrl);
// 4、通过paperId查询任务编号 // 4、通过paperId查询任务编号
EducationPaper educationPaper = educationPaperMapper.selectEducationPaperByPaperId(paperId); EducationPaper educationPaper = educationPaperMapper.selectEducationPaperByPaperId(paperId);
stuScoreVo.setTaskId(educationPaper.getTaskId()); stuScoreVo.setTaskId(educationPaper.getTaskId());

View File

@@ -20,7 +20,8 @@
esps.score AS score, esps.score AS score,
esps.true_score AS trueScore, esps.true_score AS trueScore,
su.username AS stuNumber, su.username AS stuNumber,
su.nickname AS nickName su.nickname AS nickName,
su.avatar AS picUrl
FROM FROM
exam_stu_paper_score AS esps exam_stu_paper_score AS esps
LEFT JOIN system_users AS su ON esps.stu_id = su.id LEFT JOIN system_users AS su ON esps.stu_id = su.id

View File

@@ -161,7 +161,7 @@ public class AutoToolsServiceImpl implements AutoToolsService{
@Override @Override
public CommonResult<Double> judgementScore(Long stuId, String paperId) throws Exception { public CommonResult<Double> judgementScore(Long stuId, String paperId) throws Exception {
//监控管理 生成选择题文件路径 //监控管理 生成选择题文件路径
endStuMonitorUtils.endStuMonitor(String.valueOf(stuId), paperId); // endStuMonitorUtils.endStuMonitor(String.valueOf(stuId), paperId);
// 获取平台文件参数 // 获取平台文件参数
ConfigDO config = configService.getConfigByKey("file_down_path"); ConfigDO config = configService.getConfigByKey("file_down_path");
double score = 0; double score = 0;
@@ -192,6 +192,7 @@ public class AutoToolsServiceImpl implements AutoToolsService{
// 判断是否做过该题 // 判断是否做过该题
boolean isNull = false; boolean isNull = false;
if (stuPaperScoreDO == null) { if (stuPaperScoreDO == null) {
stuPaperScoreDO = new StuPaperScoreDO();
stuPaperScoreDO.setStuId(stuId); stuPaperScoreDO.setStuId(stuId);
stuPaperScoreDO.setQuId(key); stuPaperScoreDO.setQuId(key);
stuPaperScoreDO.setPaperId(paperId); stuPaperScoreDO.setPaperId(paperId);
@@ -313,7 +314,7 @@ public class AutoToolsServiceImpl implements AutoToolsService{
// 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);
// end、删除文件 // end、删除文件
// zip_file.delete(); // zip_file.delete();
// folder.delete(); // folder.delete();

View File

@@ -51,6 +51,7 @@ public class JudgementChoiceServiceImpl implements JudgementChoiceService
// 原始正确分数 // 原始正确分数
stuPaperScoreDO.setTrueScore(new BigDecimal(score)); stuPaperScoreDO.setTrueScore(new BigDecimal(score));
stuPaperScoreDO.setIsTrue(0); stuPaperScoreDO.setIsTrue(0);
stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName());
if (isNull) { if (isNull) {
// 如果之前没做过,则插入该题的分数 // 如果之前没做过,则插入该题的分数
stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO); stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO);
@@ -65,6 +66,7 @@ public class JudgementChoiceServiceImpl implements JudgementChoiceService
// 原始正确分数 // 原始正确分数
stuPaperScoreDO.setTrueScore(new BigDecimal(score)); stuPaperScoreDO.setTrueScore(new BigDecimal(score));
stuPaperScoreDO.setIsTrue(1); stuPaperScoreDO.setIsTrue(1);
stuPaperScoreDO.setSubjectName(examQuestion.getSubjectName());
if (isNull) { if (isNull) {
// 如果之前没做过,则插入该题的分数 // 如果之前没做过,则插入该题的分数
stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO); stuPaperScoreService.insertStuPaperScore(stuPaperScoreDO);