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

www www@source.lon-capa.org
Tue, 20 Apr 2010 21:53:34 -0000


www		Tue Apr 20 21:53:34 2010 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Bugs #6258: take out of grading queue when uploading scores
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.626 loncom/homework/grades.pm:1.627
--- loncom/homework/grades.pm:1.626	Tue Apr 20 20:23:55 2010
+++ loncom/homework/grades.pm	Tue Apr 20 21:53:33 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.626 2010/04/20 20:23:55 www Exp $
+# $Id: grades.pm,v 1.627 2010/04/20 21:53:33 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4115,14 +4115,20 @@
 					   $env{'request.course.id'},
 					   $domain,$username);
 	   if ($result eq 'ok') {
+# Successfully stored
 	      $request->print('.');
-	   } else {
+# Remove from grading queue
+              &Apache::bridgetask::remove_from_queue('gradingqueue',$symb,
+                                             $env{'course.'.$env{'request.course.id'}.'.domain'},
+                                             $env{'course.'.$env{'request.course.id'}.'.num'},
+                                             $domain,$username);
+              $countdone++;
+           } else {
 	      $request->print("<p><span class=\"LC_error\">".
                               &mt("Failed to save data for student [_1]. Message when trying to save was: [_2]",
                                   "$username:$domain",$result)."</span></p>");
 	   }
 	   $request->rflush();
-	   $countdone++;
         }
     }
     $request->print('<br />'.&Apache::lonhtmlcommon::confirm_success(&mt("Saved scores for [quant,_1,student]",$countdone),$countdone==0));
@@ -9277,17 +9283,17 @@
                                        {href=>'', text=>'Store grades'}]);
             $request->print(&assign_clicker_grades($request,$symb));
 	} elsif ($command eq 'csvform' && $perm{'mgr'}) {
-            &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+            &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
 	    $request->print(&upcsvScores_form($request,$symb));
 	} elsif ($command eq 'csvupload' && $perm{'mgr'}) {
-            &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+            &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
 	    $request->print(&csvupload($request,$symb));
 	} elsif ($command eq 'csvuploadmap' && $perm{'mgr'} ) {
-            &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+            &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
 	    $request->print(&csvuploadmap($request,$symb));
 	} elsif ($command eq 'csvuploadoptions' && $perm{'mgr'}) {
 	    if ($env{'form.associate'} ne 'Reverse Association') {
-                &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+                &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
 		$request->print(&csvuploadoptions($request,$symb));
 	    } else {
 		if ( $env{'form.upfile_associate'} ne 'reverse' ) {
@@ -9295,11 +9301,11 @@
 		} else {
 		    $env{'form.upfile_associate'} = 'forward';
 		}
-                &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+                &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
 		$request->print(&csvuploadmap($request,$symb));
 	    }
 	} elsif ($command eq 'csvuploadassign' && $perm{'mgr'} ) {
-            &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);
+            &startpage($request,$symb,[{href=>'', text=>'Upload Scores'}],1,1);
 	    $request->print(&csvuploadassign($request,$symb));
 	} elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) {
             &startpage($request,$symb,[{href=>'', text=>'Grade/Manage/Review Bubblesheets'}],1,1);