Skip to content

Commit

Permalink
Stash disable_start_new_test variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
somiaj committed Nov 24, 2024
1 parent 0fd85ba commit a694743
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/WeBWorK/ContentGenerator/ProblemSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async sub initialize ($c) {
my $eUserID = $c->param('effectiveUser');

# Don't show "Start New Test" button when acting as another user, unless user has permissions to do so.
$c->{disable_start_new_test} = $userID ne $eUserID
$c->stash->{disable_start_new_test} = $userID ne $eUserID
&& !($authz->hasPermissions($userID, 'record_answers_when_acting_as_student')
|| $authz->hasPermissions($userID, 'create_new_set_version_when_acting_as_student'));

Expand Down
2 changes: 1 addition & 1 deletion templates/ContentGenerator/ProblemSet/version_list.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
%
<div class="mb-3">
% # Disable "Start New Test" button when acting as another user who doesn't have permissions to start tests.
% if ($c->{disable_start_new_test}) {
% if ($disable_start_new_test) {
<span class="d-inline-block set-id-tooltip" tabindex="0" data-bs-toggle="tooltip" data-bs-placement="top"
data-bs-title="<%=maketext(
'You are acting as another user and do not have permission to start a new test for other users.'
Expand Down

0 comments on commit a694743

Please sign in to comment.