version 1.100, 2002/08/16 18:25:24
|
version 1.100.4.1, 2002/09/27 18:43:10
|
Line 1187 sub rown {
|
Line 1187 sub rown {
|
if ($vl eq '') { |
if ($vl eq '') { |
$vl='<font size=+2 color='.$bgcolor.'>#</font>'; |
$vl='<font size=+2 color='.$bgcolor.'>#</font>'; |
} |
} |
$rowdata.= |
$rowdata.='<td bgcolor='.$bgcolor.'>'; |
'<td bgcolor='.$bgcolor.'><a href="javascript:celledit('.$fm.');">'.$vl. |
if ($ENV{'request.role'} =~ /^st\./) { |
'</a></td>'; |
$rowdata.=$vl; |
|
} else { |
|
$rowdata.='<a href="javascript:celledit('.$fm.');">'. |
|
$vl.'</a>'; |
|
} |
|
$rowdata.='</td>'; |
} else { |
} else { |
$rowdata.='<td bgcolor='.$bgcolor.'> '.$vl.' </td>'; |
$rowdata.='<td bgcolor='.$bgcolor.'> '.$vl.' </td>'; |
} |
} |
Line 1667 sub updateclasssheet {
|
Line 1672 sub updateclasssheet {
|
$name=&Apache::lonnet::unescape($name); |
$name=&Apache::lonnet::unescape($name); |
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'}) { |
# unless ($ENV{'form.showcsv'}) { |
$rowlabel='<font color=red>Data not available: '.$name. |
# $rowlabel='<font color=red>Data not available: '.$name. |
'</font>'; |
# '</font>'; |
} else { |
# } else { |
$rowlabel='ERROR","'.$name. |
# $rowlabel='ERROR","'.$name. |
'","Data not available","","","'; |
# '","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', |
Line 1698 sub updateclasssheet {
|
Line 1703 sub updateclasssheet {
|
unless ($ncount==4) { $rowlabel.=',""'; } |
unless ($ncount==4) { $rowlabel.=',""'; } |
$rowlabel=~s/\"$//; |
$rowlabel=~s/\"$//; |
} |
} |
} |
# } |
$currentlist{&Apache::lonnet::unescape($name)}=$rowlabel; |
$currentlist{&Apache::lonnet::unescape($name)}=$rowlabel; |
} |
} |
} # end of foreach (split(/\&/,$classlst)) |
} # end of foreach (split(/\&/,$classlst)) |
Line 1750 sub updatestudentassesssheet {
|
Line 1755 sub updatestudentassesssheet {
|
my $safeeval=shift; |
my $safeeval=shift; |
my %bighash; |
my %bighash; |
my $stype=&gettype($safeeval); |
my $stype=&gettype($safeeval); |
|
my $uname=&getuname($safeeval); |
|
my $udom =&getudom($safeeval); |
my %current=(); |
my %current=(); |
unless ($updatedata{$ENV{'request.course.fn'}.'_'.$stype}) { |
unless ($updatedata{ |
|
$ENV{'request.course.fn'}.'_'.$stype.'_'.$uname.'_'.$udom}) { |
# -------------------------------------------------------------------- Tie hash |
# -------------------------------------------------------------------- Tie hash |
if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
&GDBM_READER(),0640)) { |
&GDBM_READER(),0640)) { |
Line 1832 sub updatestudentassesssheet {
|
Line 1840 sub updatestudentassesssheet {
|
} elsif ($stype eq 'studentcalc') { |
} elsif ($stype eq 'studentcalc') { |
%current=%allassess; |
%current=%allassess; |
} |
} |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype}= |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype.'_'.$uname.'_'.$udom}= |
join('___;___',%current); |
join('___;___',%current); |
} else { |
} else { |
return 'Could not access course data'; |
return 'Could not access course data'; |
Line 1840 sub updatestudentassesssheet {
|
Line 1848 sub updatestudentassesssheet {
|
# ------------------------------------------------------ Get current from cache |
# ------------------------------------------------------ Get current from cache |
} else { |
} else { |
%current=split(/\_\_\_\;\_\_\_/, |
%current=split(/\_\_\_\;\_\_\_/, |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype}); |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype.'_'.$uname.'_'.$udom}); |
} |
} |
# -------------------- Find discrepancies between the course row table and this |
# -------------------- Find discrepancies between the course row table and this |
# |
# |
Line 2458 sub handler {
|
Line 2466 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
if ($ENV{'request.role'} =~ /^st\./) { |
|
delete $ENV{'form.unewfield'} if (exists($ENV{'form.unewfield'})); |
|
delete $ENV{'form.unewformula'} if (exists($ENV{'form.unewformula'})); |
|
} |
|
|
# ---------------------------------------------------- Global directory configs |
# ---------------------------------------------------- Global directory configs |
|
|
$includedir=$r->dir_config('lonIncludes'); |
$includedir=$r->dir_config('lonIncludes'); |
Line 2503 $tmpdir=$r->dir_config('lonDaemons').'/t
|
Line 2516 $tmpdir=$r->dir_config('lonDaemons').'/t
|
# --------------------------------------------------------------- Screen output |
# --------------------------------------------------------------- Screen output |
|
|
$r->print('<html><head><title>LON-CAPA Spreadsheet</title>'); |
$r->print('<html><head><title>LON-CAPA Spreadsheet</title>'); |
$r->print(<<ENDSCRIPT); |
if ($ENV{'request.role'} !~ /^st\./) { |
|
$r->print(<<ENDSCRIPT); |
<script language="JavaScript"> |
<script language="JavaScript"> |
|
|
function celledit(cn,cf) { |
function celledit(cn,cf) { |
Line 2529 $tmpdir=$r->dir_config('lonDaemons').'/t
|
Line 2543 $tmpdir=$r->dir_config('lonDaemons').'/t
|
|
|
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
|
} |
$r->print('</head><body bgcolor="#FFFFFF">'. |
$r->print('</head><body bgcolor="#FFFFFF">'. |
'<img align=right src=/adm/lonIcons/lonlogos.gif>'. |
'<img align=right src=/adm/lonIcons/lonlogos.gif>'. |
'<h1>LON-CAPA Spreadsheet</h1>'. |
'<h1>LON-CAPA Spreadsheet</h1>'. |
Line 2584 ENDSCRIPT
|
Line 2599 ENDSCRIPT
|
unless (&gettype($asheet) eq 'classcalc') { |
unless (&gettype($asheet) eq 'classcalc') { |
$r->print('<p><b>User:</b> '.&getuname($asheet). |
$r->print('<p><b>User:</b> '.&getuname($asheet). |
'<br><b>Domain:</b> '.&getudom($asheet)); |
'<br><b>Domain:</b> '.&getudom($asheet)); |
if (&getcsec($asheet) eq '-1') { |
# if (&getcsec($asheet) eq '-1') { |
$r->print('<h3><font color=red>'. |
# $r->print('<h3><font color=red>'. |
'Not a student in this course</font></h3>'); |
# 'Not a student in this course</font></h3>'); |
} else { |
# } else { |
$r->print('<br><b>Section/Group:</b> '.&getcsec($asheet)); |
$r->print('<br><b>Section/Group:</b> '.&getcsec($asheet)); |
} |
# } |
if ($ENV{'form.usymb'}) { |
if ($ENV{'form.usymb'}) { |
$r->print('<br><b>Assessment:</b> <tt>'.$ENV{'form.usymb'}.'</tt>'); |
$r->print('<br><b>Assessment:</b> <tt>'.$ENV{'form.usymb'}.'</tt>'); |
} |
} |