--- loncom/interface/loncreatecourse.pm 2004/09/09 19:24:01 1.67 +++ loncom/interface/loncreatecourse.pm 2004/12/07 01:31:17 1.73 @@ -1,7 +1,7 @@ # The LearningOnline Network # Create a course # -# $Id: loncreatecourse.pm,v 1.67 2004/09/09 19:24:01 albertel Exp $ +# $Id: loncreatecourse.pm,v 1.73 2004/12/07 01:31:17 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,7 +38,6 @@ use Apache::londocs; use Apache::lonlocal; use Apache::londropadd; use lib '/home/httpd/lib/perl'; -use localenroll; # ================================================ Get course directory listing @@ -139,6 +138,9 @@ sub copydb { my %newcrsdata= &Apache::lonnet::coursedescription($newcrsid); my %data=&Apache::lonnet::dump ($which,$origcrsdata{'domain'},$origcrsdata{'num'}); + foreach my $key (keys(%data)) { + if ($key=~/^internal./) { delete($data{$key}); } + } return &Apache::lonnet::put ($which,\%data,$newcrsdata{'domain'},$newcrsdata{'num'}); } @@ -204,7 +206,9 @@ sub copyresourcedb { sub copyuserfiles { my ($origcrsid,$newcrsid)=@_; foreach (&crsdirlist($origcrsid,'userfiles')) { - ©file($origcrsid,$newcrsid,$_); + if ($_ !~m|^scantron_|) { + ©file($origcrsid,$newcrsid,$_); + } } } # ========================================================== Copy all userfiles @@ -252,7 +256,7 @@ sub print_course_creation_page { ($ENV{'request.role.domain'},'clonedomain'). &Apache::loncommon::selectcourse_link ('ccrs','clonecourse','clonedomain'); - my $coursebrowserjs=&Apache::loncommon::coursebrowser_javascript(); + my $coursebrowserjs=&Apache::loncommon::coursebrowser_javascript($ENV{'request.role.domain'}); my $starttime = time; my $endtime = time+(6*30*24*60*60); # 6 months from now, approx my $enroll_table = &Apache::londropadd::date_setting_table($starttime,$endtime,'create_enrolldates'); @@ -358,28 +362,41 @@ $helplink

$lt{'cinf'}

-$lt{'ctit'}: - +

-$lt{'chsr'}:$course_home -

-$lt{'cidn'} ($lt{'opt'}) - + +

+

$lt{'iinf'}

$lt{'stat'}

-$lt{'ccod'} -
+ +
($lt{'toin'})

-$lt{'snid'} -
+ +
($lt{'csli'})

-$lt{'crcs'} -
+ +
($lt{'cscs'})

$lt{'crco'}

@@ -387,61 +404,92 @@ $lt{'stat'} $lt{'cncr'}$lt{'cecr'}

-$lt{'map'}: - + $lt{'smap'}

-$lt{'sacr'}
+ +
($lt{'ocik'}): - -

-

+ +

$lt{'fres'}
($lt{'stco'}): -$lt{'blnk'} +   -$lt{'sllb'} +   -$lt{'navi'} +

-$lt{'cid'}: +
-$lt{'dmn'}: -$cloneform
 
+ +

$lt{'asov'}.

$lt{'assp'}

-$lt{'oaas'}: - +

$lt{'mssg'}

-$lt{'scpf'}: - +
-$lt{'scfc'}: - +

$lt{'cmmn'}

-$lt{'dsrd'}: -
-$lt{'dsuc'}: - + +
+

$lt{'acco'}

-$lt{'snak'}: -
-$lt{'kaut'}: - + +
+

$lt{'rshm'}

-$lt{'rshm'}: - +

$lt{'aens'}

@@ -449,10 +497,13 @@ $lt{'aesc'}

$lt{'aadd'} -$lt{'yes'} $lt{'no'} + +

$lt{'audr'} -$lt{'yes'} $lt{'no'} + +

$lt{'dacu'} $enroll_table @@ -471,24 +522,40 @@ $locform

$lt{'nech'}
$lt{'nccl'}
-$lt{'yes'} $lt{'no'} -

-$lt{'irsp'} $lt{'yes'} $lt{'no'} + + +

+$lt{'irsp'} + +


$lt{'cc'}

-$lt{'user'}: -

-$lt{'dmn'}: $domform -

-$lt{'ierc'}: - + +

+ +

+

- +

@@ -549,7 +616,8 @@ ENDENHEAD $cdescr,$curl, $ENV{'form.course_home'}, $ENV{'form.nonstandard'}, - $ENV{'form.crscode'}); + $ENV{'form.crscode'}, + $ENV{'form.ccuname'}); # Note: The testing routines depend on this being output; see # Utils::Course. This needs to at least be output as a comment @@ -623,9 +691,8 @@ ENDENHEAD my ($sec,$gp) = split/:/,$item; my $class = $ENV{'form.crscode'}.$sec; my $addcheck = &Apache::lonnet::auto_new_course($crsunum,$crsudom,$class,$cenv{'internal.courseowner'}); - if ($addcheck eq 'ok') { - $cenv{'internal.sectionnums'} .= $item.','; - } else { + $cenv{'internal.sectionnums'} .= $item.','; + unless ($addcheck eq 'ok') { push @badclasses, $class; } } @@ -646,9 +713,8 @@ ENDENHEAD foreach my $item (@xlists) { my ($xl,$gp) = split/:/,$item; my $addcheck = &Apache::lonnet::auto_new_course($crsunum,$crsudom,$xl,$cenv{'internal.courseowner'}); - if ($addcheck eq 'ok') { - $cenv{'internal.crosslistings'} .= $item.','; - } else { + $cenv{'internal.crosslistings'} .= $item.','; + unless ($addcheck eq 'ok') { push @badclasses, $xl; } } @@ -668,7 +734,7 @@ ENDENHEAD } if (@badclasses > 0) { my %lt=&Apache::lonlocal::texthash( - 'tclb' => 'The courses listed below have not been included as sections or crosslistings affiliated with your new LON-CAPA course. If automated course roster updates are enabled for this class, these particular sections/crosslistings will not contribute towards enrollment, because the user identified as the course owner for this LON-CAPA course', + 'tclb' => 'The courses listed below were included as sections or crosslistings affiliated with your new LON-CAPA course. However, if automated course roster updates are enabled for this class, these particular sections/crosslistings will not contribute towards enrollment, because the user identified as the course owner for this LON-CAPA course', 'dnhr' => 'does not have rights to access enrollment in these classes', 'adby' => 'as determined by the policies of your institution on access to official classlists' );