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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 05 Jun 2006 20:09:19 -0000


albertel		Mon Jun  5 16:09:19 2006 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - when getting status info get the latest possible value
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.743 loncom/lonnet/perl/lonnet.pm:1.744
--- loncom/lonnet/perl/lonnet.pm:1.743	Fri Jun  2 17:32:30 2006
+++ loncom/lonnet/perl/lonnet.pm	Mon Jun  5 16:09:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.743 2006/06/02 21:32:30 albertel Exp $
+# $Id: lonnet.pm,v 1.744 2006/06/05 20:09:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5117,8 +5117,14 @@
 	    if ( (defined($Apache::lonhomework::parsing_a_problem)
 		  || defined($Apache::lonhomework::parsing_a_task))
 		 &&
-		 ($symbparm eq &symbread()) ) {
-		return $Apache::lonhomework::history{$qualifierrest};
+		 ($symbparm eq &symbread()) ) {	
+		# if we are in the middle of processing the resource the
+		# get the value we are planning on committing
+                if (defined($Apache::lonhomework::results{$qualifierrest})) {
+                    return $Apache::lonhomework::results{$qualifierrest};
+                } else {
+                    return $Apache::lonhomework::history{$qualifierrest};
+                }
 	    } else {
 		my %restored;
 		if ($publicuser || $env{'request.state'} eq 'construct') {