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

minaeibi lon-capa-cvs@mail.lon-capa.org
Mon, 13 Jan 2003 01:34:12 -0000


minaeibi		Sun Jan 12 20:34:12 2003 EDT

  Modified files:              
    /loncom/interface/statistics	lonstudentassessment.pm 
  Log:
  Fixed bug #994, so we have in chart like the below:
  
    1) student1    111115212121     12/12   122221172111     12/12
    2) student2    11111*191221     12/12   211*112 3.21     10/12
  ....
   99) student99   1223224*7232     12/12   3145.1245***     11/12
  100) student100  121123244241     12/12   213.132216*4     11/12   
  
  
  but still the following code in lonstudentassessment does not work!
  my $out = '';
  $out .= sprintf("%3d) ", $Count);
  if($Count % 2) {
      $out .= '<bgcolor="#FFFFFF">';
  } else {
      $out .= '<bgcolor="#505050">';
  }
  
  
  
  
Index: loncom/interface/statistics/lonstudentassessment.pm
diff -u loncom/interface/statistics/lonstudentassessment.pm:1.26 loncom/interface/statistics/lonstudentassessment.pm:1.27
--- loncom/interface/statistics/lonstudentassessment.pm:1.26	Thu Jan  9 11:37:48 2003
+++ loncom/interface/statistics/lonstudentassessment.pm	Sun Jan 12 20:34:11 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # (Publication Handler
 #
-# $Id: lonstudentassessment.pm,v 1.26 2003/01/09 16:37:48 minaeibi Exp $
+# $Id: lonstudentassessment.pm,v 1.27 2003/01/13 01:34:11 minaeibi Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -31,7 +31,8 @@
 # YEAR=2002
 # 1/22,2/1,2/6,2/25,3/2,3/6,3/17,3/21,3/22,3/26,4/7,5/6 Behrouz Minaei
 # 5/12,5/14,5/15,5/19,5/26,7/16,12/24  Behrouz Minaei
-#
+# YEAR=2003  
+# 1/11  Behrouz Minaei
 ###
 
 package Apache::lonstudentassessment;
@@ -41,12 +42,10 @@
 use Apache::loncoursedata;
 use GDBM_File;
 
-#my $jr;
 
 sub BuildStudentAssessmentPage {
     my ($cacheDB,$students,$courseID,$formName,$headings,$spacing,
         $studentInformation,$r,$c)=@_;
-#    $jr = $r;
     my %cache;
     unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
         $r->print('<html><body>Unable to tie database.</body></html>');
@@ -135,11 +134,11 @@
             }
             $Count++;
 	    my $out = '';
-#	    $out .= sprintf("%3d", $Count);
+	    $out .= sprintf("%3d) ", $Count);
             if($Count % 2) {
                 $out .= '<bgcolor="#FFFFFF">';
             } else {
-                $out .= '<bgcolor="#F0F0F0">';
+                $out .= '<bgcolor="#505050">';
             }
 	    my $displayString = $out.'DISPLAYDATA'.$spacing;
 	    $r->print(&Apache::lonhtmlcommon::FormatStudentInformation(
@@ -188,8 +187,6 @@
 }
 
 
-
-
 #---- Student Assessment Web Page --------------------------------------------
 
 sub CreateInterface {
@@ -249,14 +246,16 @@
 #    my $Str = '&nbsp&nbsp&nbsp&nbsp&nbsp';
     my $Str = '';
     $Str .= '<table border="0" cellpadding="0" cellspacing="0">'."\n";
-
     $Str .= '<tr>'."\n";
+    $Str .= '<td><pre>     </pre></td>'."\n";
     $Str .= &CreateColumnSelectors($infoHeadings, $sequenceHeadings,
                                    $sequenceKeys);
     $Str .= '<td></td></tr>'."\n";
 
     $Str .= '<tr>'."\n";
-    my $displayString = '<td align="left"><pre><a href="/adm/statistics?';
+    my $displayString = '';
+    $displayString .= '<td><pre>     </pre></td>'."\n";
+    $displayString .= '<td align="left"><pre><a href="/adm/statistics?';
     $displayString .= 'sort=LINKDATA">DISPLAYDATA</a>FORMATTING';
     $displayString .= $spacing.'</pre></td>'."\n";
     $Str .= &Apache::lonhtmlcommon::CreateHeadings($cache,
@@ -425,12 +424,14 @@
         $TotalProblems += $cache->{$name.':totalProblems'};
     }
     if ($StudentCount) { 
-        $ProblemsSolved /= $StudentCount;
+        $ProblemsSolved = sprintf( "%.2f", 
+                             $ProblemsSolved/$StudentCount);
         $TotalProblems /= $StudentCount;
     } else {
         $ProblemsSolved = 0;
         $TotalProblems  = 0;
     }
+
     $Str .= '<table border=2 cellspacing="1">'."\n";
     $Str .= '<tr><td><b>Students Count</b></td><td><b>'.
             $StudentCount.'</b></td></tr>'."\n";