Merge remote-tracking branch 'origin/dev-tmp1' into dev-tmp1
commit
f910cc3b27
|
|
@ -9,17 +9,11 @@ import org.qinan.cedu.model.dto.AnswerQuestionDTO;
|
||||||
import org.qinan.cedu.model.dto.StartExamDTO;
|
import org.qinan.cedu.model.dto.StartExamDTO;
|
||||||
import org.qinan.cedu.model.dto.SubmitExamDTO;
|
import org.qinan.cedu.model.dto.SubmitExamDTO;
|
||||||
import org.qinan.cedu.model.vo.PaperExamDetailVO;
|
import org.qinan.cedu.model.vo.PaperExamDetailVO;
|
||||||
import org.qinan.cedu.model.vo.PaperExamInfoVO;
|
|
||||||
import org.qinan.cedu.model.vo.StartExamVO;
|
import org.qinan.cedu.model.vo.StartExamVO;
|
||||||
import org.qinan.cedu.service.PaperExamService;
|
import org.qinan.cedu.service.PaperExamService;
|
||||||
import org.qinan.safetyeval.client.dto.SingleResponse;
|
import org.qinan.safetyeval.client.dto.SingleResponse;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
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;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 考试试卷管理
|
* 考试试卷管理
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,88 @@
|
||||||
|
package org.qinan.cedu.controller.app;
|
||||||
|
|
||||||
|
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.AllArgsConstructor;
|
||||||
|
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.ClassCourseVO;
|
||||||
|
import org.qinan.cedu.model.vo.ExamStatisticsAndRecordVO;
|
||||||
|
import org.qinan.cedu.model.vo.PaperExamDetailVO;
|
||||||
|
import org.qinan.cedu.model.vo.StartExamVO;
|
||||||
|
import org.qinan.cedu.service.ClassCourseService;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学习模块
|
||||||
|
*/
|
||||||
|
@Api(tags = "学习模块")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/safetyEval/app/study")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class StudyController {
|
||||||
|
|
||||||
|
private final ClassCourseService classCourseService;
|
||||||
|
private final PaperExamService paperExamService;
|
||||||
|
|
||||||
|
@ApiOperation("我的学习")
|
||||||
|
@GetMapping("/myCoursePage")
|
||||||
|
public SingleResponse<List<ClassCourseVO>> myCoursePage() {
|
||||||
|
List<ClassCourseVO> list = classCourseService.myCoursePage();
|
||||||
|
return SingleResponse.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("成绩查询")
|
||||||
|
@GetMapping("/myScoreQuery")
|
||||||
|
public SingleResponse<ExamStatisticsAndRecordVO> scoreQuery() {
|
||||||
|
ExamStatisticsAndRecordVO examStatisticsAndRecordVO = classCourseService.scoreQuery();
|
||||||
|
return SingleResponse.success(examStatisticsAndRecordVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去考试:生成考试记录和用户试题作答记录,返回考试信息(含试题列表及参考答案)
|
||||||
|
*/
|
||||||
|
@ApiOperation("去考试")
|
||||||
|
@PostMapping("/startExam")
|
||||||
|
public SingleResponse<StartExamVO> startExam(@Validated @RequestBody StartExamDTO dto) {
|
||||||
|
dto.setUserId(AuthContext.getUserId());
|
||||||
|
return SingleResponse.success(paperExamService.startExam(dto));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作答:保存用户作答答案,判定正确状态并计算作答得分
|
||||||
|
*/
|
||||||
|
@ApiOperation("作答")
|
||||||
|
@PostMapping("/answerQuestion")
|
||||||
|
public SingleResponse<Void> answerQuestion(@Validated @RequestBody AnswerQuestionDTO dto) {
|
||||||
|
paperExamService.answerQuestion(dto, AuthContext.getUserId());
|
||||||
|
return SingleResponse.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交卷:汇总各试题作答得分,更新考试成绩、是否通过并结束考试(携带班级id时保存班级学员考试记录)
|
||||||
|
*/
|
||||||
|
@ApiOperation("交卷")
|
||||||
|
@PostMapping("/submitExam")
|
||||||
|
public SingleResponse<Void> submitExam(@Validated @RequestBody SubmitExamDTO dto) {
|
||||||
|
paperExamService.submitExam(dto, AuthContext.getUserId());
|
||||||
|
return SingleResponse.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考试试卷信息查询:根据考试记录id查询试卷考试信息(含试题列表、参考答案及用户作答信息)
|
||||||
|
*/
|
||||||
|
@ApiOperation("考试试卷信息查询")
|
||||||
|
@GetMapping("/exam/info")
|
||||||
|
public SingleResponse<PaperExamDetailVO> paperExamInfo(@RequestParam("paperExamId") @ApiParam(value = "考试试卷id", required = true) Long paperExamId) {
|
||||||
|
PaperExamDetailVO examInfo = paperExamService.paperExamInfo(paperExamId);
|
||||||
|
return SingleResponse.success(examInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue