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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 22 Jul 2004 15:56:41 -0000


matthew		Thu Jul 22 11:56:41 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemstatistics.pm 
  Log:
  &compute_discrimination_factor: added check to return 'nan' if we are
  unable to rank the students.
  
  
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.90 loncom/interface/statistics/lonproblemstatistics.pm:1.91
--- loncom/interface/statistics/lonproblemstatistics.pm:1.90	Mon Jul 12 15:30:12 2004
+++ loncom/interface/statistics/lonproblemstatistics.pm	Thu Jul 22 11:56:41 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemstatistics.pm,v 1.90 2004/07/12 19:30:12 matthew Exp $
+# $Id: lonproblemstatistics.pm,v 1.91 2004/07/22 15:56:41 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1581,6 +1581,10 @@
         map { 
             $_->[&Apache::loncoursedata::RNK_student()]; 
           } @{$ranking}[($num_students-$number_to_grab)..($num_students-1)];
+    if (! @BottomSet || (@BottomSet == 1 && $BottomSet[0] eq '') ||
+        ! @TopSet    || (@TopSet    == 1 && $TopSet[0]    eq '')) {
+        return 'nan';
+    }
     my ($bottom_sum,$bottom_max) = 
         &Apache::loncoursedata::get_sum_of_scores($resource,$part,\@BottomSet,
                                                   undef,$starttime,$endtime);