version 1.70, 2001/10/17 21:11:22
|
version 1.71, 2001/10/17 22:09:53
|
Line 677 sub rown {
|
Line 677 sub rown {
|
} else { |
} else { |
$defaultbg='#E0FF'; |
$defaultbg='#E0FF'; |
} |
} |
$rowdata.="\n<tr><td><b><font size=+1>$n</font></b></td>"; |
unless ($ENV{'form.showcsv'}) { |
|
$rowdata.="\n<tr><td><b><font size=+1>$n</font></b></td>"; |
|
} else { |
|
$rowdata.="\n".'"'.$n.'"'; |
|
} |
my $showf=0; |
my $showf=0; |
my $proc; |
my $proc; |
my $maxred; |
my $maxred; |
Line 700 sub rown {
|
Line 704 sub rown {
|
if ((($vl ne '') || ($vl eq '0')) && |
if ((($vl ne '') || ($vl eq '0')) && |
(($showf==1) || ($sheettype ne 'studentcalc'))) { $dataflag=1; } |
(($showf==1) || ($sheettype ne 'studentcalc'))) { $dataflag=1; } |
if ($showf==0) { $vl=$_; } |
if ($showf==0) { $vl=$_; } |
|
unless ($ENV{'form.showcsv'}) { |
if ($showf<=$maxred) { $bgcolor='#FFDDDD'; } |
if ($showf<=$maxred) { $bgcolor='#FFDDDD'; } |
if (($n==0) && ($showf<=26)) { $bgcolor='#CCCCFF'; } |
if (($n==0) && ($showf<=26)) { $bgcolor='#CCCCFF'; } |
if (($showf>$maxred) || ((!$n) && ($showf>0))) { |
if (($showf>$maxred) || ((!$n) && ($showf>0))) { |
Line 712 sub rown {
|
Line 717 sub rown {
|
} else { |
} else { |
$rowdata.='<td bgcolor='.$bgcolor.'> '.$vl.' </td>'; |
$rowdata.='<td bgcolor='.$bgcolor.'> '.$vl.' </td>'; |
} |
} |
|
} else { |
|
$rowdata.=',"'.$vl.'"'; |
|
} |
$showf++; |
$showf++; |
} $safeeval->reval($proc.'('.$n.')'); |
} $safeeval->reval($proc.'('.$n.')'); |
if ($ENV{'form.showall'} || ($dataflag)) { |
if ($ENV{'form.showall'} || ($dataflag)) { |
return $rowdata.'</tr>'; |
return $rowdata.($ENV{'form.showcsv'}?'':'</tr>'); |
} else { |
} else { |
return ''; |
return ''; |
} |
} |
Line 738 sub outsheet {
|
Line 746 sub outsheet {
|
$realm='Course'; |
$realm='Course'; |
} |
} |
my $maxyellow=52-$maxred; |
my $maxyellow=52-$maxred; |
my $tabledata= |
my $tabledata; |
|
unless ($ENV{'form.showcsv'}) { |
|
$tabledata= |
'<table border=2><tr><th colspan=2 rowspan=2><font size=+2>'. |
'<table border=2><tr><th colspan=2 rowspan=2><font size=+2>'. |
$realm.'</font></th>'. |
$realm.'</font></th>'. |
'<td bgcolor=#FFDDDD colspan='.$maxred. |
'<td bgcolor=#FFDDDD colspan='.$maxred. |
Line 758 sub outsheet {
|
Line 768 sub outsheet {
|
'N','O','P','Q','R','S','T','U','V','W','X','Y','Z', |
'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', |
'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'); |
'n','o','p','q','r','s','t','u','v','w','x','y','z'); |
$tabledata.='</tr>'; |
$tabledata.='</tr>'.&rown($safeeval,'-').&rown($safeeval,0); |
|
} else { $tabledata='<pre>'; } |
|
|
|
$r->print($tabledata); |
|
|
my $row; |
my $row; |
my $maxrow=&getmaxrow($safeeval); |
my $maxrow=&getmaxrow($safeeval); |
$tabledata.=&rown($safeeval,'-').&rown($safeeval,0); |
|
$r->print($tabledata); |
|
|
|
my @sortby=(); |
my @sortby=(); |
my @sortidx=(); |
my @sortidx=(); |
Line 783 sub outsheet {
|
Line 795 sub outsheet {
|
for ($row=0;$row<$maxrow;$row++) { |
for ($row=0;$row<$maxrow;$row++) { |
my $thisrow=&rown($safeeval,$sortidx[$row]+1); |
my $thisrow=&rown($safeeval,$sortidx[$row]+1); |
if ($thisrow) { |
if ($thisrow) { |
if ($n/25==int($n/25)) { |
if (($n/25==int($n/25)) && (!$ENV{'form.showcsv'})) { |
$r->print("</table>\n<br>\n"); |
$r->print("</table>\n<br>\n"); |
$r->rflush(); |
$r->rflush(); |
$r->print('<table border=2><tr><td> <td>'.$what.'</td>'); |
$r->print('<table border=2><tr><td> <td>'.$what.'</td>'); |
Line 799 sub outsheet {
|
Line 811 sub outsheet {
|
$r->print($thisrow); |
$r->print($thisrow); |
} |
} |
} |
} |
$r->print('</table>'); |
$r->print($ENV{'form.showcsv'}?'</pre>':'</table>'); |
} |
} |
|
|
# |
# |
Line 1141 sub updateclasssheet {
|
Line 1153 sub updateclasssheet {
|
my ($sname,$sdom)=split(/\:/,$name); |
my ($sname,$sdom)=split(/\:/,$name); |
my $ssec=&Apache::lonnet::usection($sdom,$sname,$cid); |
my $ssec=&Apache::lonnet::usection($sdom,$sname,$cid); |
if ($ssec==-1) { |
if ($ssec==-1) { |
|
unless ($ENV{'form.showcsv'}) { |
$rowlabel='<font color=red>Data not available: '.$name. |
$rowlabel='<font color=red>Data not available: '.$name. |
'</font>'; |
'</font>'; |
|
} else { |
|
$rowlabel='ERROR","'.$name. |
|
'","Data not available","","","'; |
|
} |
} else { |
} else { |
my %reply=&Apache::lonnet::idrget($sdom,$sname); |
my %reply=&Apache::lonnet::idrget($sdom,$sname); |
my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname. |
my $reply=&Apache::lonnet::reply('get:'.$sdom.':'.$sname. |
':environment:firstname&middlename&lastname&generation', |
':environment:firstname&middlename&lastname&generation', |
&Apache::lonnet::homeserver($sname,$sdom)); |
&Apache::lonnet::homeserver($sname,$sdom)); |
|
unless ($ENV{'form.showcsv'}) { |
$rowlabel='<a href="/adm/studentcalc?uname='.$sname. |
$rowlabel='<a href="/adm/studentcalc?uname='.$sname. |
'&udom='.$sdom.'">'. |
'&udom='.$sdom.'">'. |
$ssec.' '.$reply{$sname}.'<br>'; |
$ssec.' '.$reply{$sname}.'<br>'; |
Line 1155 sub updateclasssheet {
|
Line 1173 sub updateclasssheet {
|
$rowlabel.=&Apache::lonnet::unescape($_).' '; |
$rowlabel.=&Apache::lonnet::unescape($_).' '; |
} split(/\&/,$reply); |
} split(/\&/,$reply); |
$rowlabel.='</a>'; |
$rowlabel.='</a>'; |
|
} else { |
|
$rowlabel=$ssec.'","'.$reply{$sname}.'"'; |
|
my $ncount=0; |
|
map { |
|
$rowlabel.=',"'.&Apache::lonnet::unescape($_).'"'; |
|
$ncount++; |
|
} split(/\&/,$reply); |
|
unless ($ncount==4) { $rowlabel.=',""'; } |
|
$rowlabel=~s/\"$//; |
|
} |
} |
} |
$currentlist{&Apache::lonnet::unescape($name)}=$rowlabel; |
$currentlist{&Apache::lonnet::unescape($name)}=$rowlabel; |
} |
} |