--- loncom/xml/lonxml.pm 2001/02/13 00:13:47 1.50
+++ loncom/xml/lonxml.pm 2001/02/14 02:57:02 1.53
@@ -333,7 +333,8 @@ sub parstring {
map {
unless ($_=~/\W/) {
my $val=$token->[2]->{$_};
- if ($val =~ m/^[\%\@]/) { $val="\\".$val; }
+ $val =~ s/([\%\@\\])/\\$1/g;
+ #if ($val =~ m/^[\%\@]/) { $val="\\".$val; }
$temp .= "my \$$_=\"$val\";"
}
} @{$token->[3]};
@@ -405,7 +406,25 @@ sub debug {
}
sub error {
- print "ERROR:".$_[0]."
\n";
+ if ($Apache::lonxml::debug eq 1) {
+ print "ERROR:".$_[0]."
\n";
+ } else {
+ print "An Error occured while processing this resource. The instructor has been notified.
";
+ #notify author
+ &Apache::lonmsg::author_res_msg($ENV{'request.filename'},$_[0]);
+ #notify course
+ if ( $ENV{'request.course.id'} ) {
+ my $users=$ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'};
+ foreach my $user (split /\,/, $users) {
+ ($user,my $domain) = split /:/, $user;
+ &Apache::lonmsg::user_crit_msg($user,$domain,"Error in $ENV{'request.filename'}",$_[0]);
+ }
+ }
+
+ #FIXME probably shouldn't have me get everything forever.
+ &Apache::lonmsg::user_crit_msg('albertel','msu',"Error in $ENV{'request.filename'}",$_[0]);
+ #&Apache::lonmsg::user_crit_msg('albertel','103',"Error in $ENV{'request.filename'}",$_[0]);
+ }
}
sub warning {