[LON-CAPA-cvs] cvs: loncom /automation batchcreatecourse.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Fri, 13 Jan 2006 21:36:36 -0000


raeburn		Fri Jan 13 16:36:36 2006 EDT

  Modified files:              
    /loncom/automation	batchcreatecourse.pm 
  Log:
  Fix some typos. Also new users were being created without first name and last name, because hash name did not match tag in XML file.
  
  
Index: loncom/automation/batchcreatecourse.pm
diff -u loncom/automation/batchcreatecourse.pm:1.8 loncom/automation/batchcreatecourse.pm:1.9
--- loncom/automation/batchcreatecourse.pm:1.8	Wed Aug 31 02:31:22 2005
+++ loncom/automation/batchcreatecourse.pm	Fri Jan 13 16:36:33 2006
@@ -1,5 +1,5 @@
 #
-# $Id: batchcreatecourse.pm,v 1.8 2005/08/31 06:31:22 raeburn Exp $
+# $Id: batchcreatecourse.pm,v 1.9 2006/01/13 21:36:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -36,6 +36,8 @@
 use Apache::loncreateuser;
 use Apache::lonlocal;
 
+use strict;
+
 # Collection of routines used for batch creation of courses and users.
 # &create_courses() should be called by an Autocreate.pl
 # script via a cron entry, or alternatively from a web page, after upload 
@@ -184,7 +186,7 @@
     my $perlvarref = LONCAPA::Configuration::read_conf('loncapa.conf');
 # Get role names
     my %longroles = ();
-    open(FILE,"<$perlvarref{'lonTabDir'}.'/rolesplain.tab");
+    open(FILE,"<$$perlvarref{'lonTabDir'}.'/rolesplain.tab");
     my @rolesplain = <FILE>;
     close(FILE);
     foreach (@rolesplain) {
@@ -376,7 +378,7 @@
 #########################################################
 
 sub build_course {
-    my ($cdom,$num,$context,$details,$longoles,$logmsg,$newusermsg,$addresult,$enrollcount,$output,$keysmsg,$udom,$uname) = @_;
+    my ($cdom,$num,$context,$details,$longroles,$logmsg,$newusermsg,$addresult,$enrollcount,$output,$keysmsg,$udom,$uname) = @_;
     my $owner_uname = $$details{$num}{'owner'};
     my $owner_domain = $$details{$num}{'domain'};
     my $owner = $owner_uname.':'.$owner_domain;
@@ -422,11 +424,11 @@
                     'emailenc' => $$details{$num}{'emailenc'},
                     'udom' => $$details{$num}{'domain'},
                     'uname' => $$details{$num}{'owner'},
-                    'pid' => '',
-                    'first' => $$details{$num}{'users'}{$owner}{'first'},
-                    'middle' => $$details{$num}{'users'}{$owner}{'middle'},
-                    'last' => $$details{$num}{'users'}{$owner}{'last'},
-                    'gene' => $$details{$num}{'users'}{$owner}{'gene'},
+                    'pid' => $$details{$num}{'users'}{$owner}{'studentID'},
+                    'first' => $$details{$num}{'users'}{$owner}{'firstname'},
+                    'middle' => $$details{$num}{'users'}{$owner}{'middlename'},
+                    'last' => $$details{$num}{'users'}{$owner}{'lastname'},
+                    'gene' => $$details{$num}{'users'}{$owner}{'generation'},
                     'usec' => '',
                     'end' => '',
                     'start' => '',
@@ -469,7 +471,7 @@
                enrollend => $$details{$num}{'enrollend'},
                startaccess => $$details{$num}{'accessstart'},
                endaccess => $$details{$num}{'accessend'},
-               setpolicy => $Sdetails{$num}{'setpolicy'},
+               setpolicy => $$details{$num}{'setpolicy'},
                setcontent => $$details{$num}{'setcontent'},
                reshome => $reshome,
                setkeys => $$details{$num}{'setkeys'},