--- loncom/xml/lontexconvert.pm 2004/03/09 15:09:14 1.34 +++ loncom/xml/lontexconvert.pm 2004/03/09 15:53:18 1.35 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # TeX Conversion Module # -# $Id: lontexconvert.pm,v 1.34 2004/03/09 15:09:14 www Exp $ +# $Id: lontexconvert.pm,v 1.35 2004/03/09 15:53:18 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -89,11 +89,16 @@ sub converted { my $texstring=shift; my $xmlstring='['.&mt('UNDISPLAYABLE').']'; if ($Apache::lontexconvert::messedup) { - return &mt('[TeX Unconverted Due To Previous Errors]'); + return '['.&mt('TeX unconverted due to previous errors').']'; } eval(<<'ENDCONV'); { local $SIG{SEGV}=sub { $Apache::lontexconvert::messedup=1; die; }; + local $SIG{ALRM}=sub { + $xmlstring='['.&mt("TeX unconverted due to errors").']'; + $Apache::lontexconvert::messedup=1; + die &mt("TeX unconverted due to errors"); }; + alarm($Apache::lonnet::perlvar{'lonScriptTimeout'}); if ($ENV{'browser.mathml'}) { $xmlstring=&tth::ttm($$texstring); $xmlstring=~s/\/\/g; @@ -107,10 +112,11 @@ sub converted { } $xmlstring=~s/^\s*//; $xmlstring=~s/\s*$//; + alarm(0); } ENDCONV if ($@) { - $errorstring.=&mt("Evaluation Error ").$@; + $errorstring.=&mt("Evaluation Error: ").$@; $Apache::lontexconvert::messedup=1; } if ($Apache::lontexconvert::messedup || &tth::tthmessedup()) {