WARNING: ".
+ &Apache::lonnet::logthis("WARNING: ".
"Could not tie coursemap $fn for $uri.");
}
- return $errtext;
+ &Apache::lonmsg::author_res_msg($ENV{'request.course.uri'},$errtext);
+# ------------------------------------------------- Check for critical messages
+
+ my @what=&Apache::lonnet::dump('critical',$ENV{'user.domain'},
+ $ENV{'user.name'});
+ if ($what[0]) {
+ if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) {
+ $retfurl='/adm/email?critical=display';
+ }
+ }
+ return ($retfurl,$errtext);
+}
+
+# ------------------------------------------------------- Evaluate state string
+
+sub evalstate {
+
+ my $fn=$ENV{'request.course.fn'}.'.state';
+ my $state='2';
+ if (-e $fn) {
+ my @conditions=();
+ {
+ my $fh=Apache::File->new($fn);
+ @conditions=<$fh>;
+ }
+ my $safeeval = new Safe;
+ my $safehole = new Safe::Hole;
+ $safeeval->permit("entereval");
+ $safeeval->permit(":base_math");
+ $safeeval->deny(":base_io");
+ $safehole->wrap(\&Apache::lonnet::EXT,$safeeval,'&EXT');
+ foreach (@conditions) {
+ my $line=$_;
+ chomp($line);
+ my ($condition,$weight)=split(/\:/,$_);
+ if ($safeeval->reval($condition)) {
+ if ($weight eq 'force') {
+ $state.='3';
+ } else {
+ $state.='2';
+ }
+ } else {
+ if ($weight eq 'stop') {
+ $state.='0';
+ } else {
+ $state.='1';
+ }
+ }
+ }
+ }
+ &Apache::lonnet::appenv('user.state.'.$ENV{'request.course.id'} => $state);
+ return $state;
}
-
+
1;
__END__
+=head1 NAME
+
+Apache::lonuserstate - Construct and maintain state and binary representation
+of course for user
+
+=head1 SYNOPSIS
+
+Invoked by lonroles.pm.
+
+&Apache::lonuserstate::readmap($cdom.'/'.$cnum);
+
+=head1 INTRODUCTION
+
+This module constructs and maintains state and binary representation
+of course for user.
+
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
+
+=head1 HANDLER SUBROUTINE
+
+There is no handler subroutine.
+
+=head1 OTHER SUBROUTINES
+
+=over 4
+
+=item *
+
+loadmap() : Loads map from disk
+
+=item *
+
+simplify() : Simplify expression
+
+=item *
+
+traceroute() : Build condition hash
+
+=item *
+
+accinit() : Cascading conditions, quick access, parameters
+=item *
+readmap() : Read map and all submaps
+=item *
+evalstate() : Evaluate state string
+=back
+=cut
500 Internal Server Error
Internal Server Error
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.
More information about this error may be available
in the server error log.