version 1.299, 2004/01/30 17:27:34
|
version 1.300, 2004/02/05 21:00:15
|
Line 1296 sub display_title {
|
Line 1296 sub display_title {
|
sub debug { |
sub debug { |
if ($Apache::lonxml::debug eq "1") { |
if ($Apache::lonxml::debug eq "1") { |
$|=1; |
$|=1; |
Apache->request->print('<font size="-2"<pre>DEBUG:'.&HTML::Entities::encode($_[0])."</pre></font>\n"); |
my $request=$Apache::lonxml::request; |
|
if (!$request) { $request=Apache->request; } |
|
$request->print('<font size="-2"><pre>DEBUG:'.&HTML::Entities::encode($_[0])."</pre></font>\n"); |
} |
} |
} |
} |
|
|
sub error { |
sub error { |
$errorcount++; |
$errorcount++; |
|
my $request=$Apache::lonxml::request; |
|
if (!$request) { $request=Apache->request; } |
if (($Apache::lonxml::debug eq 1) || ($ENV{'request.state'} eq 'construct') ) { |
if (($Apache::lonxml::debug eq 1) || ($ENV{'request.state'} eq 'construct') ) { |
# If printing in construction space, put the error inside <pre></pre> |
# If printing in construction space, put the error inside <pre></pre> |
print $Apache::lonxml::warnings_error_header. |
$request->print($Apache::lonxml::warnings_error_header. |
"<b>ERROR:</b>".join("\n",@_)."\n"; |
"<b>ERROR:</b>".join("\n",@_)."\n"); |
$Apache::lonxml::warnings_error_header=''; |
$Apache::lonxml::warnings_error_header=''; |
} else { |
} else { |
print "<b>An Error occured while processing this resource. The instructor has been notified.</b> <br />"; |
$request->print("<b>An Error occured while processing this resource. The instructor has been notified.</b> <br />"); |
#notify author |
#notify author |
&Apache::lonmsg::author_res_msg($ENV{'request.filename'},join('<br />',@_)); |
&Apache::lonmsg::author_res_msg($ENV{'request.filename'},join('<br />',@_)); |
#notify course |
#notify course |
Line 1333 sub warning {
|
Line 1337 sub warning {
|
|
|
if ($ENV{'form.grade_target'} ne 'tex') { |
if ($ENV{'form.grade_target'} ne 'tex') { |
if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) { |
if ($ENV{'request.state'} eq 'construct' || $Apache::lonxml::debug) { |
print $Apache::lonxml::warnings_error_header. |
my $request=$Apache::lonxml::request; |
"<b>W</b>ARNING<b>:</b>".join('<br />',@_)."<br />\n"; |
if (!$request) { $request=Apache->request; } |
|
$request->print($Apache::lonxml::warnings_error_header. |
|
"<b>W</b>ARNING<b>:</b>".join('<br />',@_)."<br />\n"); |
$Apache::lonxml::warnings_error_header=''; |
$Apache::lonxml::warnings_error_header=''; |
} |
} |
} |
} |