考核评估-查看答题记录

This commit is contained in:
xusd 2024-05-10 17:52:31 +08:00
parent 5ada846138
commit 4361c14623
6 changed files with 116 additions and 1 deletions

View File

@ -82,6 +82,15 @@ public class ExamMyExamineController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 查看历史作答详情
*/
@PreAuthorize("@ss.hasPermi('examine:myExamine:getHistoryExam')")
@GetMapping("/getHistoryExam/{id}")
public MyExamVO getHistoryExam(@PathVariable("id") String id){
return myExamineService.getHistoryExam(id);
}
/** /**
* 查询我的认证管理列表 * 查询我的认证管理列表
*/ */

View File

@ -56,4 +56,20 @@ public interface MyExamineMapper {
* @return java.util.List<com.inspur.examine.dto.CorrectAnswerDTO> * @return java.util.List<com.inspur.examine.dto.CorrectAnswerDTO>
*/ */
List<CorrectAnswerDTO> selectPaperQuestionHaveAnswerListByPaperId(String paperId); List<CorrectAnswerDTO> selectPaperQuestionHaveAnswerListByPaperId(String paperId);
/**
* 查看历史作答考试基本信息
* @param id 试卷id
*/
MyExamVO getHistoryExam(String id);
/**
* 获取答题记录和试题答案以及解析
*
* @param paperId 试卷id
* @return java.util.List<com.inspur.examine.vo.MyExamPaperQuestionVO>
* @Author xusd
* @Date 17:49 2024/5/10
*/
List<MyExamPaperQuestionVO> selectHistoryPaperQuestionNoAnswerListByPaperId(String paperId);
} }

View File

@ -53,4 +53,10 @@ public interface IMyExamineService {
* @param submitExamDTO 考试及答案 * @param submitExamDTO 考试及答案
*/ */
int submitExam(SubmitExamDTO submitExamDTO); int submitExam(SubmitExamDTO submitExamDTO);
/**
* 查看历史作答详情
* @param id 试卷id
*/
MyExamVO getHistoryExam(String id);
} }

View File

@ -203,6 +203,32 @@ public class MyExamineServiceImpl implements IMyExamineService {
return myExamineMapper.examHistoryList(examPaperInfo); return myExamineMapper.examHistoryList(examPaperInfo);
} }
/**
* 查看历史作答详情
* @param id 试卷id
*/
@Override
public MyExamVO getHistoryExam(String id) {
MyExamVO myExam = myExamineMapper.getHistoryExam(id);
if (Objects.isNull(myExam)){
throw new ServiceException("未查询到考试信息");
}
//考试题
List<MyExamPaperQuestionVO> allPaperQuestionList = myExamineMapper.selectHistoryPaperQuestionNoAnswerListByPaperId(id);
if (StringUtils.isEmpty(allPaperQuestionList)){
throw new ServiceException("未查询到考试题目");
}
//试题类型 0 单选1 多选2 判断
Map<String, List<MyExamPaperQuestionVO>> allPaperQuestionMap = allPaperQuestionList.stream().collect(Collectors.groupingBy(MyExamPaperQuestionVO::getQuestionType));
//单选
myExam.setSingleChoiceList(allPaperQuestionMap.get("0"));
//多选
myExam.setMultiChoiceList(allPaperQuestionMap.get("1"));
//判断
myExam.setJudgeList(allPaperQuestionMap.get("2"));
return myExam;
}
/** /**
* 查询我的认证管理列表 * 查询我的认证管理列表
*/ */

View File

@ -1,5 +1,6 @@
package com.inspur.examine.vo; package com.inspur.examine.vo;
import com.inspur.common.annotation.Excel;
import lombok.Data; import lombok.Data;
/** /**
@ -31,4 +32,24 @@ public class MyExamPaperQuestionVO {
*/ */
private String questionOptions; private String questionOptions;
/**
* 试题答案
*/
private String questionAnswer;
/**
* 答案解析
*/
private String questionAnswerAnalysis;
/**
* 考生答案
*/
private String examineAnswer;
/**
* 是否正确0正确1错误
*/
private String isSure;
} }

View File

@ -180,7 +180,7 @@
LEFT JOIN sys_user AS su ON epi.examine_id = su.user_id LEFT JOIN sys_user AS su ON epi.examine_id = su.user_id
LEFT JOIN exam_attestation AS ea ON ei.attestation_id = ea.id LEFT JOIN exam_attestation AS ea ON ei.attestation_id = ea.id
WHERE WHERE
epi.id = '38d240be52914ddd855054c183f6f0a3' epi.id = #{id}
AND epi.`status` = '0' AND epi.`status` = '0'
</select> </select>
@ -210,4 +210,41 @@
epq.paper_id = #{paperId} epq.paper_id = #{paperId}
</select> </select>
<select id="getHistoryExam" resultType="com.inspur.examine.vo.MyExamVO">
SELECT
epi.id,
ei.exam_name AS examName,
su.nick_name AS examineName,
ea.attestation_name AS attestationName,
ei.exam_duration AS examDuration,
ei.exam_rules AS examRules,
ei.total_score AS totalScore,
ei.pass_score AS passScore
FROM
exam_paper_info AS epi
LEFT JOIN exam_info AS ei ON epi.exam_id = ei.id
LEFT JOIN sys_user AS su ON epi.examine_id = su.user_id
LEFT JOIN exam_attestation AS ea ON ei.attestation_id = ea.id
WHERE
epi.id = #{id}
AND (epi.`status` = '1' or epi.`status` = '2')
</select>
<select id="selectHistoryPaperQuestionNoAnswerListByPaperId"
resultType="com.inspur.examine.vo.MyExamPaperQuestionVO">
SELECT
epq.id,
epq.examine_answer AS examineAnswer,
epq.is_sure AS isSure,
eqb.question_type AS questionType,
eqb.question_title AS questionTitle,
eqb.question_options AS questionOptions,
eqb.question_answer AS questionAnswer,
eqb.question_answer_analysis AS questionAnswerAnalysis
FROM
exam_paper_question AS epq
LEFT JOIN exam_question_bank AS eqb ON epq.question_id = eqb.id
WHERE
epq.paper_id = #{paperId}
</select>
</mapper> </mapper>