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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 10 Feb 2004 19:08:02 -0000


albertel		Tue Feb 10 14:08:02 2004 EDT

  Modified files:              (Branch: version_1_1_X)
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  - backport 1.84
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.81 loncom/interface/statistics/lonstudentassessment.pm:1.81.2.1
--- loncom/interface/statistics/lonstudentassessment.pm:1.81	Tue Jan 27 11:58:05 2004
+++ loncom/interface/statistics/lonstudentassessment.pm	Tue Feb 10 14:08:02 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.81 2004/01/27 16:58:05 matthew Exp $
+# $Id: lonstudentassessment.pm,v 1.81.2.1 2004/02/10 19:08:02 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1017,7 +1017,12 @@
             $seq->{'Excel:startcol'}=$cols_output;
             # Put the names of the problems and parts into the sheet
             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,