[LON-CAPA-cvs] cvs: loncom / lond /enrollment localenroll.pm /lonnet/perl lonnet.pm

raeburn raeburn@source.lon-capa.org
Tue, 18 Aug 2009 20:08:38 -0000


raeburn		Tue Aug 18 20:08:38 2009 EDT

  Modified files:              
    /loncom	lond 
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/enrollment	localenroll.pm 
  Log:
  - lonnet::auto_validate_instcode() used to check if requestor's status permits automatic processing of the course request.
  - Additional arguments now passed (besides $instcode and $owner) include comma-separated list of requestor's institutional affiliations (e.g., Faculty, Staff etc.) and comma-separated list of sections.
  
  lond:validate_instcode_handler()
  - Passes additional arguments on to corresponding routine in localenroll.pm.
  
  localenroll.pm - update stub args and documentation for validate_instcode().
  
  
Index: loncom/lond
diff -u loncom/lond:1.421 loncom/lond:1.422
--- loncom/lond:1.421	Sun Aug 16 21:49:21 2009
+++ loncom/lond	Tue Aug 18 20:08:13 2009
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.421 2009/08/16 21:49:21 raeburn Exp $
+# $Id: lond,v 1.422 2009/08/18 20:08:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -59,7 +59,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.421 $'; #' stupid emacs
+my $VERSION='$Revision: 1.422 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -4888,8 +4888,13 @@
 sub validate_instcode_handler {
     my ($cmd, $tail, $client) = @_;
     my $userinput = "$cmd:$tail";
-    my ($dom,$instcode,$owner) = split(/:/, $tail);
-    my $outcome=&localenroll::validate_instcode($dom,$instcode,$owner);
+    my ($dom,$instcode,$owner,$inststatus,$instseclist) = split(/:/, $tail);
+    $instcode = &unescape($instcode);
+    $owner = &unescape($owner);
+    $inststatus = &unescape($inststatus);
+    $instseclist = &unescape($instseclist);
+    my $outcome=&localenroll::validate_instcode($dom,$instcode,$owner,
+                                                $inststatus,$instseclist);
     &Reply($client, \$outcome, $userinput);
 
     return 1;
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1018 loncom/lonnet/perl/lonnet.pm:1.1019
--- loncom/lonnet/perl/lonnet.pm:1.1018	Sun Aug 16 21:49:32 2009
+++ loncom/lonnet/perl/lonnet.pm	Tue Aug 18 20:08:25 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1018 2009/08/16 21:49:32 raeburn Exp $
+# $Id: lonnet.pm,v 1.1019 2009/08/18 20:08:25 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5645,7 +5645,7 @@
 }
 
 sub auto_validate_instcode {
-    my ($cnum,$cdom,$instcode,$owner) = @_;
+    my ($cnum,$cdom,$instcode,$owner,$inststatuslist,$instseclist) = @_;
     my ($homeserver,$response);
     if (($cdom =~ /^$match_domain$/) && ($cnum =~ /^$match_courseid$/)) {
         $homeserver = &homeserver($cnum,$cdom);
@@ -5656,7 +5656,9 @@
         }
     }
     my $response=&unescape(&reply('autovalidateinstcode:'.$cdom.':'.
-                           &escape($instcode).':'.&escape($owner),$homeserver));
+                           &escape($instcode).':'.&escape($owner).':'.
+                           &escape($inststatuslist).':'.&escape($instseclist),
+                           $homeserver));
     return $response;
 }
 
@@ -5878,11 +5880,6 @@
     return %validations; 
 }
 
-sub auto_courserequest_validation {
-    my ($dom,$details,$inststatuses,$message) = @_;
-    return 'pending';
-}
-
 sub auto_validate_class_sec {
     my ($cdom,$cnum,$owners,$inst_class) = @_;
     my $homeserver = &homeserver($cnum,$cdom);
Index: loncom/enrollment/localenroll.pm
diff -u loncom/enrollment/localenroll.pm:1.36 loncom/enrollment/localenroll.pm:1.37
--- loncom/enrollment/localenroll.pm:1.36	Sat Jul 25 15:25:14 2009
+++ loncom/enrollment/localenroll.pm	Tue Aug 18 20:08:38 2009
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for 
 # automated enrollment
-# $Id: localenroll.pm,v 1.36 2009/07/25 15:25:14 raeburn Exp $
+# $Id: localenroll.pm,v 1.37 2009/08/18 20:08:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -290,19 +290,33 @@
 test is used, namely that the requestor is listed as instructor of
 record for the course in the institution's course schedule/database.
 
-A valid instcode is confirmed by returning 'ok'.
-Otherwise a phrase can be returned explaining why the code was invalid.
+A valid instcode is confirmed by returning 'valid'.
+In the case of a check for the instructor of record, the following can
+be returned:
+(a) valid  - the requestor is the recorded instructor - create the course
+(b) reject - the requestor should never be requesting this course, reject the
+    request permanently
+(c) pending - the requestor is not the recorded instructor, but could
+    become so after administrative action at the institution. Put the
+    request ina queue and check localenroll:validate_instcode()
+    periodically until the status changes to "valid".
+(d) approval - the request will be held pending review by a Domain Coordinator.
+(e) error  (followed by the error condition);  
 
-validate_instcode takes three arguments -
+validate_instcode takes five arguments -
  (a) the LON-CAPA domain that will contain the course
  (b) the institutional code (in the MSU case this is a concatenation of
  semester code, department code, and course number, e.g., fs03nop590.
  (c) an optional institutional username for the course owner.
+ (d) an optional comma-separated list of institutional affiliations of 
+     the course owner.
+ (e) an optional comma-separated list of institutional sections included in
+     the course request
 
 =cut
 
 sub validate_instcode {
-    my ($dom,$instcode,$owner) = @_;
+    my ($dom,$instcode,$owner,$inststatuslist,$instseclist) = @_;
     my $outcome = '';
     return $outcome;
 }