Diff for /loncom/homework/lonhomework.pm between versions 1.131 and 1.134

version 1.131, 2003/05/23 06:25:53 version 1.134, 2003/06/13 20:50:57
Line 225  sub check_access { Line 225  sub check_access {
     }      }
   }    }
   
   if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') &&    #if (($status ne 'CLOSED') && ($Apache::lonhomework::type eq 'exam') &&
       (!$Apache::lonhomework::history{"resource.0.outtoken"})) {    #    (!$Apache::lonhomework::history{"resource.0.outtoken"})) {
       return ('UNCHECKEDOUT','needs to be checked out');    #    return ('UNCHECKEDOUT','needs to be checked out');
   }    #}
   
   
   &Apache::lonxml::debug("sending back :$status:$datemsg:");    &Apache::lonxml::debug("sending back :$status:$datemsg:");
Line 417  sub analyze { Line 417  sub analyze {
     }      }
     &Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state,      &Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state,
   'Analyzing Results');    'Analyzing Results');
     foreach my $part (keys(%allparts)) {      foreach my $part (sort(keys(%allparts))) {
  if (defined(@{ $overall{$part.'.answer'} })) {   if (defined(@{ $overall{$part.'.answer'} })) {
     $request->print('<table><tr><td>Part '.$part.'</td></tr>');      my $num_cols=scalar(@{ $overall{$part.'.answer'}->[0] });
       $request->print('<table><tr><td colspan="'.($num_cols+1).'">Part '.$part.'</td></tr>');
     my %frequency;      my %frequency;
     foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'} })) {      foreach my $answer (sort {$a->[0] <=> $b->[0]} (@{ $overall{$part.'.answer'} })) {
  $frequency{join('\0',@{ $answer })}++;   $frequency{join("\0",@{ $answer })}++;
     }      }
     foreach my $answer (sort {(split('\0',$a))[0] <=> (split('\0',$b))[0]} (keys(%frequency))) {      $request->print('<tr><td colspan="'.($num_cols).'">Answer</td><td>Frequency</td></tr>');
  $request->print('<tr><td>'.      foreach my $answer (sort {(split("\0",$a))[0] <=> (split("\0",$b))[0]} (keys(%frequency))) {
  join('</td><td>',split('\0',$answer)).   $request->print('<tr><td align="right">'.
    join('</td><td align="right">',split("\0",$answer)).
  '</td><td>('.$frequency{$answer}.   '</td><td>('.$frequency{$answer}.
  ')</td></tr>');   ')</td></tr>');
     }      }

Removed from v.1.131  
changed lines
  Added in v.1.134


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