|
|
|
@ -35,6 +35,7 @@ public class QuestionContrller {
|
|
|
|
|
@RequestMapping(value = {"questionlist/{chapterId}-{offset}-{limit}"}, method = RequestMethod.GET)
|
|
|
|
|
public ModelAndView questionList(@PathVariable String chapterId , @PathVariable Integer offset ,
|
|
|
|
|
@PathVariable Integer limit , ModelAndView model){
|
|
|
|
|
try {
|
|
|
|
|
model.setViewName("questionList");
|
|
|
|
|
|
|
|
|
|
ChapterEntity chapter = iChapterService.findById(chapterId);
|
|
|
|
@ -56,6 +57,11 @@ public class QuestionContrller {
|
|
|
|
|
model.addObject("subjectId", course.getSubjectId());
|
|
|
|
|
model.addObject("courseId", course.getUid());
|
|
|
|
|
return model;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
model.setViewName("404");
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -66,6 +72,7 @@ public class QuestionContrller {
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = {"/question/{uid}.html"}, method = RequestMethod.GET)
|
|
|
|
|
public ModelAndView question(@PathVariable String uid , ModelAndView model){
|
|
|
|
|
try {
|
|
|
|
|
model.setViewName("question");
|
|
|
|
|
QuestionEntity question = iQuestionService.findNormalQuestion(uid);
|
|
|
|
|
question.setQuestionType(QuestionType.getQuestionType(question.getQuestionType()).getDesc());
|
|
|
|
@ -74,9 +81,14 @@ public class QuestionContrller {
|
|
|
|
|
// 推荐试题
|
|
|
|
|
model.addObject("featuredQuestionList", iQuestionService.featuredQuestion(question.getSubjectId(),question.getCourseId()));
|
|
|
|
|
return model;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
model.setViewName("404");
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = {"/question/getQuestion/{uid}.html"}, method = RequestMethod.GET)
|
|
|
|
|
@RequestMapping(value = {"question/getQuestion/{uid}"}, method = RequestMethod.GET)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Result getQuestion(@PathVariable String uid , ModelAndView model){
|
|
|
|
|
return Result.successResult(iQuestionService.select(uid));
|
|
|
|
|