Diff for /loncom/interface/spreadsheet/studentcalc.pm between versions 1.10 and 1.15

version 1.10, 2003/05/29 18:39:58 version 1.15, 2003/07/16 20:30:36
Line 65  my %Exportrows = (); Line 65  my %Exportrows = ();
 my $current_course;  my $current_course;
   
 sub initialize {  sub initialize {
       &Apache::assesscalc::initialize();
     &initialize_sequence_cache();      &initialize_sequence_cache();
 }  }
   
Line 143  sub parent_link { Line 144  sub parent_link {
     return $link;      return $link;
 }  }
   
   sub convenience_links {
       my $self = shift;
       my ($resource) = @_;
       my $symb = &Apache::lonnet::escape($resource->{'symb'});
       my $result = <<"END";
   <a href="/adm/grades?symb=$symb&command=submission" target="LONcatInfo">
       <img src="/adm/lonMisc/subm_button.gif" border=0 />
       </a>
   <a href="/adm/grades?symb=$symb&command=gradingmenu" target="LONcatInfo">
       <img src="/adm/lonMisc/pgrd_button.gif" border=0 />
       </a>
   <a href="/adm/parmset?symb=$symb" target="LONcatInfo">
       <img src="/adm/lonMisc/pprm_button.gif" border=0 />
       </a>
   END
       return $result;
   }
   
 sub outsheet_html {  sub outsheet_html {
     my $self = shift;      my $self = shift;
     my ($r) = @_;      my ($r) = @_;
       my $importcolor = '#FFFFAA';
       my $exportcolor = '#88FF88';
     ####################################      ####################################
     # Get the list of assessment files #      # Get the list of assessment files #
     ####################################      ####################################
Line 162  sub outsheet_html { Line 183  sub outsheet_html {
 <table border="2">  <table border="2">
 <tr>  <tr>
   <th colspan="2" rowspan="2"><font size="+2">Student</font></th>    <th colspan="2" rowspan="2"><font size="+2">Student</font></th>
   <td bgcolor="#FFDDDD" colspan="$num_uneditable">    <td bgcolor="$importcolor" colspan="$num_uneditable">
       <b><font size="+1">Import</font></b></td>        <b><font size="+1">Import</font></b></td>
   <td colspan="$num_left">    <td colspan="$num_left">
       <b><font size="+1">Calculations</font></b></td>        <b><font size="+1">Calculations</font></b></td>
Line 171  END Line 192  END
     my $label_num = 0;      my $label_num = 0;
     foreach (split(//,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')){      foreach (split(//,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')){
         if ($label_num<$num_uneditable) {           if ($label_num<$num_uneditable) { 
             $tableheader .='<td bgcolor="#FFDDDD">';              $tableheader .='<td bgcolor="'.$importcolor.'">';
         } else {          } else {
             $tableheader .='<td>';              $tableheader .='<td>';
         }          }
Line 190  END Line 211  END
         # Print out template row          # Print out template row
         if (exists($ENV{'request.role.adv'}) && $ENV{'request.role.adv'}) {          if (exists($ENV{'request.role.adv'}) && $ENV{'request.role.adv'}) {
             $r->print('<tr><td>Template</td><td>&nbsp;</td>'.              $r->print('<tr><td>Template</td><td>&nbsp;</td>'.
                       $self->html_template_row($num_uneditable)."</tr>\n");                        $self->html_template_row($num_uneditable,
                                                  $importcolor)."</tr>\n");
         }          }
         #          #
         # Print out summary/export row          # Print out summary/export row
         $r->print('<tr><td>Summary</td><td>0</td>'.          $r->print('<tr><td>Summary</td><td>0</td>'.
                   $self->html_export_row()."</tr>\n");                    $self->html_export_row($exportcolor)."</tr>\n");
     }      }
     $r->print("</table>\n");      $r->print("</table>\n");
     #      #
Line 204  END Line 226  END
         $tableheader =<<"END";          $tableheader =<<"END";
 </p><p>  </p><p>
 <table border="2">  <table border="2">
 <tr><th>Row</th><th>Assessment</th>  <tr><th>Row</th><th>&nbsp;</th><th>Assessment</th>
 END  END
     } else {      } else {
         $tableheader =<<"END";          $tableheader =<<"END";
Line 238  END Line 260  END
             my $row_output = '<tr>';              my $row_output = '<tr>';
             if ($editing_is_allowed) {              if ($editing_is_allowed) {
                 $row_output .= '<td>'.$rownum.'</td>';                  $row_output .= '<td>'.$rownum.'</td>';
                   $row_output .= '<td>'.$self->convenience_links($resource).'</td>';
                 $row_output .= '<td>'.                  $row_output .= '<td>'.
                     '<a href="/adm/assesscalc?sname='.$self->{'name'}.                      '<a href="/adm/assesscalc?sname='.$self->{'name'}.
                     '&sdomain='.$self->{'domain'}.                      '&sdomain='.$self->{'domain'}.
Line 258  END Line 281  END
                 $row_output .=                   $row_output .= 
                     '<td colspan="52">Unavailable at this time</td></tr>'."\n";                      '<td colspan="52">Unavailable at this time</td></tr>'."\n";
             } else {              } else {
                 $row_output .= $self->html_row($num_uneditable,$rownum).                  $row_output .= $self->html_row($num_uneditable,$rownum,
                                                  $exportcolor,$importcolor).
                     "</tr>\n";                      "</tr>\n";
             }              }
             $r->print($row_output);              $r->print($row_output);
Line 591  sub export_data { Line 615  sub export_data {
     my $self = shift;      my $self = shift;
     my $student = $self->{'name'}.':'.$self->{'domain'};      my $student = $self->{'name'}.':'.$self->{'domain'};
     if (! exists($Exportrows{$student}) ||      if (! exists($Exportrows{$student}) ||
           ! defined($Exportrows{$student}) ||
           ! defined($Exportrows{$student}->{'data'}) ||
         ! $self->check_expiration_time($Exportrows{$student}->{'time'})) {          ! $self->check_expiration_time($Exportrows{$student}->{'time'})) {
         $self->compute();          $self->compute();
     }      }

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


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