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

www lon-capa-cvs-allow@mail.lon-capa.org
Wed, 14 May 2008 16:36:33 -0000


www		Wed May 14 12:36:33 2008 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Session lock while scantron grading
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.519 loncom/homework/grades.pm:1.520
--- loncom/homework/grades.pm:1.519	Thu May  1 12:03:34 2008
+++ loncom/homework/grades.pm	Wed May 14 12:36:31 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.519 2008/05/01 16:03:34 raeburn Exp $
+# $Id: grades.pm,v 1.520 2008/05/14 16:36:31 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7519,6 +7519,7 @@
     my @delayqueue;
     my %completedstudents;
     
+    my $lock=&Apache::lonnet::set_lock(&mt('Grading bubblesheet exam'));
     my $count=&get_todo_count($scanlines,$scan_data);
     my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Scantron Status',
  				    'Scantron Progress',$count,
@@ -7539,6 +7540,7 @@
 	$r->print("</form>");
 	&ssi_print_error($r);
 	$r->print(&show_grading_menu_form($symb));
+        &Apache::lonnet::remove_lock($lock);
 	return '';		# Dunno why the other returns return '' rather than just returning.
     }
 
@@ -7596,6 +7598,7 @@
 		$r->print("</form>");
 		&ssi_print_error($r);
 		$r->print(&show_grading_menu_form($symb));
+                &Apache::lonnet::remove_lock($lock);
 		return '';	# Why return ''?  Beats me.
 	    }
 
@@ -7608,6 +7611,7 @@
 	&Apache::lonnet::delenv('scantron\.');
     }
     &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
+    &Apache::lonnet::remove_lock($lock);
 #    my $lasttime = &Time::HiRes::time()-$start;
 #    $r->print("<p>took $lasttime</p>");