fixed paging
This commit is contained in:
parent
d7e52efac9
commit
3a06f9937f
1 changed files with 6 additions and 1 deletions
|
@ -165,8 +165,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));
|
||||
|
|
Loading…
Reference in a new issue