--- loncom/automation/batchcreatecourse.pm 2006/05/11 22:41:38 1.10 +++ loncom/automation/batchcreatecourse.pm 2006/05/30 20:05:10 1.13 @@ -1,5 +1,5 @@ # -# $Id: batchcreatecourse.pm,v 1.10 2006/05/11 22:41:38 raeburn Exp $ +# $Id: batchcreatecourse.pm,v 1.13 2006/05/30 20:05:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -166,7 +166,7 @@ use strict; # # Directory for retrieval of files listed in @$requests is: # /home/httpd/perl/tmp/addcourse/$dom/auto/pending if $context = auto -# /home/httpd/perl/tmp/addcourse/$dom/web/$udom_$uname if $context = web +# /home/httpd/perl/tmp/addcourse/$dom/web/$uname_$udom/pending if $context = web # # inputs (five) - requests - ref to array of filename(s) containing course requests # courseids - ref to hash to store LON-CAPA course ids of new courses @@ -201,7 +201,7 @@ sub create_courses { $newcoursedir .= '/pending'; } else { if ($uname && $udom) { - $newcoursedir .= '/'.$udom.'_'.$uname; + $newcoursedir .= '/'.$uname.'_'.$udom.'/pending'; } else { $logmsg = "batchcreatecourse::create_courses() called without username and/or domain of requesting Domain Coordinator"; } @@ -629,7 +629,7 @@ sub process_date { if ($timestr !~ /:/) { $timestamp = ''; } else { - my @entries = split/:/,$timestr; + my @entries = split(/:/,$timestr); for (my $j=0; $j<@entries; $j++) { if ( length($entries[$j]) > 1 ) { $entries[$j] =~ s/^0//; @@ -668,9 +668,12 @@ sub process_date { $entries[2] = 29; } if ($entries[2] == 29) { - unless ($entries[0]%4) == 0) { + if ($entries[0]%4 != 0) { $entries[2] == 28; - } + } elsif ( $entries[0]%100 == 0 + && $entries[0]%400 != 0) { + $entries[2] == 28; + } } } $timestamp = timelocal($entries[5],$entries[4],$entries[3],$entries[2],$entries[1],$entries[0]);