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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 15 Nov 2005 19:50:22 -0000


albertel		Tue Nov 15 14:50:22 2005 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
  Log:
  - add_to_queue  now uses newput so as to not overwrite an existing entry
  - buglet for publication
  - add_to_queue on check_in explicitly
  
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.76 loncom/homework/bridgetask.pm:1.77
--- loncom/homework/bridgetask.pm:1.76	Fri Nov  4 10:31:53 2005
+++ loncom/homework/bridgetask.pm	Tue Nov 15 14:50:22 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.76 2005/11/04 15:31:53 albertel Exp $
+# $Id: bridgetask.pm,v 1.77 2005/11/15 19:50:22 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -470,7 +470,11 @@
 		}
 	    } elsif ($target eq 'grade' && !$env{'form.webgrade'}) {
 		if ($status eq 'NEEDS_CHECKIN') {
-		    &proctor_check_auth($slot_name,$slot);
+		    if(&proctor_check_auth($slot_name,$slot)) {
+			my $result=&add_to_queue('gradingqueue',
+						 $Apache::inputtags::slot_name);
+			&Apache::lonxml::debug("add_to_queue said $result");
+		    }
 		}
 	    }
 	} elsif ($target eq 'web') {
@@ -690,6 +694,8 @@
 <h2>'.&mt('Submit Portfolio Files for Grading').'</h2>
 <p>'.&mt('Indicate the files from your portfolio to be evaluated in grading this task.').'</p>').
 							  "</table>";
+		}
+		if (!$previous && !$env{'form.donescreen'}) {
 		    $result.=&Apache::inputtags::gradestatus('0');
 		    $result.='</form>';
 		    $result.=<<DONEBUTTON;
@@ -698,7 +704,7 @@
    <input type="submit" value="Done" />
 </form>
 DONEBUTTON
-		}
+                }
 		if (&show_task($status,$previous) &&
 		    $Apache::lonhomework::history{"resource.$version.status"} =~ /^(pass|fail)$/) {
 		    my $bt_status=$Apache::lonhomework::history{"resource.$version.status"};
@@ -765,6 +771,7 @@
 		    $Apache::lonhomework::results{"resource.$version.0.submission"}='';
 	    } else {
 		delete($Apache::lonhomework::results{"resource.$version.0.bridgetask.portfiles"});
+		$award = '';
 	    }
 	    &Apache::lonhomework::showhash(%Apache::lonhomework::results);
 	    &Apache::structuretags::finalize_storage();
@@ -882,13 +889,14 @@
 	$result.='</form>'.&Apache::loncommon::endbodytag().'</html>';
     } elsif ($target eq 'meta') {
 	$result.=&Apache::response::meta_package_write('Task');
-        $result.=&meta_stores_write('solved','string','Problem Status');
-	$result.=&meta_stores_write('tries','int_zeropos',
-				    'Number of Attempts');
-	$result.=&meta_stores_write('awarded','float',
-				    'Partial Credit Factor');
-	$result.=&meta_stores_write('status','string',
-				    'Bridge Task Status');
+        $result.=&Apache::response::meta_stores_write('solved','string',
+						      'Problem Status');
+	$result.=&Apache::response::meta_stores_write('tries','int_zeropos',
+						      'Number of Attempts');
+	$result.=&Apache::response::meta_stores_write('awarded','float',
+						      'Partial Credit Factor');
+	$result.=&Apache::response::meta_stores_write('status','string',
+						      'Bridge Task Status');
     }
     undef($Apache::lonhomework::parsing_a_task);
     return $result;
@@ -995,7 +1003,7 @@
     my $cdom=$env{'course.'.$cid.'.domain'};
     my %data;
     $data{"$symb\0queue\0$uname\@$udom"}=[$slot_name];
-    return &Apache::lonnet::put($queue,\%data,$cdom,$cnum);
+    return &Apache::lonnet::newput($queue,\%data,$cdom,$cnum);
 }
 
 sub show_queue {