version 1.10, 2000/10/02 16:16:06
|
version 1.14, 2000/10/31 19:31:42
|
Line 11
|
Line 11
|
# 7/1,7/3,7/4,7/7,7/8,7/10 Gerd Kortemeyer) |
# 7/1,7/3,7/4,7/7,7/8,7/10 Gerd Kortemeyer) |
# |
# |
# 7/15,7/17,7/18,8/1,8/2,8/4,8/5,8/21,8/22,8/23,8/30, |
# 7/15,7/17,7/18,8/1,8/2,8/4,8/5,8/21,8/22,8/23,8/30, |
# 9/2,9/4,9/29,9/30,10/2 Gerd Kortemeyer |
# 9/2,9/4,9/29,9/30,10/2,10/11,10/30,10/31 Gerd Kortemeyer |
|
|
package Apache::lonuserstate; |
package Apache::lonuserstate; |
|
|
Line 21 use Apache::File;
|
Line 21 use Apache::File;
|
use HTML::TokeParser; |
use HTML::TokeParser; |
use Apache::lonnet(); |
use Apache::lonnet(); |
use GDBM_File; |
use GDBM_File; |
|
use Apache::lonmsg; |
|
|
# ---------------------------------------------------- Globals for this package |
# ---------------------------------------------------- Globals for this package |
|
|
Line 249 sub accinit {
|
Line 250 sub accinit {
|
map { |
map { |
my $sub=$_; |
my $sub=$_; |
my $orig=$_; |
my $orig=$_; |
$sub=~/\(\((\d+\&(:?\d+\&)*)(?:\d+\&*)+\)(?:\|\(\1(?:\d+\&*)+\))+\)/; |
$sub=~/\(\((\d+\&(:?\d+\&)*)(?:\d+\&*)+\)(?:\|\(\1(?:\d+\&*)+\))+\)/; |
my $factor=$1; |
my $factor=$1; |
$sub=~s/$factor//g; |
$sub=~s/$factor//g; |
$sub=~s/^\(/\($factor\(/; |
$sub=~s/^\(/\($factor\(/; |
Line 268 sub accinit {
|
Line 269 sub accinit {
|
} keys %hash; |
} keys %hash; |
map { |
map { |
if ($_=~/^ids/) { |
if ($_=~/^ids/) { |
my $resid=$hash{$_}; |
map { |
|
my $resid=$_; |
my $uri=$hash{'src_'.$resid}; |
my $uri=$hash{'src_'.$resid}; |
my @uriparts=split(/\//,$uri); |
my @uriparts=split(/\//,$uri); |
my $urifile=$uriparts[$#uriparts]; |
my $urifile=$uriparts[$#uriparts]; |
$#uriparts--; |
$#uriparts--; |
my $uripath=join('/',@uriparts); |
my $uripath=join('/',@uriparts); |
$uripath=~s/^\/res\///; |
$uripath=~s/^\/res\///; |
|
my $uricond='0'; |
if (defined($hash{'conditions_'.$resid})) { |
if (defined($hash{'conditions_'.$resid})) { |
$urifile.=':'.$captured{$hash{'conditions_'.$resid}}; |
$uricond=$captured{$hash{'conditions_'.$resid}}; |
} else { |
|
$urifile.=':0'; |
|
} |
} |
if (defined($acchash{'acc.res.'.$short.'.'.$uripath})) { |
if (defined($acchash{'acc.res.'.$short.'.'.$uripath})) { |
$acchash{'acc.res.'.$short.'.'.$uripath}.=$urifile.'&'; |
if ($acchash{'acc.res.'.$short.'.'.$uripath}=~ |
|
/(\&$urifile\:[^\&]*)/) { |
|
my $replace=$1; |
|
$acchash{'acc.res.'.$short.'.'.$uripath} |
|
=~s/$replace/$replace\|$uricond/; |
|
} else { |
|
$acchash{'acc.res.'.$short.'.'.$uripath}.= |
|
$urifile.':'.$uricond.'&'; |
|
} |
} else { |
} else { |
$acchash{'acc.res.'.$short.'.'.$uripath}='&'.$urifile.'&'; |
$acchash{'acc.res.'.$short.'.'.$uripath}= |
} |
'&'.$urifile.':'.$uricond.'&'; |
} |
} |
|
} split(/\,/,$hash{$_}); |
|
} |
} keys %hash; |
} keys %hash; |
my $courseuri=$uri; |
my $courseuri=$uri; |
$courseuri=~s/^\/res\///; |
$courseuri=~s/^\/res\///; |
|
&Apache::lonnet::delenv('(acc\.|httpref\.)'); |
&Apache::lonnet::appenv(%acchash, |
&Apache::lonnet::appenv(%acchash, |
"request.course.id" => $short, |
"request.course.id" => $short, |
"request.course.fn" => $fn, |
"request.course.fn" => $fn, |
Line 310 sub readmap {
|
Line 322 sub readmap {
|
return 'No course data available.'; |
return 'No course data available.'; |
} |
} |
@cond=('true:normal'); |
@cond=('true:normal'); |
|
unlink($fn.'.db'); |
|
unlink($fn.'_symb.db'); |
|
unlink($fn.'.state'); |
if (tie(%hash,'GDBM_File',"$fn.db",&GDBM_WRCREAT,0640)) { |
if (tie(%hash,'GDBM_File',"$fn.db",&GDBM_WRCREAT,0640)) { |
%hash=(); |
%hash=(); |
$errtext=''; |
$errtext=''; |
Line 336 sub readmap {
|
Line 351 sub readmap {
|
&Apache::lonnet::logthis("<font color=blue>WARNING: ". |
&Apache::lonnet::logthis("<font color=blue>WARNING: ". |
"Could not tie coursemap $fn for $uri.</font>"); |
"Could not tie coursemap $fn for $uri.</font>"); |
} |
} |
|
&Apache::lonmsg::author_res_msg($ENV{'request.course.uri'},$errtext); |
return $errtext; |
return $errtext; |
} |
} |
|
|