user paper exam
parent
6ed15056d9
commit
5017255103
|
|
@ -3,17 +3,21 @@ package org.qinan.cedu.controller;
|
|||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.qinan.cedu.model.dto.AnswerQuestionDTO;
|
||||
import org.qinan.cedu.model.dto.StartExamDTO;
|
||||
import org.qinan.cedu.model.dto.SubmitExamDTO;
|
||||
import org.qinan.cedu.model.vo.PaperExamInfoVO;
|
||||
import org.qinan.cedu.model.vo.StartExamVO;
|
||||
import org.qinan.cedu.service.PaperExamService;
|
||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
|
|
@ -56,4 +60,14 @@ public class PaperExamController {
|
|||
paperExamService.submitExam(dto, AuthContext.getUserId());
|
||||
return SingleResponse.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 考试试卷信息查询:根据考试记录id查询试卷考试信息(含试题列表及参考答案)
|
||||
*/
|
||||
@ApiOperation("考试试卷信息查询")
|
||||
@GetMapping("/exam/info")
|
||||
public SingleResponse<PaperExamInfoVO> paperExamInfo(@RequestParam("paperExamId") @ApiParam(value = "考试试卷id", required = true) Long paperExamId) {
|
||||
PaperExamInfoVO examInfo = paperExamService.paperExamInfo(paperExamId);
|
||||
return SingleResponse.success(examInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import org.qinan.cedu.model.dto.PaperExamPageQueryDTO;
|
|||
import org.qinan.cedu.model.dto.StartExamDTO;
|
||||
import org.qinan.cedu.model.dto.SubmitExamDTO;
|
||||
import org.qinan.cedu.model.entity.PaperExamDO;
|
||||
import org.qinan.cedu.model.vo.PaperExamInfoVO;
|
||||
import org.qinan.cedu.model.vo.PaperExamVO;
|
||||
import org.qinan.cedu.model.vo.StartExamVO;
|
||||
|
||||
|
|
@ -79,4 +80,12 @@ public interface PaperExamService extends IService<PaperExamDO> {
|
|||
* @param userId 当前用户id
|
||||
*/
|
||||
void submitExam(SubmitExamDTO dto, Long userId);
|
||||
|
||||
/**
|
||||
* 查询考试试卷的试卷考试信息(含试题列表及参考答案)
|
||||
*
|
||||
* @param paperExamId 考试试卷id
|
||||
* @return 试卷考试信息
|
||||
*/
|
||||
PaperExamInfoVO paperExamInfo(Long paperExamId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,12 +13,14 @@ import org.qinan.cedu.enums.PaperExamStatusEnum;
|
|||
import org.qinan.cedu.mapper.*;
|
||||
import org.qinan.cedu.model.dto.*;
|
||||
import org.qinan.cedu.model.entity.*;
|
||||
import org.qinan.cedu.model.vo.PaperExamInfoVO;
|
||||
import org.qinan.cedu.model.vo.PaperExamQuestionStatVO;
|
||||
import org.qinan.cedu.model.vo.PaperExamVO;
|
||||
import org.qinan.cedu.model.vo.StartExamQuestionVO;
|
||||
import org.qinan.cedu.model.vo.StartExamVO;
|
||||
import org.qinan.cedu.service.PaperExamQuestionUserService;
|
||||
import org.qinan.cedu.service.PaperExamService;
|
||||
import org.qinan.cedu.service.PaperService;
|
||||
import org.qinan.safetyeval.domain.constant.BooleanQAEnum;
|
||||
import org.qinan.safetyeval.infrastructure.adapter.auth.AuthUserContextAdapter;
|
||||
import org.qinan.safetyeval.infrastructure.support.InsertFieldDefaults;
|
||||
|
|
@ -56,6 +58,8 @@ public class PaperExamServiceImpl extends ServiceImpl<PaperExamMapper, PaperExam
|
|||
|
||||
private final ClassStudentExamRecordMapper classStudentExamRecordMapper;
|
||||
|
||||
private final PaperService paperService;
|
||||
|
||||
@Override
|
||||
public IPage<PaperExamVO> pageQuery(PaperExamPageQueryDTO query) {
|
||||
return this.lambdaQuery()
|
||||
|
|
@ -193,6 +197,18 @@ public class PaperExamServiceImpl extends ServiceImpl<PaperExamMapper, PaperExam
|
|||
finishClassStudentExamRecord(paperExam, examScore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaperExamInfoVO paperExamInfo(Long paperExamId) {
|
||||
PaperExamDO paperExam = this.lambdaQuery()
|
||||
.eq(PaperExamDO::getId, paperExamId)
|
||||
.eq(PaperExamDO::getDeleteEnum, DeleteEnum.FALSE.getCode())
|
||||
.one();
|
||||
if (paperExam == null) {
|
||||
throw new IllegalArgumentException("考试试卷不存在");
|
||||
}
|
||||
return paperService.paperExamInfo(paperExam.getPaperId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成并保存班级学员考试记录(初始0分、未通过,结束时间由交卷回填)
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue