Diff for /loncom/interface/statistics/lonstudentassessment.pm between versions 1.9 and 1.10

version 1.9, 2002/08/31 18:31:15 version 1.10, 2002/08/31 19:25:39
Line 50  sub BuildStudentAssessmentPage { Line 50  sub BuildStudentAssessmentPage {
 #    $jr = $r;  #    $jr = $r;
     my %cache;      my %cache;
     unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {      unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) {
         $r->print('<html><body>Unable to tie database.</body></html>');  [5~        $r->print('<html><body>Unable to tie database.</body></html>');
         return;          return;
     }      }
   
Line 290  sub StudentReport { Line 290  sub StudentReport {
   
     my $Str = '';      my $Str = '';
     if(defined($cache->{$name.':error'})) {      if(defined($cache->{$name.':error'})) {
         return '<br><br><br>';          return $Str;
 #        return 'ERROR in student report for '.$name.'<br>';  
     }      }
     if($cache->{$name.':error'} =~ /course/) {      if($cache->{$name.':error'} =~ /course/) {
         $Str .= '<b><font color="blue">No course data for student </font>';          $Str .= '<b><font color="blue">No course data for student </font>';
Line 299  sub StudentReport { Line 298  sub StudentReport {
         return $Str;          return $Str;
     }      }
   
       my $hasVersion = 'false';
       my $hasFinalData = 'false';
     foreach my $sequence (@$showSequences) {      foreach my $sequence (@$showSequences) {
           my $hasData = 'false';
         my $characterCount=0;          my $characterCount=0;
         foreach my $problemID (split(':', $cache->{$sequence.':problems'})) {          foreach my $problemID (split(':', $cache->{$sequence.':problems'})) {
             my $problem = $cache->{$problemID.':problem'};              my $problem = $cache->{$problemID.':problem'};
Line 308  sub StudentReport { Line 310  sub StudentReport {
             # current problem in the correct order and prepare the output links              # current problem in the correct order and prepare the output links
             foreach(split(/\:/,$cache->{$sequence.':'.$problemID.              foreach(split(/\:/,$cache->{$sequence.':'.$problemID.
                                         ':parts'})) {                                          ':parts'})) {
                 $characterCount++;  
                 if($cache->{$name.':'.$problemID.':NoVersion'} eq 'true' ||                  if($cache->{$name.':'.$problemID.':NoVersion'} eq 'true' ||
                    $cache->{$name.':'.$problemID.':'.$_.':code'} eq ' ') {                     $cache->{$name.':'.$problemID.':'.$_.':code'} eq ' ' ||
                      $cache->{$name.':'.$problemID.':'.$_.':code'} eq '') {
                     $Str .= ' ';                      $Str .= ' ';
                       $characterCount++;
                     next;                      next;
                 }                  }
                   $hasVersion = 'true';
                   $hasData = 'true';
                 $Str .= '<a href="/adm/grades?symb=';                  $Str .= '<a href="/adm/grades?symb=';
                 $Str .= &Apache::lonnet::escape($problem);                  $Str .= &Apache::lonnet::escape($problem);
                 $Str .= '&student='.$username.'&domain='.$domain;                  $Str .= '&student='.$username.'&domain='.$domain;
Line 324  sub StudentReport { Line 329  sub StudentReport {
                     $code = $tries;                      $code = $tries;
                 }                  }
                 $Str .= $code;                  $Str .= $code;
                 $Str.='</a>';                  $Str .= '</a>';
                   $characterCount++;
             }              }
         }          }
   
Line 337  sub StudentReport { Line 343  sub StudentReport {
   
  my $outputProblemsCorrect = sprintf("%3d", $cache->{$name.':'.$sequence.   my $outputProblemsCorrect = sprintf("%3d", $cache->{$name.':'.$sequence.
                                                             ':problemsCorrect'});                                                              ':problemsCorrect'});
  $Str .= '<font color="#007700">'.$outputProblemsCorrect.'</font>';          if($hasData eq 'true') {
               $Str .= '<font color="#007700">'.$outputProblemsCorrect.'</font>';
               $hasFinalData = 'true';
           } else {
               $Str .= '<font color="#007700">   </font>';
           }
         $Str .= $spacing;          $Str .= $spacing;
     }      }
   
Line 346  sub StudentReport { Line 357  sub StudentReport {
     # a way to dynamically determine the space requirements.      # a way to dynamically determine the space requirements.
     my $outputProblemsSolved = sprintf("%4d", $cache->{$name.':problemsSolved'});      my $outputProblemsSolved = sprintf("%4d", $cache->{$name.':problemsSolved'});
     my $outputTotalProblems  = sprintf("%4d", $cache->{$name.':totalProblems'});      my $outputTotalProblems  = sprintf("%4d", $cache->{$name.':totalProblems'});
     $Str .= '<font color="#000088">'.$outputProblemsSolved.      if($hasFinalData eq 'true') {
           $Str .= '<font color="#000088">'.$outputProblemsSolved.
     ' / '.$outputTotalProblems.'</font>';      ' / '.$outputTotalProblems.'</font>';
       } else {
           $Str .= '<font color="#000088">           </font>';
       }
   
       if($hasVersion eq 'false') {
           $Str = '<b><font color="blue">No course data.</font></b>';
       }
   
     return $Str;      return $Str;
 }  }

Removed from v.1.9  
changed lines
  Added in v.1.10


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>