|
|
@@ -9,6 +9,7 @@ import nju.seec.helper.dto.quiz.QuizStudentAnswerDTO;
|
|
|
import nju.seec.helper.dto.user.LoginUser;
|
|
|
import nju.seec.helper.service.QuizService;
|
|
|
import nju.seec.helper.service.QuizStudentAnswerService;
|
|
|
+import nju.seec.helper.util.enums.QuizState;
|
|
|
import nju.seec.helper.util.enums.UserType;
|
|
|
import nju.seec.helper.vo.quiz.QuizStudentAnswerVO;
|
|
|
import nju.seec.helper.vo.quiz.QuizVO;
|
|
|
@@ -38,27 +39,39 @@ public class QuizController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 老师获取测试列表
|
|
|
+ * 老师基于课件获取测试列表
|
|
|
*/
|
|
|
@Auth(roles = UserType.TEACHER, message = "获得测试列表")
|
|
|
@GetMapping("/teacher/slide/{slideId}")
|
|
|
- public PageResponse<QuizVO> teacherGetQuizzes(LoginUser user,
|
|
|
- @PathVariable Long slideId,
|
|
|
- @RequestParam(required = false, defaultValue = "") String key,
|
|
|
- @PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
- return PageResponse.of(quizService.teacherGetQuizzes(user, slideId, key, pageable));
|
|
|
+ public PageResponse<QuizVO> teacherGetQuizzesBySlide(LoginUser user,
|
|
|
+ @PathVariable Long slideId,
|
|
|
+ @RequestParam(required = false, defaultValue = "") String key,
|
|
|
+ @PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
+ return PageResponse.of(quizService.teacherGetQuizzesBySlide(user, slideId, key, pageable));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 学生获取测试列表
|
|
|
+ * 学生基于课件获取测试列表
|
|
|
*/
|
|
|
@Auth(roles = UserType.STUDENT, message = "获得测试列表")
|
|
|
@GetMapping("/student/slide/{slideId}")
|
|
|
- public PageResponse<QuizVO> studentGetQuizzes(LoginUser user,
|
|
|
- @PathVariable Long slideId,
|
|
|
+ public PageResponse<QuizVO> studentGetQuizzesBySlide(LoginUser user,
|
|
|
+ @PathVariable Long slideId,
|
|
|
+ @RequestParam(required = false, defaultValue = "") String key,
|
|
|
+ @PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
+ return PageResponse.of(quizService.studentGetQuizzesBySlide(user, slideId, key, pageable));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 学生基于状态获取测试列表
|
|
|
+ */
|
|
|
+ @Auth(roles = UserType.STUDENT, message = "获取测试列表")
|
|
|
+ @GetMapping("/student")
|
|
|
+ public PageResponse<QuizVO> studentGetQuizzesByState(LoginUser user,
|
|
|
+ QuizState state,
|
|
|
@RequestParam(required = false, defaultValue = "") String key,
|
|
|
@PageableDefault(Integer.MAX_VALUE) Pageable pageable) {
|
|
|
- return PageResponse.of(quizService.studentGetQuizzes(user, slideId, key, pageable));
|
|
|
+ return PageResponse.of(quizService.studentGetQuizzesByState(user, state, key, pageable));
|
|
|
}
|
|
|
|
|
|
/**
|