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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 24 Mar 2008 19:08:13 -0000


raeburn		Mon Mar 24 15:08:13 2008 EDT

  Modified files:              (Branch: version_2_6_X)
    /loncom/homework	grades.pm 
  Log:
  - backport 1.515
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.513 loncom/homework/grades.pm:1.513.2.1
--- loncom/homework/grades.pm:1.513	Tue Mar  4 06:23:12 2008
+++ loncom/homework/grades.pm	Mon Mar 24 15:08:09 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.513 2008/03/04 11:23:12 foxr Exp $
+# $Id: grades.pm,v 1.513.2.1 2008/03/24 19:08:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -7231,20 +7231,23 @@
     my $response_number = 0;
     my $bubble_line     = 0;
     foreach my $resource (@resources) {
+        my $symb = $resource->symb();
         # Need to retrieve part IDs and response IDs because essayresponse,
         # reactionresponse and organicresponse items are not included in 
         # $analysis{'parts'} from lonnet::ssi.  
         my %possible_part_ids; 
         if (ref($resource->parts()) eq 'ARRAY') { 
             foreach my $part (@{$resource->parts()}) {
-                my @resp_ids = $resource->responseIds($part);
-                foreach my $id (@resp_ids) {
-                    $possible_part_ids{$part.'.'.$id} = 1;
+                if (!&Apache::loncommon::check_if_partid_hidden($part,$symb,$udom,$uname)) {
+                    my @resp_ids = $resource->responseIds($part);
+                    foreach my $id (@resp_ids) {
+                        $possible_part_ids{$part.'.'.$id} = 1;
+                    }
                 }
             }
         }
 	my $result=&ssi_with_retries($resource->src(), $ssi_retries,
-					('symb' => $resource->symb()),
+					('symb' => $symb),
 					('grade_target' => 'analyze'),
 					('grade_courseid' => $cid),
 					('grade_domain' => $udom),
@@ -7257,7 +7260,12 @@
 	my %analysis = &Apache::lonnet::str2hash($an);
 
         if (ref($analysis{'parts'}) eq 'ARRAY') {
-            @parts = @{$analysis{'parts'}};
+            foreach my $part (@{$analysis{'parts'}}) {
+                my ($id,$respid) = split(/\./,$part);
+                if (!&Apache::loncommon::check_if_partid_hidden($id,$symb,$udom,$uname)) {
+                    push(@parts,$part);
+                }
+            }
         }
         # Add part_ids for any essayresponse items. 
         foreach my $part_id (keys(%possible_part_ids)) {