[LON-CAPA-cvs] cvs: loncom /cgi graph.png

minaeibi lon-capa-cvs@mail.lon-capa.org
Mon, 13 Jan 2003 00:07:51 -0000


minaeibi		Sun Jan 12 19:07:51 2003 EDT

  Modified files:              
    /loncom/cgi	graph.png 
  Log:
  To fix bug #1052
  a) If the number of problems involved is less than 100
      it would be better to change the plotting to
      display "number of problems correct" on the x-axis
      and the range would be from 0 to 99
  b) If the number of problems is > or = 100
      Plot the % leave as it is currently.
  
  
  
Index: loncom/cgi/graph.png
diff -u loncom/cgi/graph.png:1.18 loncom/cgi/graph.png:1.19
--- loncom/cgi/graph.png:1.18	Sat Jan 11 01:28:19 2003
+++ loncom/cgi/graph.png	Sun Jan 12 19:07:51 2003
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# $Id: graph.png,v 1.18 2003/01/11 06:28:19 minaeibi Exp $
+# $Id: graph.png,v 1.19 2003/01/13 00:07:51 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -51,14 +51,14 @@
 
 my @xlabels;
 
-if ($xlab=~/^Percentage$/){
+if ($Titr =~ /^Percentage$/){
     for (my $nIdx=0; $nIdx<$PNo; $nIdx++ ) {
-#        $xlabels[$nIdx]=$data11[$nIdx];
         $xlabels[$nIdx]=$nIdx;
     }
     @data11=();
     @data11=split(/\,/,$data2);
-    @data12=();  
+    @data12=();
+    $Titr = '';
 } else {
      for (my $nIdx=0; $nIdx<$PNo; $nIdx++ ) {
          $xlabels[$nIdx]=$nIdx+1;
@@ -73,15 +73,14 @@
 if ($xlab=~/^Concepts$/){
     $Range1=270;
     $Range2=200;
-} elsif ($xlab=~/^Percentage$/){
+} elsif ($xlab=~/^Problem_number$/){
+    $Range1=450;
+    $Range2=200;
+} else {
     $Range1=800;#*$PNo; 
     $Range2=200;
     $skip_x=5;
     $bar_space=1;
-    $xlab='Percentage_of_Correct_Problems';
-} else {
-    $Range1=450;
-    $Range2=200;
 }