--- loncom/interface/lonstatistics.pm	2002/08/13 12:21:46	1.42
+++ loncom/interface/lonstatistics.pm	2002/08/14 16:18:55	1.44
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonstatistics.pm,v 1.42 2002/08/13 12:21:46 stredwic Exp $
+# $Id: lonstatistics.pm,v 1.44 2002/08/14 16:18:55 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,8 +120,6 @@ 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');
@@ -577,7 +576,11 @@ sub BuildStatistics {
         &Apache::lonproblemanalysis::BuildAnalyzePage($cacheDB, $students, 
                                                       $courseID, $r);
     } elsif($GoToPage eq 'DoDiffGraph' || $GoToPage eq 'PercentWrongGraph') {
-        &Apache::lonproblemstatistics::BuildGraphicChart($GoToPage,$r,$cacheDB);
+        my $courseDescription = $ENV{'course.'.$courseID.'.description'};
+        $courseDescription =~ s/\ /"_"/eg;
+        &Apache::lonproblemstatistics::BuildGraphicChart($GoToPage, $cacheDB,
+                                                         $courseDescription,
+                                                         $r);
     } elsif($GoToPage eq 'Class list') {
         &BuildClasslist($cacheDB, $students, \@studentInformation,
                         \@headings, $r);