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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 14 Mar 2007 19:15:38 -0000


albertel		Wed Mar 14 15:15:38 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - restore 'only grade some parts' functionality
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.391 loncom/homework/grades.pm:1.392
--- loncom/homework/grades.pm:1.391	Tue Mar 13 14:59:56 2007
+++ loncom/homework/grades.pm	Wed Mar 14 15:15:37 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.391 2007/03/13 18:59:56 banghart Exp $
+# $Id: grades.pm,v 1.392 2007/03/14 19:15:37 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -117,8 +117,12 @@
     my $navmap = Apache::lonnavmaps::navmap->new();
     my $res = $navmap->getBySymb($symb);
     my $partlist = $res->parts();
+    my %vPart = 
+	map { $_ => 1 } (&Apache::loncommon::get_env_multiple('form.vPart'));
     my (%response_types,%handgrade);
     foreach my $part (@{ $partlist }) {
+	next if (%vPart && !exists($vPart{$part}));
+
 	my @types = $res->responseType($part);
 	my @ids = $res->responseIds($part);
 	for (my $i=0; $i < scalar(@ids); $i++) {