--- loncom/interface/Attic/lonspreadsheet.pm 2001/09/11 20:50:04 1.61 +++ loncom/interface/Attic/lonspreadsheet.pm 2001/09/12 21:07:20 1.62 @@ -6,7 +6,7 @@ # 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/19,03/20,03/21,03/27,04/05,04/09, -# 07/09,07/14,07/21,09/01,09/10,9/11 Gerd Kortemeyer +# 07/09,07/14,07/21,09/01,09/10,9/11,9/12 Gerd Kortemeyer package Apache::lonspreadsheet; @@ -676,6 +676,7 @@ sub rown { } else { $defaultbg='#E0FF'; } + my $headerrow=''; if ((($n-1)/25)==int(($n-1)/25)) { my $what='Student'; if (&gettype($safeeval) eq 'assesscalc') { @@ -683,27 +684,28 @@ sub rown { } elsif (&gettype($safeeval) eq 'studentcalc') { $what='Assessment'; } - $rowdata.="\n
". + $headerrow.="
\n
". ''; map { - $rowdata.=''; + $headerrow.=''; } ('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'); - $rowdata.=''; + $headerrow.=''; } $rowdata.="\n"; my $showf=0; my $proc; my $maxred; - if (&gettype($safeeval) eq 'studentcalc') { + my $sheettype=&gettype($safeeval); + if ($sheettype eq 'studentcalc') { $proc='&outrowassess'; $maxred=26; } else { $proc='&outrow'; } - if (&gettype($safeeval) eq 'assesscalc') { + if ($sheettype eq 'assesscalc') { $maxred=1; } else { $maxred=26; @@ -712,7 +714,8 @@ sub rown { map { my $bgcolor=$defaultbg.((($showf-1)/5==int(($showf-1)/5))?'99':'DD'); my ($fm,$vl)=split(/\_\_\_eq\_\_\_/,$_); - if ($vl ne '') { $dataflag=1; } + if ((($vl ne '') || ($vl eq '0')) && + (($showf==1) || ($sheettype ne 'studentcalc'))) { $dataflag=1; } if ($showf==0) { $vl=$_; } if ($showf<=$maxred) { $bgcolor='#FFDDDD'; } if (($n==0) && ($showf<=26)) { $bgcolor='#CCCCFF'; } @@ -729,9 +732,9 @@ sub rown { $showf++; } $safeeval->reval($proc.'('.$n.')'); if ($ENV{'form.showall'} || ($dataflag)) { - return $rowdata.''; + return $headerrow.$rowdata.''; } else { - return ''; + return $headerrow; } } @@ -2117,8 +2120,12 @@ ENDSCRIPT &tmpwrite($asheet); - $r->print( - '
Show empty rows: print('
Show rows with empty A column: '); + } else { + $r->print('
Show empty rows: '); + } + $r->print('print(' checked'); } $r->print('>');
 '.$what.''.$_.''.$_.'
$n