|
68 | 68 | % # If the set or problem is invalid, then show that information and exit.
|
69 | 69 | % if ($c->{invalidSet}) {
|
70 | 70 | <div class="alert alert-danger mb-2">
|
71 |
| - <div class="mb-2"> |
72 |
| - % if ($c->{invalidVersionCreation}) { |
73 |
| - <%= maketext( |
74 |
| - 'The selected test ([_1]) is not a valid test for [_2] (acted as by [_3]).', |
75 |
| - $setID, $effectiveUserID, $userID |
76 |
| - ) =%> |
77 |
| - % } else { |
78 |
| - <%= maketext( |
79 |
| - 'The selected test ([_1]) is not a valid test for [_2].', |
80 |
| - $setID, $effectiveUserID |
81 |
| - ) =%> |
82 |
| - % } |
83 |
| - </div> |
| 71 | + % if (!$c->{confirmSubmitForStudent} || $c->{invalidVersionCreation}) { |
| 72 | + <div class="mb-2"> |
| 73 | + % if ($c->{invalidVersionCreation}) { |
| 74 | + <%= maketext( |
| 75 | + 'The selected test ([_1]) is not a valid test for [_2] (acted as by [_3]).', |
| 76 | + $setID, $effectiveUserID, $userID |
| 77 | + ) =%> |
| 78 | + % } else { |
| 79 | + <%= maketext( |
| 80 | + 'The selected test ([_1]) is not a valid test for [_2].', |
| 81 | + $setID, $effectiveUserID |
| 82 | + ) =%> |
| 83 | + % } |
| 84 | + </div> |
| 85 | + % } |
84 | 86 | <div><%= $c->{invalidSet} %></div>
|
85 |
| - % if ($c->{invalidVersionCreation} && $c->{invalidVersionCreation} == 1) { |
| 87 | + % if ($c->{confirmSubmitForStudent}) { |
86 | 88 | <div class="mt-3">
|
87 |
| - <%= link_to maketext('Create New Test Version') => $c->systemLink( |
| 89 | + <%= link_to $c->{invalidVersionCreation} |
| 90 | + ? maketext('Create New Test Version') : maketext('View Test Version') => $c->systemLink( |
88 | 91 | url_for,
|
89 |
| - params => { effectiveUser => $effectiveUserID, user => $userID, createnew_ok => 1 } |
| 92 | + params => { effectiveUser => $effectiveUserID, user => $userID, submit_for_student_ok => 1 } |
90 | 93 | ),
|
91 | 94 | class => 'btn btn-primary'
|
92 | 95 | =%>
|
93 | 96 | <%= link_to maketext('Cancel') => $c->systemLink(
|
94 |
| - url_for('problem_list', setID => $setID), |
| 97 | + url_for('problem_list', setID => $setID =~ s/,v\d+$//r), |
95 | 98 | params => { effectiveUser => $effectiveUserID, user => $userID }
|
96 | 99 | ),
|
97 | 100 | class => 'btn btn-primary'
|
|
410 | 413 | <%= hidden_field newPage => '' =%>
|
411 | 414 | <%= hidden_field currentPage => $pageNumber =%>
|
412 | 415 | % }
|
| 416 | + % # Keep track that a user has confirmed it is okay to submit for a student. |
| 417 | + % if (param('submit_for_student_ok')) { |
| 418 | + <%= hidden_field submit_for_student_ok => 1 =%> |
| 419 | + % } |
413 | 420 | %
|
414 | 421 | % # Set up links between problems and, for multi-page tests, pages.
|
415 | 422 | % for my $i (0 .. $#$pg_results) {
|
|
0 commit comments