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

stredwic lon-capa-cvs@mail.lon-capa.org
Tue, 13 Aug 2002 12:21:47 -0000


stredwic		Tue Aug 13 08:21:47 2002 EDT

  Modified files:              
    /loncom/interface	lonstatistics.pm 
    /loncom/interface/statistics	lonproblemstatistics.pm 
  Log:
  Added ability to hide and show the legend on the problem statistics 
  report using a button.
  
  
Index: loncom/interface/lonstatistics.pm
diff -u loncom/interface/lonstatistics.pm:1.41 loncom/interface/lonstatistics.pm:1.42
--- loncom/interface/lonstatistics.pm:1.41	Mon Aug 12 20:37:18 2002
+++ loncom/interface/lonstatistics.pm	Tue Aug 13 08:21:46 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonstatistics.pm,v 1.41 2002/08/13 00:37:18 stredwic Exp $
+# $Id: lonstatistics.pm,v 1.42 2002/08/13 12:21:46 stredwic Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -123,6 +123,7 @@
                       'ProblemStatisticsMaps', 'All Maps');
     &CheckFormElement($cache, 'ProblemStatisticsSort',
                       'ProblemStatisticsSort', 'Homework Sets Order');
+    &CheckFormElement($cache, 'DisplayLegend', 'DisplayLegend', 'Hide Legend');
 
     # Search only form elements
     my @headingColumns=();
Index: loncom/interface/statistics/lonproblemstatistics.pm
diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.19 loncom/interface/statistics/lonproblemstatistics.pm:1.20
--- loncom/interface/statistics/lonproblemstatistics.pm:1.19	Mon Aug 12 20:37:18 2002
+++ loncom/interface/statistics/lonproblemstatistics.pm	Tue Aug 13 08:21:46 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonproblemstatistics.pm,v 1.19 2002/08/13 00:37:18 stredwic Exp $
+# $Id: lonproblemstatistics.pm,v 1.20 2002/08/13 12:21:46 stredwic Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -69,9 +69,12 @@
                                             'ProblemStatistics',
                                             'Statistics');
     $Ptr .= '</td></tr>'."\n";
-    $Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'});
+    $Ptr .= &ProblemStatisticsButtons($cache{'DisplayFormat'}, 
+                                      $cache{'DisplayLegend'});
     $Ptr .= '</table>';
-    $Ptr .= &ProblemStatisticsLegend();
+    if($cache{'DisplayLegend'} eq 'Show Legend') {
+        $Ptr .= &ProblemStatisticsLegend();
+    }
     $r->print($Ptr);
     $r->rflush();
 
@@ -356,7 +359,7 @@
 }
 
 sub ProblemStatisticsButtons {
-    my ($displayFormat)=@_;
+    my ($displayFormat, $displayLegend)=@_;
 
     my $Ptr = '<tr><td></td><td align="left">';
     $Ptr .= '<input type="submit" name="DoDiffGraph" ';
@@ -364,6 +367,13 @@
     $Ptr .= '&nbsp;&nbsp;&nbsp;';
     $Ptr .= '<input type="submit" name="PercentWrongGraph" ';
     $Ptr .= 'value="%Wrong Graph" />'."\n";
+    $Ptr .= '</td></tr><tr><td></td><td>'."\n";
+    $Ptr .= '<input type="submit" name="DisplayLegend" ';
+    if($displayLegend eq 'Show Legend') {
+        $Ptr .= 'value="Hide Legend" />'."\n";
+    } else {
+        $Ptr .= 'value="Show Legend" />'."\n";
+    }
     $Ptr .= '&nbsp;&nbsp;&nbsp;';
     $Ptr .= '<input type="submit" name="DisplayCSVFormat" ';
     if($displayFormat eq 'Display CSV Format') {