Merge branch 'dev-1.2-SEBSERV-234' into development
Conflicts: src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamDAOImpl.java src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/session/impl/ExamSessionServiceImpl.java
This commit is contained in:
commit
facbef66ca
1 changed files with 7 additions and 1 deletions
|
@ -14,6 +14,7 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
@ -215,9 +216,14 @@ public class MoodleCourseDataAsyncLoader {
|
|||
|
||||
// then get all quizzes of courses and filter
|
||||
final LinkedMultiValueMap<String, String> attributes = new LinkedMultiValueMap<>();
|
||||
final List<String> courseIds = new ArrayList<>(courseData.keySet());
|
||||
if (courseIds.size() == 1) {
|
||||
// NOTE: This is a workaround because the Moodle API do not support lists with only one element.
|
||||
courseIds.add("0");
|
||||
}
|
||||
attributes.put(
|
||||
MoodleCourseAccess.MOODLE_COURSE_API_COURSE_IDS,
|
||||
new ArrayList<>(courseData.keySet()));
|
||||
courseIds);
|
||||
|
||||
final String quizzesJSON = callMoodleRestAPI(
|
||||
restTemplate,
|
||||
|
|
Loading…
Reference in a new issue