|
108 | 108 | % last; |
109 | 109 | % } |
110 | 110 | % |
111 | | -% # If there were translation errors, then show those and exit. |
112 | | -% if (@{ $c->{errors} }) { |
113 | | - % my $errorNum = 1; |
114 | | - % my ($message, $context) = (c, c); |
115 | | - % for (@{ $c->{errors} }) { |
116 | | - % push(@$message, "$errorNum. ") if (@{ $c->{errors} } > 1); |
117 | | - % push(@$message, $_->{message}, tag('br')); |
118 | | - % |
119 | | - % my $line = begin |
120 | | - <p><%= (@{ $c->{errors} } > 1 ? "$errorNum." : '') %><%== $_->{context} %></p> |
121 | | - <div class="gwDivider"></div> |
122 | | - % end |
123 | | - % push @$context, $line->(); |
124 | | - % } |
125 | | - <%= include 'ContentGenerator/Base/error_output', error => $message->join(''), details => $context->join('') =%> |
126 | | - % |
127 | | - % last; |
128 | | -% } |
129 | | -% |
130 | 111 | % my $setID = $c->{set}->set_id; |
131 | 112 | % my $setVersionID = $c->{set}->version_id; |
132 | 113 | % my $numProbPerPage = $c->{set}->problems_per_page; |
|
405 | 386 | % # Problems can be shown, so output the main form and the problems. |
406 | 387 | % my $startTime = param('startTime') || time; |
407 | 388 | % |
408 | | - <%= form_for $action, name => 'gwquiz', method => 'POST', class => 'problem-main-form', begin =%> |
| 389 | + <%= form_for $action, name => 'gwquiz', method => 'POST', class => 'problem-main-form mt-0', begin =%> |
409 | 390 | <%= $c->hidden_authen_fields =%> |
410 | 391 | % |
411 | 392 | % # Hacks to use a javascript link to trigger previews and jump to subsequent pages of a multipage test. |
|
603 | 584 | </div> |
604 | 585 | % } |
605 | 586 | % |
606 | | - <div class="problem-content col-lg-10" <%== get_problem_lang_and_dir( |
607 | | - $pg->{flags}, $ce->{perProblemLangAndDirSettingMode}, $ce->{language} |
608 | | - ) %>> |
609 | | - <%== $pg->{body_text} =%> |
610 | | - </div> |
| 587 | + % # If there were translation errors, then show those instead of the problem. |
| 588 | + % if ($pg->{flags}{error_flag}) { |
| 589 | + % stash->{briefErrorOutput} = 1; |
| 590 | + <%= include 'ContentGenerator/Base/error_output', |
| 591 | + error => $pg->{errors}, |
| 592 | + details => $pg->{body_text} =%> |
| 593 | + % |
| 594 | + % delete stash->{briefErrorOutput}; |
| 595 | + % } else { |
| 596 | + <div class="problem-content col-lg-10" <%== get_problem_lang_and_dir( |
| 597 | + $pg->{flags}, $ce->{perProblemLangAndDirSettingMode}, $ce->{language} |
| 598 | + ) %>> |
| 599 | + <%== $pg->{body_text} =%> |
| 600 | + </div> |
| 601 | + % } |
611 | 602 | % if ($pg->{result}{msg}) { |
612 | 603 | <div class="mb-2"><b><%== maketext('Note: [_1]', tag('i', $pg->{result}{msg})) %></b></div> |
613 | 604 | % } |
|
651 | 642 | % } |
652 | 643 | % |
653 | 644 | % # Initialize the problem graders for the problem. |
654 | | - % if ($c->{will}{showProblemGrader}) { |
| 645 | + % if ($c->{will}{showProblemGrader} && !$pg->{flags}{error_flag}) { |
655 | 646 | <%= WeBWorK::HTML::SingleProblemGrader->new($c, $pg, $problems->[ $probOrder->[$i] ]) |
656 | 647 | ->insertGrader =%> |
657 | 648 | % } |
|
785 | 776 | % # If achievements enabled, check to see if there are new ones and output them. Use the first |
786 | 777 | % # problem to seed the data. However, all of the problems will be provided to the achievement evaluator. |
787 | 778 | % if ($ce->{achievementsEnabled} && $c->{will}{recordAnswers} && $c->{submitAnswers} && $setID ne 'Undefined_Set') { |
788 | | - <%= checkForAchievements($problems->[0], $pg_results->[0], $c, setVersion => $setVersionID) =%> |
| 779 | + <%= checkForAchievements($problems->[0], $c, setVersion => $setVersionID) =%> |
789 | 780 | % } |
0 commit comments