From 864cd8fdb743defca8a11f5bbf15116f567c7281 Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Sun, 10 Nov 2024 17:32:08 -0700 Subject: [PATCH] CourseAdmin add new course tweaks. Use the course_admin_id instead of 'admin' when talking about the admin course name on this page and in its help. Mention setting $permissionLevels{login}='admin' in course.conf in the help as a way to control access to the admin course. Use `overflow-auto` and `max-height` in the select which admin users to add to the new course div. --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm | 6 +++--- .../CourseAdmin/add_course_form.html.ep | 7 ++++--- templates/HelpFiles/AdminAddCourse.html.ep | 13 ++++++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/CourseAdmin.pm b/lib/WeBWorK/ContentGenerator/CourseAdmin.pm index 3a11629536..cde647bc25 100644 --- a/lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ b/lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -310,14 +310,14 @@ sub do_add_course ($c) { for my $userID ($c->param('add-admin-users')) { unless ($db->existsUser($userID)) { $c->addbadmessage($c->maketext( - 'User "[_1]" will not be copied from [_2] course as it does not exist.', $userID, + 'User "[_1]" will not be copied from the [_2] course as it does not exist.', $userID, $ce->{admin_course_id} )); next; } if ($userID eq $add_initial_userID) { $c->addbadmessage($c->maketext( - 'User "[_1]" will not be copied from [_2] course as it is the initial instructor.', $userID, + 'User "[_1]" will not be copied from the [_2] course as it is the initial instructor.', $userID, $ce->{admin_course_id} )); next; @@ -355,7 +355,7 @@ sub do_add_course ($c) { if ($add_initial_user) { if ($db->existsUser($add_initial_userID)) { $c->addbadmessage($c->maketext( - 'User "[_1]" will not be added to [_2] course as it already exists.', $add_initial_userID, + 'User "[_1]" will not be added to the [_2] course as it already exists.', $add_initial_userID, $ce->{admin_course_id} )); } else { diff --git a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep index 3f43ef36bf..be5831547c 100644 --- a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep +++ b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep @@ -39,9 +39,10 @@
<%= maketext( - 'Select admin course users to add to the new course (as the stated permission) below.') =%> + 'Select [_1] course users to add to the new course (as the stated permission) below.', + $ce->{admin_course_id}) =%>
-
+
% for my $user ($db->listUsers) { % my $val = $db->getPermissionLevel($user)->permission; % my $role = maketext((grep { $ce->{userRoles}{$_} eq $val } keys %{ $ce->{userRoles} })[0]); @@ -120,7 +121,7 @@
diff --git a/templates/HelpFiles/AdminAddCourse.html.ep b/templates/HelpFiles/AdminAddCourse.html.ep index 1c4940b51a..c01fc1e330 100644 --- a/templates/HelpFiles/AdminAddCourse.html.ep +++ b/templates/HelpFiles/AdminAddCourse.html.ep @@ -22,15 +22,18 @@ . 'on the course home page.') =%>

- <%= maketext('Select which users in the admin course to copy over to the newly created course. The WeBWorK ' + <%= maketext('Select which users in the [_1] course to copy over to the newly created course. The WeBWorK ' . 'administrators need to be added to the course in order for them to access the course. Unselecting ' - . 'them will make it so WeBWorK administrators cannot directly login to the course.') =%> + . 'them will make it so WeBWorK administrators cannot directly login to the course.', + $ce->{admin_course_id}) =%>

<%= maketext('Enter the details of a new course instructor to be added when the course is created. The only ' - . 'required field is the user ID of the this user. Optionally, you can add this user to the administration ' - . 'course, so you can copy this user when creating future courses, or manage and email course instructors. ' - . 'The instructor will be added as a "Dropped" user so they cannot login to the administration course.') =%> + . 'required field is the user ID of the this user. Optionally, you can add this user to the [_1] course, ' + . 'so you can copy this user when creating future courses, or manage and email course instructors. Note, ' + . 'by default these new users will be "Dropped" and unable to login to the [_1] course. You can change ' + . 'this on the "Accounts Manager" page. Additionally you can control access to the [_1] course by setting ' + . q/$permissionLevels{login}='admin' in course.conf./, $ce->{admin_course_id}) =%>

<%= maketext('You may choose a course to copy components from. Select the course and which components to copy. '