Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.62 and 1.63

version 1.62, 2001/09/12 21:07:20 version 1.63, 2001/09/13 15:55:40
Line 6 Line 6
 # 01/01/01,02/01,03/01,19/01,20/01,22/01,  # 01/01/01,02/01,03/01,19/01,20/01,22/01,
 # 03/05,03/08,03/10,03/12,03/13,03/15,03/17,  # 03/05,03/08,03/10,03/12,03/13,03/15,03/17,
 # 03/19,03/20,03/21,03/27,04/05,04/09,  # 03/19,03/20,03/21,03/27,04/05,04/09,
 # 07/09,07/14,07/21,09/01,09/10,9/11,9/12 Gerd Kortemeyer  # 07/09,07/14,07/21,09/01,09/10,9/11,9/12,9/13 Gerd Kortemeyer
   
 package Apache::lonspreadsheet;  package Apache::lonspreadsheet;
                           
Line 676  sub rown { Line 676  sub rown {
     } else {      } else {
        $defaultbg='#E0FF';         $defaultbg='#E0FF';
     }      }
     my $headerrow='';  
     if ((($n-1)/25)==int(($n-1)/25)) {  
         my $what='Student';  
         if (&gettype($safeeval) eq 'assesscalc') {  
     $what='Item';  
  } elsif (&gettype($safeeval) eq 'studentcalc') {  
             $what='Assessment';  
         }  
  $headerrow.="</table>\n<br><table border=2>".  
         '<tr><td>&nbsp;<td>'.$what.'</td>';  
         map {  
            $headerrow.='<td>'.$_.'</td>';  
         } ('A','B','C','D','E','F','G','H','I','J','K','L','M',  
            'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',  
            'a','b','c','d','e','f','g','h','i','j','k','l','m',  
            'n','o','p','q','r','s','t','u','v','w','x','y','z');  
         $headerrow.='</tr>';  
     }  
     $rowdata.="\n<tr><td><b><font size=+1>$n</font></b></td>";      $rowdata.="\n<tr><td><b><font size=+1>$n</font></b></td>";
     my $showf=0;      my $showf=0;
     my $proc;      my $proc;
Line 732  sub rown { Line 714  sub rown {
        $showf++;         $showf++;
     } $safeeval->reval($proc.'('.$n.')');      } $safeeval->reval($proc.'('.$n.')');
     if ($ENV{'form.showall'} || ($dataflag)) {      if ($ENV{'form.showall'} || ($dataflag)) {
        return $headerrow.$rowdata.'</tr>';         return $rowdata.'</tr>';
     } else {      } else {
        return $headerrow;         return '';
     }      }
 }  }
   
Line 780  sub outsheet { Line 762  sub outsheet {
     my $maxrow=&getmaxrow($safeeval);      my $maxrow=&getmaxrow($safeeval);
     $tabledata.=&rown($safeeval,'-');      $tabledata.=&rown($safeeval,'-');
     $r->print($tabledata);      $r->print($tabledata);
       my @rowprt=();
       for ($row=0;$row<=$maxrow;$row++) {
           $rowprt[$row]=&rown($safeeval,$row);
       }
       my $n=0;
     for ($row=0;$row<=$maxrow;$row++) {      for ($row=0;$row<=$maxrow;$row++) {
         $r->print(&rown($safeeval,$row));       if ($rowprt[$row]) {
         if ((($n-1)/25)==int(($n-1)/25)) {
           my $what='Student';
           if (&gettype($safeeval) eq 'assesscalc') {
       $what='Item';
    } elsif (&gettype($safeeval) eq 'studentcalc') {
               $what='Assessment';
           }
    $r->print("</table>\n<br><table border=2>".
           '<tr><td>&nbsp;<td>'.$what.'</td>');
           map {
              $r->print('<td>'.$_.'</td>');
           } ('A','B','C','D','E','F','G','H','I','J','K','L','M',
              'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
              'a','b','c','d','e','f','g','h','i','j','k','l','m',
              'n','o','p','q','r','s','t','u','v','w','x','y','z');
           $r->print('</tr>');
          }
            $n++;
            $r->print($rowprt[$row]);
         }
     }      }
     $r->print('</table>');      $r->print('</table>');
       undef @rowprt;
 }  }
   
 #  #

Removed from v.1.62  
changed lines
  Added in v.1.63


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