Skip to content
Snippets Groups Projects
Commit 2adb0ca9 authored by Tom Käsler's avatar Tom Käsler
Browse files

alphabeticalSort is prepared to work with both subjectSortOrder and questionSortOrder

parent a7ee4759
Branches
Tags
No related merge requests found
...@@ -831,17 +831,19 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis ...@@ -831,17 +831,19 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis
} }
public SortOrder alphabeticalSort(SortOrder sortOrder){ public SortOrder alphabeticalSort(SortOrder sortOrder){
Hashtable<String, String> hash = new Hashtable(); if ("".equals(sortOrder.getSubject())) {
for (String qid : sortOrder.getSortOrder()) { Hashtable<String, String> hash = new Hashtable();
Question question = getQuestion(qid); for (String qid : sortOrder.getSortOrder()) {
hash.put(question.getText(), qid); 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();
for (String textKey : keys) { List<String> keys = new ArrayList(hash.keySet());
sortList.add(hash.get(textKey)); for (String textKey : keys) {
} sortList.add(hash.get(textKey));
sortOrder.setSortOrder(sortList); }
return sortOrder; sortOrder.setSortOrder(sortList);
return sortOrder;
}
} }
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment