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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 07 Nov 2005 22:09:02 -0000


albertel		Mon Nov  7 17:09:02 2005 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  - BUG#4445
  
  
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.121 loncom/interface/statistics/lonproblemanalysis.pm:1.122
--- loncom/interface/statistics/lonproblemanalysis.pm:1.121	Tue Apr 19 09:59:34 2005
+++ loncom/interface/statistics/lonproblemanalysis.pm	Mon Nov  7 17:09:00 2005
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemanalysis.pm,v 1.121 2005/04/19 13:59:34 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.122 2005/11/07 22:09:00 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -341,7 +341,9 @@
     while (my ($ans,$submissions) = each(%$responses)) {
         while (my ($submission,$counts) = each(%$submissions)) {
             my ($correct_count,$incorrect_count) = @$counts;
-            my $scaled_value = 100*($submission-$ans)/abs($ans);
+	    my $scaled_value = 
+		($ans) ? 100*($submission-$ans)/abs($ans)
+		       : 0;
             if ($scaled_value < $bins[0]) {
                 $bins[0]=$scaled_value -1;
             }