diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java index 3567428e..8ca736fd 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/lms/LmsAPIService.java @@ -168,8 +168,13 @@ public interface LmsAPIService { quizzes.subList(start, end)); } + final int mod = quizzes.size() % pageSize; return new Page<>( - (quizzes.size() <= pageSize) ? 1 : quizzes.size() / pageSize + 1, + (quizzes.size() <= pageSize) + ? 1 + : (mod > 0) + ? quizzes.size() / pageSize + 1 + : quizzes.size() / pageSize, pageNumber, sortAttribute, quizzes.subList(start, end));