Skip to content

Commit

Permalink
CourseAdmin add new course tweaks.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
somiaj committed Nov 11, 2024
1 parent ce2d50a commit faa7fe0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 0 additions & 2 deletions lib/WeBWorK/ContentGenerator/CourseAdmin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions lib/WeBWorK/ContentGenerator/Instructor/SendMail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
<div class="mb-3">
<div class="mb-1">
<%= 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}) =%>
</div>
<div class="col-lg-4 col-md-5 col-sm-6 overflow-scroll border rounded px-2" style="height: 100px;">
% for my $user ($db->listUsers) {
Expand Down Expand Up @@ -120,7 +121,7 @@
<div class="form-check mb-3">
<label class="form-check-label">
<%= check_box 'add_initial_user' => 1, class => 'form-check-input' =%>
<%= maketext('Add new user to admin course.') =%>
<%= maketext('Also add this user to the [_1] course.', $ce->{admin_course_id}) =%>
</label>
</div>
<div class="mb-1">
Expand Down
13 changes: 8 additions & 5 deletions templates/HelpFiles/AdminAddCourse.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
. 'on the course home page.') =%>
</p>
<p>
<%= 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}) =%>
</p>
<p>
<%= 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}) =%>
</p>
<p class="mb-0">
<%= maketext('You may choose a course to copy components from. Select the course and which components to copy. '
Expand Down

0 comments on commit faa7fe0

Please sign in to comment.