version 1.100.4.2, 2002/09/27 20:41:25
|
version 1.101, 2002/08/21 17:18:08
|
Line 822 sub sett {
|
Line 822 sub sett {
|
|
|
# Deal with the normal cells |
# Deal with the normal cells |
foreach (keys(%f)) { |
foreach (keys(%f)) { |
if (exists($f{$_}) && ($_!~/template\_/)) { |
if (($f{$_}) && ($_!~/template\_/)) { |
my $matches=($_=~/^$pattern(\d+)/); |
my $matches=($_=~/^$pattern(\d+)/); |
if (($matches) && ($1)) { |
if (($matches) && ($1)) { |
unless ($f{$_}=~/^\!/) { |
unless ($f{$_}=~/^\!/) { |
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.='<td bgcolor='.$bgcolor.'>'; |
$rowdata.= |
if ($ENV{'request.role'} =~ /^st\./) { |
'<td bgcolor='.$bgcolor.'><a href="javascript:celledit('.$fm.');">'.$vl. |
$rowdata.=$vl; |
'</a></td>'; |
} 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 1672 sub updateclasssheet {
|
Line 1667 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 1703 sub updateclasssheet {
|
Line 1698 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 1755 sub updatestudentassesssheet {
|
Line 1750 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{ |
unless ($updatedata{$ENV{'request.course.fn'}.'_'.$stype}) { |
$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 1840 sub updatestudentassesssheet {
|
Line 1832 sub updatestudentassesssheet {
|
} elsif ($stype eq 'studentcalc') { |
} elsif ($stype eq 'studentcalc') { |
%current=%allassess; |
%current=%allassess; |
} |
} |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype.'_'.$uname.'_'.$udom}= |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype}= |
join('___;___',%current); |
join('___;___',%current); |
} else { |
} else { |
return 'Could not access course data'; |
return 'Could not access course data'; |
Line 1848 sub updatestudentassesssheet {
|
Line 1840 sub updatestudentassesssheet {
|
# ------------------------------------------------------ Get current from cache |
# ------------------------------------------------------ Get current from cache |
} else { |
} else { |
%current=split(/\_\_\_\;\_\_\_/, |
%current=split(/\_\_\_\;\_\_\_/, |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype.'_'.$uname.'_'.$udom}); |
$updatedata{$ENV{'request.course.fn'}.'_'.$stype}); |
} |
} |
# -------------------- Find discrepancies between the course row table and this |
# -------------------- Find discrepancies between the course row table and this |
# |
# |
Line 2466 sub handler {
|
Line 2458 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 2516 $tmpdir=$r->dir_config('lonDaemons').'/t
|
Line 2503 $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>'); |
if ($ENV{'request.role'} !~ /^st\./) { |
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
|
<script language="JavaScript"> |
<script language="JavaScript"> |
|
|
function celledit(cn,cf) { |
function celledit(cn,cf) { |
Line 2543 $tmpdir=$r->dir_config('lonDaemons').'/t
|
Line 2529 $tmpdir=$r->dir_config('lonDaemons').'/t
|
|
|
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
} |
$r->print('</head>'.&Apache::loncommon::bodytag('Grades Spreadsheet'). |
$r->print('</head><body bgcolor="#FFFFFF">'. |
|
'<img align=right src=/adm/lonIcons/lonlogos.gif>'. |
|
'<h1>LON-CAPA Spreadsheet</h1>'. |
|
'<form action="'.$r->uri.'" name=sheet method=post>'. |
'<form action="'.$r->uri.'" name=sheet method=post>'. |
&hiddenfield('uname',$ENV{'form.uname'}). |
&hiddenfield('uname',$ENV{'form.uname'}). |
&hiddenfield('udom',$ENV{'form.udom'}). |
&hiddenfield('udom',$ENV{'form.udom'}). |
Line 2599 ENDSCRIPT
|
Line 2582 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>'); |
} |
} |
} |
} |
|
|
# ---------------------------------------------------------------- Course title |
|
|
|
$r->print('<h1>'. |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.description'}. |
|
'</h1><h3>'.localtime().'</h3>'); |
|
|
|
# ---------------------------------------------------- See if user can see this |
# ---------------------------------------------------- See if user can see this |
|
|
if ((&gettype($asheet) eq 'classcalc') || |
if ((&gettype($asheet) eq 'classcalc') || |