REST Service for POPCORN - ILIAS
alex
2025-09-18 e1217fbcd93654ad6492b641bf53e4e0d0368bfd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
export function goStart (offset, limit, total) {
   console.log(`goStart: offset=${offset} limit=${limit} total=${total}`)
   const offset2 = 0
   return offset2
}
 
export function goEnd (offset, limit, total) {
   console.log(`goEnd: offset=${offset} limit=${limit} total=${total}`)
   let offset2 = Math.floor(total / limit) * limit
   return offset2
}
 
export function goPrev (offset, limit, total) {
   console.log(`goPrev: offset=${offset} limit=${limit} total=${total}`)
   let offset2 = Math.max(0, offset - limit)
   return offset2
}
 
export function goNext (offset, limit, total) {
   console.log(`goNext: offset=${offset} limit=${limit} total=${total}`)
   const maxNext = Math.floor(total / limit) * limit
   const nextNext = offset + limit
   let offset2 = Math.min(maxNext, nextNext)
   return offset2
}