diff --git a/lib/WeBWorK/ContentGenerator/ProblemSet.pm b/lib/WeBWorK/ContentGenerator/ProblemSet.pm index 5f025e357c..c77ce3ef77 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->{hide_start_new_test} = $userID ne $eUserID + $c->{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 7c91f5ebf3..1bcebd81d5 100644 --- a/templates/ContentGenerator/ProblemSet/version_list.html.ep +++ b/templates/ContentGenerator/ProblemSet/version_list.html.ep @@ -126,13 +126,20 @@
<%= maketext('This test requires a proctor password to start.') %>
% } % - % # Hide "Start New Test" button when acting as another use who doesn't have permissions to start test. - % unless ($c->{hide_start_new_test}) { -
- <%= link_to maketext('Start New Test') => $c->systemLink(url_for($routeName, setID => $set->set_id)), - class => 'btn btn-primary' =%> -
+
+ % # Disable "Start New Test" button when acting as another user who doesn't have permissions to start tests. + % if ($c->{disable_start_new_test}) { + + + + % } else { + <%= link_to maketext('Start New Test') => $c->systemLink(url_for($routeName, setID => $set->set_id)), + class => "btn btn-primary" =%> % } +
% } else { % # Message about if/when next version will be available. % my $msg = maketext('No more tests available.');