diff --git a/lib/WeBWorK/ContentGenerator/CourseAdmin.pm b/lib/WeBWorK/ContentGenerator/CourseAdmin.pm index 9761e1eb90..ff67697c4b 100644 --- a/lib/WeBWorK/ContentGenerator/CourseAdmin.pm +++ b/lib/WeBWorK/ContentGenerator/CourseAdmin.pm @@ -294,8 +294,6 @@ sub do_add_course ($c) { my $ce2 = WeBWorK::CourseEnvironment->new({ courseName => $add_courseID }); - my %courseOptions; - my @users; # copy users from current (admin) course if desired @@ -392,15 +390,7 @@ sub do_add_course ($c) { my $output = $c->c; - eval { - addCourse( - courseID => $add_courseID, - ce => $ce2, - courseOptions => \%courseOptions, - users => \@users, - %optional_arguments, - ); - }; + eval { addCourse(courseID => $add_courseID, ce => $ce2, users => \@users, %optional_arguments,); }; if ($@) { my $error = $@; push( diff --git a/lib/WeBWorK/Utils/CourseManagement.pm b/lib/WeBWorK/Utils/CourseManagement.pm index 71808f3ded..3d002d86d6 100644 --- a/lib/WeBWorK/Utils/CourseManagement.pm +++ b/lib/WeBWorK/Utils/CourseManagement.pm @@ -126,10 +126,9 @@ sub listArchivedCourses { %options must contain: - courseID => course ID for the new course, - ce => a course environment for the new course, - courseOptions => hash ref explained below - users => array ref explained below + courseID => course ID for the new course, + ce => a course environment for the new course, + users => array ref explained below %options may contain: @@ -150,8 +149,6 @@ Create a new course with ID $courseID. $ce is a WeBWorK::CourseEnvironment object that describes the new course's environment. -$courseOptions is a reference to a hash containing the following options: - $users is a list of arrayrefs, each containing a User, Password, and PermissionLevel record for a single user: @@ -183,11 +180,10 @@ sub addCourse { debug("$key : $value"); } - my $courseID = $options{courseID}; - my $sourceCourse = $options{copyFrom} // ''; - my $ce = $options{ce}; - my %courseOptions = %{ $options{courseOptions} // {} }; - my @users = exists $options{users} ? @{ $options{users} } : (); + my $courseID = $options{courseID}; + my $sourceCourse = $options{copyFrom} // ''; + my $ce = $options{ce}; + my @users = exists $options{users} ? @{ $options{users} } : (); debug \@users; @@ -428,7 +424,7 @@ sub addCourse { my $courseEnvFile = $ce->{courseFiles}{environment}; open my $fh, ">:utf8", $courseEnvFile or die "failed to open $courseEnvFile for writing.\n"; - writeCourseConf($fh, $ce, %courseOptions); + writeCourseConf($fh); close $fh; } @@ -1176,18 +1172,17 @@ sub protectQString { return $string; } -=item writeCourseConf($fh, $ce, %options) +=item writeCourseConf($fh) -Writes a course.conf file to $fh, a file handle, using defaults from the course -environment object $ce and overrides from %options. %options can contain any of -the pairs accepted in %courseOptions by addCourse(), above. +Writes an essentially empty course.conf file to $fh, a file handle. System +administrators can use this file to override global settings for a course. =back =cut sub writeCourseConf { - my ($fh, $ce, %options) = @_; + my ($fh) = @_; print $fh <<'EOF'; #!perl