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

raeburn raeburn@source.lon-capa.org
Mon, 27 Sep 2010 18:45:15 -0000


raeburn		Mon Sep 27 18:45:15 2010 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - Bug 5921.
   - If storage could not occur, delete "locked" key, but leave key from check-in
     intact, so consistent status of "Waiting for grade" is maintained. 
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.252 loncom/homework/bridgetask.pm:1.253
--- loncom/homework/bridgetask.pm:1.252	Mon Aug 23 03:24:01 2010
+++ loncom/homework/bridgetask.pm	Mon Sep 27 18:45:14 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.252 2010/08/23 03:24:01 raeburn Exp $
+# $Id: bridgetask.pm,v 1.253 2010/09/27 18:45:14 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1334,39 +1334,39 @@
             }
             if ($canstore) {
 	        &Apache::structuretags::finalize_storage();
+	        # data stored, now handle queue
+	        if ($review) {
+		    if ($env{'form.queue'} eq 'reviewqueue') {
+		        &check_queue_unlock($env{'form.queue'});
+		        &Apache::lonxml::debug(" still needs review not changing status.");
+		    } else {
+		        if ($env{'form.queue'} ne 'none') {
+			    &move_between_queues($env{'form.queue'},'reviewqueue');
+		        } else {
+			    &add_to_queue('reviewqueue',\%queue_data);
+		        }
+		    }
+	        } elsif ($ungraded) {
+		    if ($env{'form.queue'} eq 'reviewqueue') {
+		        &Apache::lonxml::debug("moving back.");
+		        &move_between_queues($env{'form.queue'},
+					     'gradingqueue');
+		    } elsif ($env{'form.queue'} eq 'none' ) {
+		        &add_to_queue('gradingqueue',\%queue_data);	
+		    } else {
+		        &check_queue_unlock($env{'form.queue'});
+		    }
+	        } elsif ($mandatory_failed) {
+		    &remove_from_queue($env{'form.queue'}); 
+	        } else {
+		    &remove_from_queue($env{'form.queue'});
+	        }
             } else {
+                &check_queue_unlock($env{'form.queue'});
                 $result .= '<br /><div class="LC_error">'.
-                           &mt('Information extracted from the current gradingkey was for a different BT or user from those for which grading data are to be stored.').' '.&mt('No grading changes stored.').'</div><br />';  
+                           &mt('Information extracted from the current gradingkey was for a different BT or user from those for which grading data are to be stored.').' '.&mt('No grading changes stored.').'</div><br />';
             }
-
-	    # data stored, now handle queue
-	    if ($review) {
-		if ($env{'form.queue'} eq 'reviewqueue') {
-		    &check_queue_unlock($env{'form.queue'});
-		    &Apache::lonxml::debug(" still needs review not changing status.");
-		} else {
-		    if ($env{'form.queue'} ne 'none') {
-			&move_between_queues($env{'form.queue'},'reviewqueue');
-		    } else {
-			&add_to_queue('reviewqueue',\%queue_data);
-		    }
-		}
-	    } elsif ($ungraded) {
-		if ($env{'form.queue'} eq 'reviewqueue') {
-		    &Apache::lonxml::debug("moving back.");
-		    &move_between_queues($env{'form.queue'},
-					 'gradingqueue');
-		} elsif ($env{'form.queue'} eq 'none' ) {
-		    &add_to_queue('gradingqueue',\%queue_data);	
-		} else {
-		    &check_queue_unlock($env{'form.queue'});
-		}
-	    } elsif ($mandatory_failed) {
-		&remove_from_queue($env{'form.queue'}); 
-	    } else {
-		&remove_from_queue($env{'form.queue'});
-	    }
-	}
+        }
 	if (exists($Apache::lonhomework::results{'INTERNAL_store'})) {
 	    # instance generation occurred and hasn't yet been stored
 	    &Apache::structuretags::finalize_storage();