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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 25 Oct 2004 18:30:22 -0000


matthew		Mon Oct 25 14:30:22 2004 EDT

  Modified files:              
    /loncom/interface/statistics	lonproblemanalysis.pm 
  Log:
  Bug 3571: Option response analysis option key colors did not print because
  most web browsers do not print table background colors.  Using 
  background colored asterisks instead of   fixes this.
  
  
Index: loncom/interface/statistics/lonproblemanalysis.pm
diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.94 loncom/interface/statistics/lonproblemanalysis.pm:1.95
--- loncom/interface/statistics/lonproblemanalysis.pm:1.94	Fri Oct 15 12:50:30 2004
+++ loncom/interface/statistics/lonproblemanalysis.pm	Mon Oct 25 14:30:20 2004
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: lonproblemanalysis.pm,v 1.94 2004/10/15 16:50:30 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.95 2004/10/25 18:30:20 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1070,7 +1070,7 @@
         }
         #
         my $correct_graph = &Apache::loncommon::DrawBarGraph
-            ($title,'Foil Number','Percent Correct',
+            ($title,'Statement','% Answered Correct',
              100,$plotcolors,\@Labels,$Datasets[0]);
         
         #
@@ -1083,7 +1083,7 @@
                                            $response_data{'_correct'}->[$try];
         $title = 'Attempt '.$try.' (N='.$count.')';
         my $incorrect_graph = &Apache::loncommon::DrawBarGraph
-            ($title,'Foil Number','% Option Chosen Incorrectly',
+            ($title,'Statement','% Chosen Incorrectly',
              100,$plotcolors,\@Labels,@Datasets);
         $analysis_html.= 
             '<tr>'.
@@ -1671,10 +1671,11 @@
     my $optionindex = 0;
     my @Rows;
     foreach my $option (&mt('correct option chosen'),@{$ORdata->{'_Options'}}) {
+        my $color = $plotcolors->[$optionindex++];
         push (@Rows,
               '<tr>'.
-              '<td bgcolor="'.$plotcolors->[$optionindex++].'">'.
-              ('&nbsp;'x4).'</td>'.
+              '<td bgcolor="'.$color.'">'.
+              '<font color="'.$color.'">'.('*'x3).'</font>'.'</td>'.
               '<td>'.&HTML::Entities::encode($option,'<>&"').'</td>'.
               "</tr>\n");
     }
@@ -1690,10 +1691,11 @@
     my $foil_index = 0;
     my @rows;
     foreach my $foil (&mt('correct foil chosen'),@{$foils}) {
+        my $color = $plotcolors->[$foil_index++];
         push (@rows,
               '<tr>'.
-              '<td bgcolor="'.$plotcolors->[$foil_index++].'">'.
-              ('&nbsp;'x4).'</td>'.
+              '<td bgcolor="'.$color.'" class="key">'.
+              '<font color="'.$color.'">'.('*'x4).'</font></td>'.
               '<td>'.&HTML::Entities::encode($foil,'<>&"').
               ('&nbsp;'x2).$extra_data->{$foil}.'</td>'.
               "</tr>\n");