[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet assesscalc.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 27 May 2003 20:20:25 -0000


matthew		Tue May 27 16:20:25 2003 EDT

  Modified files:              
    /loncom/interface/spreadsheet	assesscalc.pm 
  Log:
  Fix display/editability of cells in assessment sheet.
  
  
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.9 loncom/interface/spreadsheet/assesscalc.pm:1.10
--- loncom/interface/spreadsheet/assesscalc.pm:1.9	Fri May 23 17:03:29 2003
+++ loncom/interface/spreadsheet/assesscalc.pm	Tue May 27 16:20:25 2003
@@ -1,5 +1,5 @@
 #
-# $Id: assesscalc.pm,v 1.9 2003/05/23 21:03:29 matthew Exp $
+# $Id: assesscalc.pm,v 1.10 2003/05/27 20:20:25 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -418,7 +418,7 @@
 	    $r->print("</table>\n".$tableheader);
 	}
 	$r->print('<tr><td>'.$rownum.'</td>'.
-                  $self->assess_html_row($num_uneditable,$rownum)."</tr>\n");
+                  $self->assess_html_row($rownum)."</tr>\n");
     }
     $r->print("</table>\n");
     return;
@@ -426,7 +426,7 @@
 
 sub assess_html_row {
     my $self = shift();
-    my ($num_uneditable,$row) = @_;
+    my ($row) = @_;
     my $parameter_name = $self->{'formulas'}->{'A'.$row};
     my @rowdata = $self->get_row($row);
     my $num_cols_output = 0;
@@ -439,9 +439,17 @@
         $row_html .= '<td>'.$parameter_name.'</td>';
     }
     foreach my $cell (@rowdata) {
-        $row_html .= '<td bgcolor="#EOFFDD">';
-        $row_html .= &Apache::Spreadsheet::html_editable_cell($cell,'#E0FFDD');
+        if ($num_cols_output < 1) {
+            $row_html .= '<td bgcolor="#FFDDDD">';
+            $row_html .= &Apache::Spreadsheet::html_uneditable_cell($cell,
+                                                                    '#FFDDDD');
+        } else {
+            $row_html .= '<td bgcolor="#EOFFDD">';
+            $row_html .= &Apache::Spreadsheet::html_editable_cell($cell,
+                                                                  '#E0FFDD',1);
+        }
 	$row_html .= '</td>';
+        $num_cols_output++;
     }
     return $row_html;
 }