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

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;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
@@ -49,6 +50,9 @@ public class StuPaperScoreDO extends TenantBaseDO {
* 是否正确
*/
private int isTrue;
/**
* 题型名称
*/
private String subjectName;
}

View File

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

View File

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

View File

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