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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Sun, 22 Jan 2006 02:10:04 -0000


bowersj2		Sat Jan 21 21:10:04 2006 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Fix bug 4415: If it was going to display a negative number, "truncate"
  it to 0. This means everything in the Parts Correct chart is either 0
  or 1.
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.125 loncom/interface/statistics/lonstudentassessment.pm:1.126
--- loncom/interface/statistics/lonstudentassessment.pm:1.125	Fri Aug 26 17:53:23 2005
+++ loncom/interface/statistics/lonstudentassessment.pm	Sat Jan 21 21:10:03 2006
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstudentassessment.pm,v 1.125 2005/08/26 21:53:23 albertel Exp $
+# $Id: lonstudentassessment.pm,v 1.126 2006/01/22 02:10:03 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1411,8 +1411,9 @@
             if ($chosen_output->{'correct'}) {
                 # only indiciate if each item is correct or not
                 foreach my $value (@$rawdata) {
-                    # nonzero means correct
-                    $value = 1 if ($value > 0);
+                    # positive means correct, 0 or negative means
+                    # incorrect
+                    $value = $value > 0 ? 1 : 0;
                     $excel_sheet->write($rows_output,$cols_output++,$value);
                 }
             } else {