Skip to content

Commit d52865d

Browse files
committed
Fix the math in the test page navigation.
I had the math wrong in #2818. It is correct if the number of problems does not evenly divide the number of problems per page, but if it does then the modulus returns 0. In that case it should also use the number of problems per page.
1 parent d712732 commit d52865d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/ContentGenerator/GatewayQuiz.html.ep

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,9 @@
459459
% end
460460
% for my $i (1 .. $numPages) {
461461
% content_for 'gw-navigation-pages' => begin
462-
<td colspan="<%= $i == $numPages ? (@$problem_numbers % $numProbPerPage) : $numProbPerPage %>"
462+
<td colspan="<%= $i == $numPages && (@$problem_numbers % $numProbPerPage)
463+
? (@$problem_numbers % $numProbPerPage)
464+
: $numProbPerPage %>"
463465
class="<%= $i == $pageNumber ? 'page active' : 'page' %>">
464466
% if ($i == $pageNumber) {
465467
<%= $i =%>

0 commit comments

Comments
 (0)