Skip to content

Commit

Permalink
Experimentation
Browse files Browse the repository at this point in the history
  • Loading branch information
drgrice1 committed Dec 7, 2023
1 parent c97870e commit 3aa82b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
31 changes: 16 additions & 15 deletions lib/WeBWorK/ContentGenerator/Problem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,13 @@ async sub pre_header_initialize ($c) {

# What does the user want to do?
my %want = (
showOldAnswers => $user->showOldAnswers ne '' ? $user->showOldAnswers : $ce->{pg}{options}{showOldAnswers},
# showProblemGrader implies showCorrectAnswers. This is a convenience for grading.
showCorrectAnswers => $c->param('showCorrectAnswers') || $c->param('showProblemGrader') || 0,
showProblemGrader => $c->param('showProblemGrader') || 0,
showAnsGroupInfo => $c->param('showAnsGroupInfo') || $ce->{pg}{options}{showAnsGroupInfo},
showAnsHashInfo => $c->param('showAnsHashInfo') || $ce->{pg}{options}{showAnsHashInfo},
showPGInfo => $c->param('showPGInfo') || $ce->{pg}{options}{showPGInfo},
showResourceInfo => $c->param('showResourceInfo') || $ce->{pg}{options}{showResourceInfo},
showOldAnswers => $user->showOldAnswers ne '' ? $user->showOldAnswers : $ce->{pg}{options}{showOldAnswers},
showCorrectAnswers => 1,
showProblemGrader => $c->param('showProblemGrader') || 0,
showAnsGroupInfo => $c->param('showAnsGroupInfo') || $ce->{pg}{options}{showAnsGroupInfo},
showAnsHashInfo => $c->param('showAnsHashInfo') || $ce->{pg}{options}{showAnsHashInfo},
showPGInfo => $c->param('showPGInfo') || $ce->{pg}{options}{showPGInfo},
showResourceInfo => $c->param('showResourceInfo') || $ce->{pg}{options}{showResourceInfo},
showHints => 1,
showSolutions => 1,
useMathView => $user->useMathView ne '' ? $user->useMathView : $ce->{pg}{options}{useMathView},
Expand Down Expand Up @@ -602,13 +601,15 @@ async sub pre_header_initialize ($c) {
useMathView => $will{useMathView},
forceScaffoldsOpen => 0,
isInstructor => $authz->hasPermissions($userID, 'view_answers'),
showFeedback => $c->{submitAnswers} || $c->{previewAnswers},
showAttemptAnswers => $ce->{pg}{options}{showEvaluatedAnswers},
showAttemptPreviews => 1,
showAttemptResults => $c->{submitAnswers},
forceShowAttemptResults => $will{checkAnswers} || $will{showProblemGrader},
showMessages => 1,
showCorrectAnswers => $c->{submitAnswers} ? ($c->{showCorrectOnRandomize} // $will{showCorrectAnswers})
showFeedback => $c->{submitAnswers}
|| $c->{previewAnswers}
|| after($c->{set}->answer_date, $c->submitTime),
showAttemptAnswers => $ce->{pg}{options}{showEvaluatedAnswers},
showAttemptPreviews => 1,
showAttemptResults => $c->{submitAnswers} || after($c->{set}->answer_date, $c->submitTime),
forceShowAttemptResults => $will{checkAnswers} || $will{showProblemGrader},
showMessages => 1,
showCorrectAnswers => $c->{submitAnswers} ? ($c->{showCorrectOnRandomize} // $will{showCorrectAnswers})
: $will{checkAnswers} || $will{showProblemGrader} ? $will{showCorrectAnswers}
: 0,
debuggingOptions => getTranslatorDebuggingOptions($authz, $userID)
Expand Down
10 changes: 0 additions & 10 deletions templates/ContentGenerator/Problem/checkboxes.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@
<span class="me-2"><%= maketext('Show:') %></span>
% }
%
% if ($can{showCorrectAnswers}) {
<div class="form-check form-check-inline">
<label class="form-check-label">
<%= check_box showCorrectAnswers => 1, id => 'showCorrectAnswers_id', class => 'form-check-input',
$will{showCorrectAnswers} ? (checked => undef) : () =%>
<%= maketext('Correct Answers') =%>
</label>
</div>
% }
%
% if ($can{showProblemGrader} && !$will{showMeAnother}) {
<div class="form-check form-check-inline">
<label class="form-check-label">
Expand Down

0 comments on commit 3aa82b5

Please sign in to comment.