Commit 2b2a6b71 authored by wujipeng's avatar wujipeng
Browse files

学生端-学习中心-详情-我的成绩-题目导航

parent 11716202
......@@ -30,4 +30,7 @@ public class TheoreticalPaperStudentDetailVO extends TheoreticalPaperStudentDeta
@ApiModelProperty("该题型得分")
private Double sameScore;
@ApiModelProperty("结果描述")
private String resultDesc;
}
......@@ -137,4 +137,10 @@ public class ExamController extends BaseController {
public Result<ExamStudentVO> gradesStatistics(@PathVariable(name = "id") String id) {
return Result.data(examService.gradesStatistics(id));
}
@ApiOperation(value = "学生端-学习中心-详情-我的成绩-题目导航")
@GetMapping("/grades/navigation/{id}")
public Result<List<TheoreticalPaperStudentDetailVO>> gradesNavigation(@PathVariable(name = "id") String id) {
return Result.data(examService.gradesNavigation(id));
}
}
......@@ -25,4 +25,7 @@ public interface TheoreticalPaperStudentDetailMapper extends BaseMapper<Theoreti
TheoreticalPaperStudentDetailVO gradesQuestionDetail(@Param("id") String id);
Boolean leaveBlank(TheoreticalPaperStudentDetailDTO theoreticalPaperStudentDetailDTO);
List<TheoreticalPaperStudentDetailVO> gradesNavigation(@Param("examId") int examId, @Param("studentId") String studentId);
}
......@@ -53,4 +53,6 @@ public interface ExamService extends IService<ExamEntity> {
ExamStudentVO gradesStatistics(String id);
List<TheoreticalPaperStudentDetailVO> gradesNavigation(String id);
}
......@@ -20,6 +20,9 @@ public interface TheoreticalPaperStudentDetailService extends IService<Theoretic
TheoreticalPaperStudentDetailVO questionDetail(String id);
TheoreticalPaperStudentDetailVO gradesQuestionDetail(String id);
Boolean leaveBlank(TheoreticalPaperStudentDetailDTO theoreticalPaperStudentDetailDTO);
List<TheoreticalPaperStudentDetailVO> gradesNavigation(int examId, String studentId);
}
......@@ -441,6 +441,25 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, ExamEntity> impleme
return result;
}
@Override
public List<TheoreticalPaperStudentDetailVO> gradesNavigation(String id) {
//获取考试基础信息
ExamStudentEntity examStudent = examStudentService.getById(id);
List<TheoreticalPaperStudentDetailVO> result = theoreticalPaperStudentDetailService.gradesNavigation(examStudent.getExamId(), examStudent.getStudentId());
for (TheoreticalPaperStudentDetailVO theoreticalPaperStudentDetailVO : result) {
if (theoreticalPaperStudentDetailVO.getIsPartiallyRight()) {
theoreticalPaperStudentDetailVO.setResultDesc("部分对");
} else {
if(theoreticalPaperStudentDetailVO.getResult()){
theoreticalPaperStudentDetailVO.setResultDesc("答对");
} else {
theoreticalPaperStudentDetailVO.setResultDesc("答错");
}
}
}
return result;
}
private static Double judgeExamResult(ExamStudentVO result) {
Double score = result.getScore();
if (score != null) {
......
......@@ -38,4 +38,9 @@ public class TheoreticalPaperStudentDetailServiceImpl extends ServiceImpl<Theore
public Boolean leaveBlank(TheoreticalPaperStudentDetailDTO theoreticalPaperStudentDetailDTO) {
return baseMapper.leaveBlank(theoreticalPaperStudentDetailDTO);
}
@Override
public List<TheoreticalPaperStudentDetailVO> gradesNavigation(int examId, String studentId) {
return baseMapper.gradesNavigation(examId, studentId);
}
}
......@@ -54,6 +54,18 @@
where
id = #{id}
</select>
<select id="gradesNavigation" resultType="com.platform.business.model.vo.TheoreticalPaperStudentDetailVO">
SELECT
id,
is_partially_right as isPartiallyRight,
result
FROM
theoretical_paper_student_detail
WHERE
student_id = #{studentId}
AND
exam_id = #{examId}
</select>
<update id="leaveBlank">
update
theoretical_paper_student_detail
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment