Skip to content

Commit

Permalink
Remove the "Show solutions" checkbox for tests (a.k.a. gateway guizzes)
Browse files Browse the repository at this point in the history
Solutions are just shown when they can be.  This is the same as this is
for homework problems.  There is just no reason for the checkbox.
  • Loading branch information
drgrice1 committed Dec 7, 2023
1 parent 7d0f568 commit c97870e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
6 changes: 2 additions & 4 deletions lib/WeBWorK/ContentGenerator/GatewayQuiz.pm
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,8 @@ async sub pre_header_initialize ($c) {
showProblemGrader => $c->param('showProblemGrader')
|| 0,
# Hints are not yet implemented in gateway quzzes.
showHints => 0,
# showProblemGrader implies showSolutions. Another convenience for grading.
showSolutions => $c->param('showProblemGrader')
|| ($c->param('showSolutions') && ($c->{submitAnswers} || $c->{checkAnswers})),
showHints => 0,
showSolutions => 1,
recordAnswers => $c->{submitAnswers} && !$authz->hasPermissions($userID, 'avoid_recording_answers'),
# we also want to check answers if we were checking answers and are switching between pages
checkAnswers => $c->{checkAnswers},
Expand Down
20 changes: 11 additions & 9 deletions templates/ContentGenerator/GatewayQuiz.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,17 @@
<div class="mb-2"><b><%== maketext('Note: [_1]', tag('i', $pg->{result}{msg})) %></b></div>
% }
%
% if ($pg->{flags}{solutionExists} && $authz->hasPermissions($userID, 'always_show_solution')) {
<p>
<b><%= maketext('Note') %>:</b>
<i>
<%= maketext('The solution shown is an instructor preview and '
. 'will only be shown to students when answers are available.'
) =%>
</i>
</p>
% }
%
<div class="text-end mb-2">
<%= link_to maketext('preview answers') => '#',
class => 'gateway-preview-btn btn btn-secondary',
Expand Down Expand Up @@ -616,15 +627,6 @@
</label>
</div>
% }
% if ($c->{can}{showSolutions}) {
<div class="form-check">
<label class="form-check-label">
<input name="showSolutions" type="checkbox" class="form-check-input"
<%= $c->{will}{showSolutions} || $c->{want}{showProblemGrader} ? 'checked' : '' %>>
<%= maketext('Show Solutions') %>
</label>
</div>
% }
% if ($c->{can}{showProblemGrader}) {
<div class="form-check">
<label class="form-check-label">
Expand Down

0 comments on commit c97870e

Please sign in to comment.