From 0e3664031ea9def785524b5b9112de397801610c Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Wed, 13 Nov 2024 08:58:25 -0700 Subject: [PATCH] Stash disable_start_new_test variable. --- lib/WeBWorK/ContentGenerator/ProblemSet.pm | 2 +- templates/ContentGenerator/ProblemSet/version_list.html.ep | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/ProblemSet.pm b/lib/WeBWorK/ContentGenerator/ProblemSet.pm index c77ce3ef77..1507ee8535 100644 --- a/lib/WeBWorK/ContentGenerator/ProblemSet.pm +++ b/lib/WeBWorK/ContentGenerator/ProblemSet.pm @@ -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')); diff --git a/templates/ContentGenerator/ProblemSet/version_list.html.ep b/templates/ContentGenerator/ProblemSet/version_list.html.ep index 2b023dccb2..040cbad7b2 100644 --- a/templates/ContentGenerator/ProblemSet/version_list.html.ep +++ b/templates/ContentGenerator/ProblemSet/version_list.html.ep @@ -128,7 +128,7 @@ %
% # 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) {