version 1.111, 2002/09/27 18:29:15
|
version 1.115, 2002/10/01 07:09:05
|
Line 62 use GDBM_File;
|
Line 62 use GDBM_File;
|
use HTML::TokeParser; |
use HTML::TokeParser; |
use Apache::lonhtmlcommon; |
use Apache::lonhtmlcommon; |
# |
# |
|
# Caches for coursewide information |
|
# |
|
my %Section; |
|
|
|
# |
# Caches for previously calculated spreadsheets |
# Caches for previously calculated spreadsheets |
# |
# |
|
|
Line 852 sub sett {
|
Line 857 sub sett {
|
} |
} |
# Deal with the normal cells |
# Deal with the normal cells |
foreach (keys(%f)) { |
foreach (keys(%f)) { |
if (($f{$_}) && ($_!~/template\_/)) { |
if (exists($f{$_}) && ($_!~/template\_/)) { |
my $matches=($_=~/^$pattern(\d+)/); |
my $matches=($_=~/^$pattern(\d+)/); |
if (($matches) && ($1)) { |
if (($matches) && ($1)) { |
unless ($f{$_}=~/^\!/) { |
unless ($f{$_}=~/^\!/) { |
Line 1467 sub makenewsheet {
|
Line 1472 sub makenewsheet {
|
$sheetdata{'sheettype'} = $stype; |
$sheetdata{'sheettype'} = $stype; |
$sheetdata{'usymb'} = $usymb; |
$sheetdata{'usymb'} = $usymb; |
$sheetdata{'cid'} = $ENV{'request.course.id'}; |
$sheetdata{'cid'} = $ENV{'request.course.id'}; |
$sheetdata{'csec'} = &Apache::lonnet::usection |
$sheetdata{'csec'} = $Section{$uname.':'.$udom}; |
($udom,$uname,$ENV{'request.course.id'}); |
|
$sheetdata{'coursefilename'} = $ENV{'request.course.fn'}; |
$sheetdata{'coursefilename'} = $ENV{'request.course.fn'}; |
$sheetdata{'cnum'} = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
$sheetdata{'cnum'} = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
$sheetdata{'cdom'} = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
$sheetdata{'cdom'} = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
Line 1646 sub parmval {
|
Line 1650 sub parmval {
|
my $courselevelr = $usercourseprefix.'.'.$symbparm; |
my $courselevelr = $usercourseprefix.'.'.$symbparm; |
my $courselevelm = $usercourseprefix.'.'.$mapparm; |
my $courselevelm = $usercourseprefix.'.'.$mapparm; |
# fourth, check user |
# fourth, check user |
if ($uname) { |
if (defined($uname)) { |
return $useropt{$courselevelr} if ($useropt{$courselevelr}); |
return $useropt{$courselevelr} if (defined($useropt{$courselevelr})); |
return $useropt{$courselevelm} if ($useropt{$courselevelm}); |
return $useropt{$courselevelm} if (defined($useropt{$courselevelm})); |
return $useropt{$courselevel} if ($useropt{$courselevel}); |
return $useropt{$courselevel} if (defined($useropt{$courselevel})); |
} |
} |
# third, check course |
# third, check course |
if ($csec) { |
if (defined($csec)) { |
return $courseopt{$seclevelr} if ($courseopt{$seclevelr}); |
return $courseopt{$seclevelr} if (defined($courseopt{$seclevelr})); |
return $courseopt{$seclevelm} if ($courseopt{$seclevelm}); |
return $courseopt{$seclevelm} if (defined($courseopt{$seclevelm})); |
return $courseopt{$seclevel} if ($courseopt{$seclevel}); |
return $courseopt{$seclevel} if (defined($courseopt{$seclevel})); |
} |
} |
# |
# |
return $courseopt{$courselevelr} if ($courseopt{$courselevelr}); |
return $courseopt{$courselevelr} if (defined($courseopt{$courselevelr})); |
return $courseopt{$courselevelm} if ($courseopt{$courselevelm}); |
return $courseopt{$courselevelm} if (defined($courseopt{$courselevelm})); |
return $courseopt{$courselevel} if ($courseopt{$courselevel}); |
return $courseopt{$courselevel} if (defined($courseopt{$courselevel})); |
# second, check map parms |
# second, check map parms |
my $thisparm = $parmhash{$symbparm}; |
my $thisparm = $parmhash{$symbparm}; |
return $thisparm if ($thisparm); |
return $thisparm if (defined($thisparm)); |
# first, check default |
# first, check default |
return &Apache::lonnet::metadata($fn,$rwhat.'.default'); |
return &Apache::lonnet::metadata($fn,$rwhat.'.default'); |
} |
} |
Line 1676 sub updateclasssheet {
|
Line 1680 sub updateclasssheet {
|
my $cid =$sheetdata->{'cid'}; |
my $cid =$sheetdata->{'cid'}; |
my $chome =$sheetdata->{'chome'}; |
my $chome =$sheetdata->{'chome'}; |
# |
# |
|
%Section = (); |
|
|
|
# |
# Read class list and row labels |
# Read class list and row labels |
my %classlist; |
my %classlist; |
my @tmp = &Apache::lonnet::dump('classlist',$cdom,$cnum); |
my @tmp = &Apache::lonnet::dump('classlist',$cdom,$cnum); |
Line 1699 sub updateclasssheet {
|
Line 1706 sub updateclasssheet {
|
my ($studentName,$studentDomain)=split(/\:/,$student); |
my ($studentName,$studentDomain)=split(/\:/,$student); |
my $studentSection=&Apache::lonnet::usection($studentDomain, |
my $studentSection=&Apache::lonnet::usection($studentDomain, |
$studentName,$cid); |
$studentName,$cid); |
|
$Section{$studentName.':'.$studentDomain} = $studentSection; |
# if ($studentSection==-1) { |
# if ($studentSection==-1) { |
# unless ($ENV{'form.showcsv'}) { |
# unless ($ENV{'form.showcsv'}) { |
# $rowlabel='<font color=red>Data not available: '. |
# $rowlabel='<font color=red>Data not available: '. |
Line 2088 sub loadassessment {
|
Line 2096 sub loadassessment {
|
&Apache::lonnet::reply('dump:'.$udom.':'.$uname.':resourcedata',$uhome); |
&Apache::lonnet::reply('dump:'.$udom.':'.$uname.':resourcedata',$uhome); |
if ($reply!~/^error\:/) { |
if ($reply!~/^error\:/) { |
$userrdatas{$uname.'___'.$udom}=$reply; |
$userrdatas{$uname.'___'.$udom}=$reply; |
$userrdatas{$uname.'___'.$udom.'.last_cache'}=time; |
|
} |
} |
|
# Most of the time the user does not have a 'resourcedata.db' |
|
# file. We need to cache that we got nothing instead of bothering |
|
# with requesting it every time. |
|
$userrdatas{$uname.'___'.$udom.'.last_cache'}=time; |
} |
} |
foreach (split(/\&/,$userrdatas{$uname.'___'.$udom})) { |
foreach (split(/\&/,$userrdatas{$uname.'___'.$udom})) { |
my ($name,$value)=split(/\=/,$_); |
my ($name,$value)=split(/\=/,$_); |