diff --git a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java index aa0fad0a378499b4c1b78b8e91a52b1242dd9b46..1e50661e772406c8e986bb7540e7a1ceb700483d 100644 --- a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java +++ b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java @@ -90,6 +90,21 @@ public class LecturerQuestionController extends PaginationController { throw new BadRequestException(); } + @ApiOperation(value = "Post provided questions", nickname = "bulkPostQuestions") + @ApiResponses(value = { + @ApiResponse(code = 400, message = HTML_STATUS_400) + }) + @RequestMapping(value = "/bulk", method = RequestMethod.POST) + @ResponseStatus(HttpStatus.CREATED) + public List<Question> bulkPostQuestions(@RequestBody final List<Question> questions) { + for (final Question question : questions) { + if (questionService.saveQuestion(question) == null) { + throw new BadRequestException(); + } + } + return questions; + } + @ApiOperation(value = "Update the question, identified by provided id, with the provided question in the Request Body", nickname = "updateQuestion") @ApiResponses(value = {