[LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 10 Feb 2004 16:47:25 -0000


matthew		Tue Feb 10 11:47:25 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Bug 2721: skip problems which do not have any parts at all.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.83 loncom/interface/statistics/lonstudentassessment.pm:1.84
--- loncom/interface/statistics/lonstudentassessment.pm:1.83	Fri Feb  6 14:29:00 2004
+++ loncom/interface/statistics/lonstudentassessment.pm	Tue Feb 10 11:47:25 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.83 2004/02/06 19:29:00 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.84 2004/02/10 16:47:25 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1016,7 +1016,12 @@
             # Put the names of the problems and parts into the sheet
             my $count = 0;
             foreach my $res (@{$seq->{'contents'}}) {
-                next if ($res->{'type'} ne 'assessment');
+                if ($res->{'type'} ne 'assessment'  || 
+                    ! exists($res->{'parts'})       ||
+                    ref($res->{'parts'}) ne 'ARRAY' ||
+                    scalar(@{$res->{'parts'}}) < 1) {
+                    next;
+                }
                 if (scalar(@{$res->{'parts'}}) > 1) {
                     foreach my $part (@{$res->{'parts'}}) {
                         $excel_sheet->write($rows_output,