From faa7fe0ed1673e7a8cd0c18665a2130d6b91b2c5 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. Revert the change of dropping users added to the admin course by default and removing dropped users from the email page. Let the admin decide if and how they want to manage users in this course, and mention in the help file to set `$permissionLevels{login}='admin'` in `course.conf` to keep non admin users from logging into the admin course. --- lib/WeBWorK/ContentGenerator/CourseAdmin.pm | 2 -- lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm | 5 ++--- .../CourseAdmin/add_course_form.html.ep | 5 +++-- templates/HelpFiles/AdminAddCourse.html.ep | 13 ++++++++----- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/CourseAdmin.pm b/lib/WeBWorK/ContentGenerator/CourseAdmin.pm index 3a11629536..3bfade2a7f 100644 --- a/lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ b/lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -359,11 +359,9 @@ sub do_add_course ($c) { $ce->{admin_course_id} )); } else { - $User->status('D'); # By default don't allow user to login. $db->addUser($User); $db->addPassword($Password); $db->addPermissionLevel($PermissionLevel); - $User->status('O'); } } } diff --git a/lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm b/lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm index 1b0c86a2d1..723e922758 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm @@ -113,9 +113,8 @@ sub initialize ($c) { 'user_id' ); - # Filter out users who don't get included in email unless in the admin course. - @Users = grep { $ce->status_abbrev_has_behavior($_->status, "include_in_email") } @Users - unless $ce->{courseName} eq $ce->{admin_course_id}; + # Filter out users who don't get included in email + @Users = grep { $ce->status_abbrev_has_behavior($_->status, "include_in_email") } @Users; # Cache the user records for later use. $c->{ra_user_records} = \@Users; diff --git a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep index 3f43ef36bf..ff2d738b07 100644 --- a/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep +++ b/templates/ContentGenerator/CourseAdmin/add_course_form.html.ep @@ -39,7 +39,8 @@
<%= 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) { @@ -120,7 +121,7 @@
diff --git a/templates/HelpFiles/AdminAddCourse.html.ep b/templates/HelpFiles/AdminAddCourse.html.ep index 1c4940b51a..d9cdf04ec6 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 able to login to the [_1] course (which they can use to setup their ' + . q/password or OTP secret to be copied to new courses). If you don't want to allow non administrators in / + . q/the [_1] course, set $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. '