[LON-CAPA-cvs] cvs: modules /msu localenroll.pm

raeburn raeburn at source.lon-capa.org
Sat Mar 10 09:59:17 EST 2012


raeburn		Sat Mar 10 14:59:17 2012 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  - Customization for MSU
    - Fix typos.
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.56 modules/msu/localenroll.pm:1.57
--- modules/msu/localenroll.pm:1.56	Fri Mar  9 22:09:48 2012
+++ modules/msu/localenroll.pm	Sat Mar 10 14:59:16 2012
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for
 # automated enrollment
-# $Id: localenroll.pm,v 1.56 2012/03/09 22:09:48 raeburn Exp $
+# $Id: localenroll.pm,v 1.57 2012/03/10 14:59:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -293,11 +293,11 @@
                     }
                     unless ($outcome eq 'ok') {
 # is owner or co-owner a department administrator?
-                        my $seq_id = &semyr_to_seqid($term,$sem,$yr);
+                        my $seqid = &semyr_to_seqid($term,$sem,$yr);
                         my $admincount = 0;
-                        my $adminsth = $dbh->prepare("SELECT Start_Term_Seq_Id,End_Term_Seq_Id FROM LONCAPA_DeptAdministrators WHERE subj_code = '$subj' AND crse_code = $crse' AND PilotID = '$owner'");
+                        my $adminsth = $dbh->prepare("SELECT Start_Term_Seq_Id,End_Term_Seq_Id FROM LONCAPA_DeptAdministrators WHERE subj_code = '$subj' AND crse_code = '$crse' AND PilotID = '$owner'");
                         $adminsth->execute();
-                        while (my($start_seqid,$end_seqid)  = $sth->fetchrow_array ) {
+                        while (my($start_seqid,$end_seqid)  = $adminsth->fetchrow_array ) {
                             $start_seqid =~ s/^0//;
                             $end_seqid =~ s/^0//;
                             if (($seqid >= $start_seqid) && 
@@ -309,7 +309,7 @@
                         if ($admincount > 0) {
                             my $loncount = $dbh->selectrow_array("SELECT count(*) FROM LONCAPA WHERE Term_Code='$term' AND Subj_Code='$subj' AND Crse_Code='$crse' AND Sctn_Code='$sec' AND MSUNetID='$owner'");
                             if ($loncount == 0) {
-                                my $sthad = $dbh->prepare("INSERT INTO LONCAPA (Term_Code, Subj_Code, Crse_Code, Sctn_Code, MSUNetId) VALUES ('$term','$subj','$crse','$sec','$coowner')  ");
+                                my $sthad = $dbh->prepare("INSERT INTO LONCAPA (Term_Code, Subj_Code, Crse_Code, Sctn_Code, MSUNetId) VALUES ('$term','$subj','$crse','$sec','$owner')  ");
                                 $sthad->execute;
                                 $sthad->finish;
                             }
@@ -318,9 +318,9 @@
                             if (@netids > 0) {
                                 foreach my $coowner (@netids) {
                                     $admincount = 0;
-                                    my $admincosth = $dbh->prepare("SELECT Start_Term_Seq_Id,End_Term_Seq_Id FROM LONCAPA_DeptAdministrators WHERE subj_code = '$subj' AND crse_code = $crse' AND PilotID = '$coowner'");
+                                    my $admincosth = $dbh->prepare("SELECT Start_Term_Seq_Id,End_Term_Seq_Id FROM LONCAPA_DeptAdministrators WHERE subj_code = '$subj' AND crse_code = '$crse' AND PilotID = '$coowner'");
                                     $admincosth->execute();
-                                    while (my($start_seqid,$end_seqid)  = $sth->fetchrow_array ) {
+                                    while (my($start_seqid,$end_seqid)  = $admincosth->fetchrow_array ) {
                                         $start_seqid =~ s/^0//;
                                         $end_seqid =~ s/^0//;
                                         if (($seqid >= $start_seqid) &&
@@ -364,7 +364,7 @@
 
 sub semyr_to_seqid {
     my ($term,$sem,$yr) = @_;
-    my $seq_id = '';
+    my $seqid = '';
     if ($term eq 'ss00') {
         $seqid = '996';
     } else {
@@ -470,11 +470,11 @@
                         unless ($outcome eq 'valid') {
 # Check if instructor is a Dept. Administrator
                             eval {
-                                my $seq_id = &semyr_to_seqid($term,$sem,$yr);
+                                my $seqid = &semyr_to_seqid($term,$sem,$year);
                                 my $admincount = 0;
-                                my $adminsth = $dbh->prepare("SELECT Start_Term_Seq_Id,End_Term_Seq_Id FROM LONCAPA_DeptAdministrators WHERE subj_code = '$subj' AND crse_code = $crse' AND PilotID = '$owner'");
+                                my $adminsth = $dbh->prepare("SELECT Start_Term_Seq_Id,End_Term_Seq_Id FROM LONCAPA_DeptAdministrators WHERE subj_code = '$subj' AND crse_code = '$crse' AND PilotID = '$owner'");
                                 $adminsth->execute();
-                                while (my($start_seqid,$end_seqid)  = $sth->fetchrow_array ) {
+                                while (my($start_seqid,$end_seqid)  = $adminsth->fetchrow_array ) {
                                     $start_seqid =~ s/^0//;
                                     $end_seqid =~ s/^0//;
                                     if (($seqid >= $start_seqid) &&




More information about the LON-CAPA-cvs mailing list