|
|
@@ -74,7 +74,12 @@ public class QuizController {
|
|
|
@Auth(roles = {UserType.STUDENT,UserType.TEACHER}, message = "获得某一测试的详细内容")
|
|
|
@GetMapping("/{quizId}")
|
|
|
public QuizVO GetOneQuiz(LoginUser user, @PathVariable("quizId") String quizId) {
|
|
|
- return quizService.combineQuizWithAnswer(Long.valueOf(quizId),user.getId(),user.getType());
|
|
|
+ QuizVO quizVO = quizService.combineQuizWithAnswer(Long.valueOf(quizId), user.getId(), user.getType());
|
|
|
+
|
|
|
+ if(user.getType().equals(UserType.STUDENT)&&!quizVO.getState().equals(QuizState.CLOSED)){
|
|
|
+ quizVO.excludeCorrectAnswer();
|
|
|
+ }
|
|
|
+ return quizVO;
|
|
|
}
|
|
|
|
|
|
/**
|