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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Wed, 06 Jun 2007 17:30:40 -0000


albertel		Wed Jun  6 13:30:40 2007 EDT

  Modified files:              
    /loncom/interface	lonstatistics.pm 
  Log:
  - sort number sections numerically
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.137 loncom/interface/lonstatistics.pm:1.138
--- loncom/interface/lonstatistics.pm:1.137	Fri Aug 18 11:15:38 2006
+++ loncom/interface/lonstatistics.pm	Wed Jun  6 13:30:40 2007
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonstatistics.pm,v 1.137 2006/08/18 15:15:38 raeburn Exp $
+# $Id: lonstatistics.pm,v 1.138 2007/06/06 17:30:40 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -76,7 +76,6 @@
 use Apache::lonstudentsubmissions();
 use Apache::lonsurveyreports();
 use Apache::longradinganalysis();
-use lib '/home/httpd/lib/perl/';
 use LONCAPA;
 
 #######################################################
@@ -313,7 +312,11 @@
     if ($env{'request.course.sec'} !~ /^\s*$/) {
         @Sections = ($env{'request.course.sec'});
     } else {
-        @Sections = sort {$a cmp $b} keys(%Sections);
+        @Sections = sort {
+	    if ($a == $a && $b == $b ) { return $a <=> $b; }
+	    return $a cmp $b;
+	} keys(%Sections);
+
         unshift(@Sections,'all'); # Put 'all' at the front of the list
     }
     # Sort the groups