diff --git a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java index 1a476d2dc58d64757b33fde0a6bb52350bcd6bc9..e2903e16458b313ec77e226670e08ccaa782cca5 100644 --- a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java +++ b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java @@ -445,7 +445,7 @@ public class LecturerQuestionController extends AbstractController { @RequestMapping(value = "/getsubjectsort", method = RequestMethod.GET) public String getSubjectSortType( @RequestParam(required = true) final String sessionkey, - @RequestParam(required = true) final String ispreparation + @RequestParam(required = true) final String ispreparation ) { return questionService.getSubjectSortType(sessionkey, ispreparation); } @@ -453,9 +453,9 @@ public class LecturerQuestionController extends AbstractController { @RequestMapping(value = "/setquestionsort", method = RequestMethod.POST) public void setQuestionSortOrder( @RequestParam(required = true) final String sessionkey, - @RequestParam(required = true) final String subject, - @RequestParam(required = true) final String sorttype, - @RequestParam(required = true) final String ispreparation, + @RequestParam(required = true) final String subject, + @RequestParam(required = true) final String sorttype, + @RequestParam(required = true) final String ispreparation, @RequestBody String[] sortOrder ) { try { @@ -469,7 +469,7 @@ public class LecturerQuestionController extends AbstractController { public String getQuestionSortType( @RequestParam(required = true) final String sessionkey, @RequestParam(required = true) final String subject, - @RequestParam(required = true) final String ispreparation + @RequestParam(required = true) final String ispreparation ) { return questionService.getQuestionSortType(sessionkey, ispreparation, subject); } diff --git a/src/main/java/de/thm/arsnova/services/IQuestionService.java b/src/main/java/de/thm/arsnova/services/IQuestionService.java index 17a463000fa0283d555071801e9296bac51c38bb..e9abb9421f1a97c55764ab1ce0c7e346c4353a4a 100644 --- a/src/main/java/de/thm/arsnova/services/IQuestionService.java +++ b/src/main/java/de/thm/arsnova/services/IQuestionService.java @@ -138,9 +138,9 @@ public interface IQuestionService { int getAbstentionAnswerCount(String questionId); - String getSubjectSortType(String sessionkey, String isPreparation); + String getSubjectSortType(String sessionkey, String isPreparation); + + SortOrder setSort(String sessionkey, String subject, String sortType, String isPreparation, String[] sortOrder); - SortOrder setSort(String sessionkey, String subject, String sortType, String isPreparation, String[] sortOrder); - - String getQuestionSortType(String sessionkey, String isPreparation, String subject); + String getQuestionSortType(String sessionkey, String isPreparation, String subject); } diff --git a/src/main/java/de/thm/arsnova/services/QuestionService.java b/src/main/java/de/thm/arsnova/services/QuestionService.java index a44acfb73af485897148563c8cc31746750818cf..dd37b0da3ae40b1dbb0ca5be07f6852e15121350 100644 --- a/src/main/java/de/thm/arsnova/services/QuestionService.java +++ b/src/main/java/de/thm/arsnova/services/QuestionService.java @@ -156,10 +156,10 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis addToSortOrder(subjectSortOrder, question.getSubject()); } else { - addToSortOrder(questionSortOrder, question.get_id()); + addToSortOrder(questionSortOrder, question.get_id()); } - } - + } + final NewQuestionEvent event = new NewQuestionEvent(this, session, result); this.publisher.publishEvent(event); @@ -918,14 +918,14 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis Question question = getQuestion(qid); hash.put(question.getText(), qid); } - List<String> sortList = new ArrayList(); - List<String> keys = new ArrayList(hash.keySet()); + List<String> sortList = new ArrayList(); + List<String> keys = new ArrayList(hash.keySet()); Collections.sort(keys); - for (String textKey : keys) { - sortList.add(hash.get(textKey)); - } - sortOrder.setSortOrder(sortList); - return sortOrder; + for (String textKey : keys) { + sortList.add(hash.get(textKey)); + } + sortOrder.setSortOrder(sortList); + return sortOrder; } - } + } }