From: Arnie P. v. a. <we...@ma...> - 2009-08-12 17:34:45
|
Log Message: ----------- Patch in the changes Mike made to head which replace %WeBWorK::SeedCE with get_SeedCE($ce) The only difference between this patched verssion and head is that the line use WeBWorK::Utils::DBUpgrage is commented out in this patched version Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/lib/WeBWorK/Utils: CourseManagement.pm Revision Data ------------- Index: CourseManagement.pm =================================================================== RCS file: /webwork/cvs/system/webwork2/lib/WeBWorK/Utils/CourseManagement.pm,v retrieving revision 1.39.2.1.2.3 retrieving revision 1.39.2.1.2.4 diff -Llib/WeBWorK/Utils/CourseManagement.pm -Llib/WeBWorK/Utils/CourseManagement.pm -u -r1.39.2.1.2.3 -r1.39.2.1.2.4 --- lib/WeBWorK/Utils/CourseManagement.pm +++ lib/WeBWorK/Utils/CourseManagement.pm @@ -256,8 +256,8 @@ if (exists $options{templatesFrom}) { my $sourceCourse = $options{templatesFrom}; my $sourceCE = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, - courseName => $sourceCourse, + get_SeedCE($ce), + courseName => $sourceCourse, # override courseName }); my $sourceDir = $sourceCE->{courseDirs}->{templates}; @@ -714,7 +714,7 @@ ##### step 3: read the course environment for this course ##### my $ce2 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $currCourseID, }); @@ -784,7 +784,7 @@ # course environment for before the course is moved my $ce2 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $courseID, }); @@ -803,7 +803,7 @@ # course environment for after the course is moved my $ce3 = new WeBWorK::CourseEnvironment({ - %WeBWorK::SeedCE, + get_SeedCE($ce), courseName => $tmpCourseID, }); @@ -1168,6 +1168,14 @@ } - - +sub get_SeedCE { + my $ce = shift; + warn "get_SeedCE needs current Course environment to create seed CE" unless ref($ce) ; + my %seedCE=(); + my @conf_items = qw( webwork_dir webwork_url pg_dir courseName) ; + foreach my $item (@conf_items) { + $seedCE{$item} = $ce->{$item}; + } + return( %seedCE); +} 1; |