Diff for /loncom/interface/statistics/lonstudentassessment.pm between versions 1.8 and 1.14

version 1.8, 2002/08/13 00:37:18 version 1.14, 2002/10/21 00:15:13
Line 6 Line 6
 # Copyright Michigan State University Board of Trustees  # Copyright Michigan State University Board of Trustees
 #  #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).  # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
 #  
 # LON-CAPA is free software; you can redistribute it and/or modify  # LON-CAPA is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by  # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or  # the Free Software Foundation; either version 2 of the License, or
Line 298  sub StudentReport { Line 297  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 307  sub StudentReport { Line 309  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(defined($cache->{$name.':'.$problemID.':NoVersion'}) ||                     $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 323  sub StudentReport { Line 328  sub StudentReport {
                     $code = $tries;                      $code = $tries;
                 }                  }
                 $Str .= $code;                  $Str .= $code;
                 $Str.='</a>';                  $Str .= '</a>';
                   $characterCount++;
             }              }
         }          }
   
Line 334  sub StudentReport { Line 340  sub StudentReport {
         $spacesNeeded -= 3;          $spacesNeeded -= 3;
         $Str .= (' 'x$spacesNeeded);          $Str .= (' 'x$spacesNeeded);
   
  my $outputProblemsCorrect = sprintf("%3d", $cache->{$name.':'.$sequence.          my $outputProblemsCorrect = sprintf("%3d", $cache->{$name.':'.$sequence.
                                                             ':problemsCorrect'});      ':problemsCorrect'});
  $Str .= '<font color="#007700">'.$outputProblemsCorrect.'</font>';  
   # my $outputProblemsCorrect = sprintf("%2d/%2d ", $cache->{$name.':'.$sequence.
   #                                            ':problemsCorrect'}, 
   #                                            $characterCount);
           if($hasData eq 'true') {
               $Str .= '<font color="#007700">'.$outputProblemsCorrect.'</font>';
               $hasFinalData = 'true';
           } else {
               $Str .= '<font color="#007700">   </font>';
           }
         $Str .= $spacing;          $Str .= $spacing;
     }      }
   
Line 345  sub StudentReport { Line 360  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;
 }  }
Line 363  problems. Line 386  problems.
   
 sub CreateLegend {  sub CreateLegend {
     my $Str = "<p><pre>".      my $Str = "<p><pre>".
               "1..9: correct by student in 1..9 tries\n".                "   1  correct by student in 1 try\n".
               "   *: correct by student in more than 9 tries\n".                "   7  correct by student in 7 tries\n".
       "   +: correct by override\n".                "   *  correct by student in more than 9 tries\n".
               "   -: incorrect by override\n".        "   +  correct by override\n".
       "   .: incorrect attempted\n".                "   -  incorrect by override\n".
       "   #: ungraded attempted\n".        "   .  incorrect attempted\n".
               "    : not attempted\n".        "   #  ungraded attempted\n".
       "   x: excused".                "      not attempted (blank field)\n".
         "   x  excused".
               "</pre><p>";                 "</pre><p>"; 
     return $Str;      return $Str;
 }  }

Removed from v.1.8  
changed lines
  Added in v.1.14


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