From c97870ec91439226c09f9514858ac4ac8104db81 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 6 Dec 2023 21:47:55 -0600 Subject: [PATCH] Remove the "Show solutions" checkbox for tests (a.k.a. gateway guizzes) 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. --- lib/WeBWorK/ContentGenerator/GatewayQuiz.pm | 6 ++---- .../ContentGenerator/GatewayQuiz.html.ep | 20 ++++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm index 6e870090d9..9a07e3e95a 100644 --- a/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm +++ b/lib/WeBWorK/ContentGenerator/GatewayQuiz.pm @@ -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}, diff --git a/templates/ContentGenerator/GatewayQuiz.html.ep b/templates/ContentGenerator/GatewayQuiz.html.ep index 447be9cf34..0869515197 100644 --- a/templates/ContentGenerator/GatewayQuiz.html.ep +++ b/templates/ContentGenerator/GatewayQuiz.html.ep @@ -564,6 +564,17 @@
<%== maketext('Note: [_1]', tag('i', $pg->{result}{msg})) %>
% } % + % if ($pg->{flags}{solutionExists} && $authz->hasPermissions($userID, 'always_show_solution')) { +

+ <%= maketext('Note') %>: + + <%= maketext('The solution shown is an instructor preview and ' + . 'will only be shown to students when answers are available.' + ) =%> + +

+ % } + %
<%= link_to maketext('preview answers') => '#', class => 'gateway-preview-btn btn btn-secondary', @@ -616,15 +627,6 @@
% } - % if ($c->{can}{showSolutions}) { -
- -
- % } % if ($c->{can}{showProblemGrader}) {