[LON-CAPA-cvs] cvs: modules /vcu create_course_enroll.pl

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 11 Feb 2008 21:41:12 -0000


raeburn		Mon Feb 11 16:41:12 2008 EDT

  Modified files:              
    /modules/vcu	create_course_enroll.pl 
  Log:
  - Retrieve courseIDs from lonnet:courseiddump(). 
  
  
Index: modules/vcu/create_course_enroll.pl
diff -u modules/vcu/create_course_enroll.pl:1.1 modules/vcu/create_course_enroll.pl:1.2
--- modules/vcu/create_course_enroll.pl:1.1	Mon Feb 11 16:37:30 2008
+++ modules/vcu/create_course_enroll.pl	Mon Feb 11 16:41:12 2008
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: create_course_enroll.pl
+# $Id: create_course_enroll.pl,v 1.2 2008/02/11 21:41:12 raeburn Exp $
     use strict;
     use lib '/home/httpd/lib/perl';
     use Apache::lonnet;
@@ -12,3 +12,19 @@
     my %vcu_users;
     
     my (%userinfo,%record);
+
+    foreach my $dom (@domains) {
+        my %courses = &Apache::lonnet::courseiddump($dom,'.',1,'.','.','.',1,\@hostids,'Course');
+
+        my %affiliates;
+        foreach my $key (keys(%courses)) {
+            my ($dept,$coursenum,$semyr);
+            if (ref($courses{$key}) eq 'HASH') {
+                ($dept,$coursenum,$semyr) =
+                    split(/\-/,$courses{$key}{'inst_code'},-1);
+            } else {
+                next;
+            }
+        }
+    }
+