--- loncom/interface/Attic/lonspreadsheet.pm 2002/12/04 21:49:33 1.154
+++ loncom/interface/Attic/lonspreadsheet.pm 2002/12/05 15:31:05 1.155
@@ -1,5 +1,5 @@
#
-# $Id: lonspreadsheet.pm,v 1.154 2002/12/04 21:49:33 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.155 2002/12/05 15:31:05 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1284,6 +1284,7 @@ sub html_uneditable_cell {
sub outsheet_html {
my ($sheet,$r) = @_;
my ($num_uneditable,$realm,$row_type);
+ my $requester_is_student = ($ENV{'request.role'} =~ /^st\./);
if ($sheet->{'sheettype'} eq 'assesscalc') {
$num_uneditable = 1;
$realm = 'Assessment';
@@ -1328,34 +1329,39 @@ END
####################################
# Print out template row
####################################
- my ($rowlabel,@rowdata) = &get_row($sheet,'-');
- my $row_html = '
'.&format_html_rowlabel($sheet,$rowlabel).' | ';
- my $num_cols_output = 0;
- foreach my $cell (@rowdata) {
- if ($num_cols_output++ < $num_uneditable) {
- $row_html .= '';
- $row_html .= &html_uneditable_cell($cell,'#FFDDDD');
- } else {
- $row_html .= ' | ';
- $row_html .= &html_editable_cell($cell,'#E0FFDD');
+ my ($num_cols_output,$row_html,$rowlabel,@rowdata);
+
+ if (! $requester_is_student) {
+ ($rowlabel,@rowdata) = &get_row($sheet,'-');
+ $row_html = ' |
'.&format_html_rowlabel($sheet,$rowlabel).' | ';
+ $num_cols_output = 0;
+ foreach my $cell (@rowdata) {
+ if ($requester_is_student ||
+ $num_cols_output++ < $num_uneditable) {
+ $row_html .= '';
+ $row_html .= &html_uneditable_cell($cell,'#FFDDDD');
+ } else {
+ $row_html .= ' | ';
+ $row_html .= &html_editable_cell($cell,'#E0FFDD');
+ }
+ $row_html .= ' | ';
}
- $row_html .= '';
+ $row_html.= "
\n";
+ $r->print($row_html);
}
- $row_html.= "\n";
- $r->print($row_html);
####################################
# Print out summary/export row
####################################
($rowlabel,@rowdata) = &get_row($sheet,'0');
- $row_html = ''.&format_html_rowlabel($sheet,$rowlabel).' | ';
+ $row_html = '
'.&format_html_rowlabel($sheet,'Summary').' | ';
$num_cols_output = 0;
foreach my $cell (@rowdata) {
- if ($num_cols_output++ < 26) {
+ if ($num_cols_output++ < 26 && ! $requester_is_student) {
$row_html .= '';
$row_html .= &html_editable_cell($cell,'#CCCCFF');
} else {
$row_html .= ' | ';
- $row_html .= &html_uneditable_cell(undef,'#CCCCFF');
+ $row_html .= &html_uneditable_cell($cell,'#CCCCFF');
}
$row_html .= ' | ';
}
@@ -1432,7 +1438,7 @@ END
$bgcolor='#FFDDDD' if ($shown_cells < $num_uneditable);
#
$row_html.='';
- if ($shown_cells < $num_uneditable) {
+ if ($requester_is_student || $shown_cells < $num_uneditable) {
$row_html .= &html_uneditable_cell($cell,$bgcolor);
} else {
$row_html .= &html_editable_cell($cell,$bgcolor);
|