Commit 6796ccf
committed
Add previous and next buttons to tests.
The buttons go to the next or previous page. If there is only one
problem per page, then the buttons are "Previous Problem" and "Next
Problem" buttons. Otherwise they are "Previous Page" and "Next Page"
buttons. These buttons are shown below the page/problem navigation
links and like those links are shown both at the top and bottom of the
page. This means that these buttons are above the "Grade Test" button
at the bottom of the page, making it much clearer to students that there
are more problems than those shown on the page.
Note these buttons are not shown if all problems are on one page.
This was requested in issue #2814.
Also fix a couple of HTML validation issues that I observed.
First, the "preview answer" buttons had a `data_page_number` attribute.
The underscores are not the valid format for data attributes. They
should be hyphens. I.e., kebab case, not snake case. This was caused by
using the incorrect format for the data attribute argument to the
`link_to` method. This was my fault and was done when I initially
converted to Mojolicious.
The other issue only occurs when the number of problems in the test is
not evenly divisible by the number of problems per page. This resulted
in the wrong number of columns in the problem/page navigation links
table for the `colgroup` definition of the last column.1 parent df5b59c commit 6796ccf
1 file changed
+23
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
451 | | - | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
| 454 | + | |
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
460 | 461 | | |
461 | | - | |
| 462 | + | |
462 | 463 | | |
463 | 464 | | |
464 | 465 | | |
| |||
485 | 486 | | |
486 | 487 | | |
487 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
488 | 507 | | |
489 | 508 | | |
490 | 509 | | |
| |||
508 | 527 | | |
509 | 528 | | |
510 | 529 | | |
| 530 | + | |
511 | 531 | | |
512 | 532 | | |
513 | 533 | | |
| |||
621 | 641 | | |
622 | 642 | | |
623 | 643 | | |
624 | | - | |
| 644 | + | |
625 | 645 | | |
626 | 646 | | |
627 | 647 | | |
| |||
0 commit comments