--- loncom/xml/lonxml.pm 2005/02/26 05:37:23 1.357 +++ loncom/xml/lonxml.pm 2005/03/10 02:34:59 1.361 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.357 2005/02/26 05:37:23 albertel Exp $ +# $Id: lonxml.pm,v 1.361 2005/03/10 02:34:59 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -184,7 +184,7 @@ sub xmlend { &Apache::lonxml::newparser($parser,\$discussion,''); return ''; } else { - return $discussion.''; + return $discussion.&Apache::loncommon::endbodytag(); } } @@ -358,8 +358,8 @@ sub xmlparse { my @stack = (); my @parstack = (); - &initdepth; - + &initdepth(); + &init_alarm(); my $finaloutput = &inner_xmlparse($target,\@stack,\@parstack,\@pars, $safeeval,\%style_for_target); @@ -368,6 +368,9 @@ sub xmlparse { } &do_registered_ssi(); if ($Apache::lonxml::counter_changed) { &store_counter() } + if ($ENV{'form.return_only_error_and_warning_counts'}) { + return "$errorcount:$warningcount"; + } return $finaloutput; } @@ -792,6 +795,28 @@ sub default_homework_load { } } +{ + my $alarm_depth; + sub init_alarm { + alarm(0); + $alarm_depth=0; + } + + sub start_alarm { + if ($alarm_depth<1) { + my $old=alarm($Apache::lonnet::perlvar{'lonScriptTimeout'}); + if ($old) { + &Apache::lonxml::error("Cancelled an alarm of $old, this shouldn't occur."); + } + } + $alarm_depth++; + } + + sub end_alarm { + $alarm_depth--; + if ($alarm_depth<1) { alarm(0); } + } +} my $metamode_was; sub startredirection { if (!$Apache::lonxml::redirection) {