[LON-CAPA-cvs] cvs: loncom /localize/localize newphrases.txt /xml lontexconvert.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 09 Mar 2004 15:53:18 -0000


albertel		Tue Mar  9 10:53:18 2004 EDT

  Modified files:              
    /loncom/localize/localize	newphrases.txt 
    /loncom/xml	lontexconvert.pm 
  Log:
  - BUG#2809, reports of tth going off into an infinite loop, should catch that and kill off the child cleanly.
  
  
  
Index: loncom/localize/localize/newphrases.txt
diff -u loncom/localize/localize/newphrases.txt:1.42 loncom/localize/localize/newphrases.txt:1.43
--- loncom/localize/localize/newphrases.txt:1.42	Fri Mar  5 16:31:07 2004
+++ loncom/localize/localize/newphrases.txt	Tue Mar  9 10:53:18 2004
@@ -64,8 +64,8 @@
 Please click Back on your browser and select another user, or 
 Create User
 Return to DOCS
-[UNDISPLAYABLE]
-[TeX Unconverted Due To Previous Errors]
+UNDISPLAYABLE
+TeX unconverted due to previous errors
 Evaluation Error 
 Submit entries below as answer to receive credit
 Save entries below as a draft answer (not submitting them for credit yet)
@@ -77,4 +77,7 @@
 Currently submitted: <tt>[_1]</tt>
 (Hand in a file you have prepared on your computer)
 Leave blank on scoring form
-Some items were not submitted
\ No newline at end of file
+Some items were not submitted
+#[_1] is the foil name
+Foil name <b><tt>[_1]</tt></b> appears more than once. Foil names need to be unique.
+TeX unconverted due to errors
\ No newline at end of file
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.34 loncom/xml/lontexconvert.pm:1.35
--- loncom/xml/lontexconvert.pm:1.34	Tue Mar  9 10:09:14 2004
+++ loncom/xml/lontexconvert.pm	Tue Mar  9 10:53:18 2004
@@ -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 @@
     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/\<math\>/\<math xmlns=\"\&mathns\;\"\>/g;
@@ -107,10 +112,11 @@
 	}
 	$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()) {