Ejemplo n.º 1
0
 @RequestMapping(
     value = {"/modules/{moduleId}/tests", "/courses/{courseId}/modules/{moduleId}/tests"},
     method = RequestMethod.GET)
 public List<TestJsonDto> getTests(@PathVariable Long moduleId) {
   return dtoService.convert(
       testService.getAllByModuleId(moduleId), TestJsonDto.class, Test.class);
 }
Ejemplo n.º 2
0
 @RequestMapping(value = "/tests/{testId}/delete", method = RequestMethod.GET)
 public Boolean deleteTestById(@PathVariable Long testId) {
   testService.deleteTestById(testId);
   return true;
 }
Ejemplo n.º 3
0
 @RequestMapping(
     value = {"/tests/{testId}", "/courses/{courseId}/modules/{moduleId}/tests/{testId}"},
     method = RequestMethod.GET)
 public TestJsonDto getTest(@PathVariable Long testId) {
   return dtoService.convert(testService.getById(testId), TestJsonDto.class, Test.class);
 }