[LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 08 Jun 2006 22:33:58 -0000


albertel		Thu Jun  8 18:33:58 2006 EDT

  Modified files:              
    /loncom/homework	lonhomework.pm 
  Log:
  - support old and new style checkedin recods
  
  
Index: loncom/homework/lonhomework.pm
diff -u loncom/homework/lonhomework.pm:1.248 loncom/homework/lonhomework.pm:1.249
--- loncom/homework/lonhomework.pm:1.248	Tue May 16 17:21:32 2006
+++ loncom/homework/lonhomework.pm	Thu Jun  8 18:33:57 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Homework handler
 #
-# $Id: lonhomework.pm,v 1.248 2006/05/16 21:21:32 albertel Exp $
+# $Id: lonhomework.pm,v 1.249 2006/06/08 22:33:57 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -170,9 +170,14 @@
     } elsif ($type eq 'problem') {
 	$key ='resource.0.checkedin';
     }
-    
+    # backward compatability, used to be username@domain, 
+    # now is username:domain
+    my $who = $Apache::lonhomework::history{$key};
+    if ($who !~ /:/) {
+	$who =~ tr/@/:/;
+    }     
     foreach my $possible (@possible_proctors) { 
-	if ($Apache::lonhomework::history{$key} eq $possible
+	if ($who eq $possible
 	    && $Apache::lonhomework::history{$key.'.slot'} eq $slot_name) {
 	    return 1;
 	}