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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 16 Feb 2004 19:59:49 -0000


matthew		Mon Feb 16 14:59:49 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  Fix bug with non-numeric concepts screwing up option response analysis.
  
  
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.66 loncom/interface/statistics/lonproblemanalysis.pm:1.67
--- loncom/interface/statistics/lonproblemanalysis.pm:1.66	Fri Feb 13 13:25:57 2004
+++ loncom/interface/statistics/lonproblemanalysis.pm	Mon Feb 16 14:59:49 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemanalysis.pm,v 1.66 2004/02/13 18:25:57 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.67 2004/02/16 19:59:49 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1333,15 +1333,15 @@
         my $a1 = lc($a); 
         my $b1 = lc($b);
         if (exists($Numbers{$a1})) {
-            $a = $Numbers{$a1};
+            $a1 = $Numbers{$a1};
         }
         if (exists($Numbers{$b1})) {
-            $b = $Numbers{$b1};
+            $b1 = $Numbers{$b1};
         }
-        if (($a =~/^\d+$/) && ($b =~/^\d+$/)) {
-            return $a <=> $b;
+        if (($a1 =~/^\d+$/) && ($b1 =~/^\d+$/)) {
+            return $a1 <=> $b1;
         } else {
-            return $a cmp $b;
+            return $a1 cmp $b1;
         }
     };
     my @Concepts;