--- loncom/interface/lonstatistics.pm	2002/08/13 15:01:07	1.43
+++ loncom/interface/lonstatistics.pm	2002/08/14 20:42:48	1.46
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonstatistics.pm,v 1.43 2002/08/13 15:01:07 stredwic Exp $
+# $Id: lonstatistics.pm,v 1.46 2002/08/14 20:42:48 stredwic Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -82,6 +82,16 @@ sub ProcessFormData{
     &CheckFormElement($cache, 'DownloadAll', 'DownloadAll', 'false');
     &CheckFormElement($cache, 'sort', 'sort', 'fullname');
     &CheckFormElement($cache, 'download', 'download', 'false');
+    &CheckFormElement($cache, 'StatisticsMaps', 
+                      'StatisticsMaps', 'All Maps');
+    if(defined($ENV{'form.Section'})) {
+        my @sectionsSelected = (ref($ENV{'form.Section'}) ?
+                               @{$ENV{'form.Section'}} :
+                                ($ENV{'form.Section'}));
+        $cache->{'sectionsSelected'} = join(':', @sectionsSelected);
+    } elsif(!defined($cache->{'sectionsSelected'})) {
+        $cache->{'sectionsSelected'} = $cache->{'sectionList'};
+    }
 
     # student assessment
     if(defined($ENV{'form.CreateStudentAssessment'}) ||
@@ -102,15 +112,6 @@ sub ProcessFormData{
         &Apache::lonnet::unescape($cache->{'StudentAssessmentStudent'});
     &CheckFormElement($cache, 'DefaultColumns', 'DefaultColumns', 'false');
 
-    if(defined($ENV{'form.Section'})) {
-        my @sectionsSelected = (ref($ENV{'form.Section'}) ?
-                               @{$ENV{'form.Section'}} :
-                                ($ENV{'form.Section'}));
-        $cache->{'sectionsSelected'} = join(':', @sectionsSelected);
-    } elsif(!defined($cache->{'sectionsSelected'})) {
-        $cache->{'sectionsSelected'} = $cache->{'sectionList'};
-    }
-
     # Problem analysis
     &CheckFormElement($cache, 'Interval', 'Interval', '1');
 
@@ -119,11 +120,11 @@ sub ProcessFormData{
                       'DisplayFormat', 'Display Table Format');
     &CheckFormElement($cache, 'ProblemStatisticsAscend',
                       'ProblemStatisticsAscend', 'Ascending');
-    &CheckFormElement($cache, 'ProblemStatisticsMaps', 
-                      'ProblemStatisticsMaps', 'All Maps');
     &CheckFormElement($cache, 'ProblemStatisticsSort',
                       'ProblemStatisticsSort', 'Homework Sets Order');
     &CheckFormElement($cache, 'DisplayLegend', 'DisplayLegend', 'Hide Legend');
+    &CheckFormElement($cache, 'SortProblems', 'SortProblems', 
+                      'Sort Within Sequence');
 
     # Search only form elements
     my @headingColumns=();
@@ -542,7 +543,7 @@ sub BuildStatistics {
         }
 
         if(defined($cache{'OptionResponses'})) {
-            $reports{'problem_analysis'} = 'Problem Analysis';
+            $reports{'problem_analysis'} = 'Option Response Analysis';
         }
 
         $r->print('<form name="Statistics" ');
@@ -562,7 +563,7 @@ sub BuildStatistics {
                                                                   $students, 
                                                                   $courseID, 
                                                                   $c,$r);
-    } elsif($GoToPage eq 'Problem Analysis') {
+    } elsif($GoToPage eq 'Option Response Analysis') {
         &Apache::lonproblemanalysis::BuildProblemAnalysisPage($cacheDB, $r);
     } elsif($GoToPage eq 'Student Assessment') {
         &Apache::lonstudentassessment::BuildStudentAssessmentPage($cacheDB,
@@ -581,7 +582,8 @@ sub BuildStatistics {
         $courseDescription =~ s/\ /"_"/eg;
         &Apache::lonproblemstatistics::BuildGraphicChart($GoToPage, $cacheDB,
                                                          $courseDescription,
-                                                         $r);
+                                                         $students, $courseID,
+                                                         $r, $c);
     } elsif($GoToPage eq 'Class list') {
         &BuildClasslist($cacheDB, $students, \@studentInformation,
                         \@headings, $r);