[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm /xml londefdef.pm lontexconvert.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 28 Jan 2004 17:16:27 -0000


albertel		Wed Jan 28 12:16:27 2004 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
    /loncom/xml	londefdef.pm lontexconvert.pm 
  Log:
  - consolidated tth init sections
  - course parameter for tth for setting tth parameters
  
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.148 loncom/interface/lonparmset.pm:1.149
--- loncom/interface/lonparmset.pm:1.148	Wed Jan 14 22:18:19 2004
+++ loncom/interface/lonparmset.pm	Wed Jan 28 12:16:27 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.148 2004/01/15 03:18:19 www Exp $
+# $Id: lonparmset.pm,v 1.149 2004/01/28 17:16:27 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1603,7 +1603,9 @@
              'languages' => '<b>'.&mt('Languages used').'</b>',
              'disable_receipt_display'
                  => '<b>'.&mt('Disable display of problem receipts').'</b><br />'.
-                    ' ("<tt>'.&mt('yes').'</tt>" '.&mt('to disable, anything else if not').')'
+                    ' ("<tt>'.&mt('yes').'</tt>" '.&mt('to disable, anything else if not').')',
+	     'tthoptions'
+	         => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'
              ); 
         my @Display_Order = ('url','description','courseid','grading',
                              'default_xml_style','pageseparators',
@@ -1621,6 +1623,7 @@
                              'hideemptyrows',
                              'default_enrollment_start_date',
                              'default_enrollment_end_date',
+			     'tthoptions'
                              );
 	foreach my $parameter (sort(keys(%values))) {
             unless ($parameter =~ m/^internal\./) {
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.193 loncom/xml/londefdef.pm:1.194
--- loncom/xml/londefdef.pm:1.193	Mon Jan 12 10:44:30 2004
+++ loncom/xml/londefdef.pm	Wed Jan 28 12:16:27 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.193 2004/01/12 15:44:30 albertel Exp $
+# $Id: londefdef.pm,v 1.194 2004/01/28 17:16:27 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -151,21 +151,8 @@
 sub start_html {
     my ($target,$token) = @_;
     my $currentstring = '';
-    if ($ENV{'browser.mathml'}) {
-	&tth::ttminit();
-	if ($ENV{'browser.unicode'}) {
-	    &tth::ttmoptions('-L -u1');
-	} else {
-	    &tth::ttmoptions('-L -u0');
-	}
-    } else {
-	&tth::tthinit();
-	if ($ENV{'browser.unicode'}) {
-	    &tth::tthoptions('-L -u1');
-	} else {
-	    &tth::tthoptions('-L -u0');
-	}
-    }
+    my $options=$ENV{'course.'.$ENV{'request.course.id'}.'.tthoptions'};
+    &init_tth();
     if ($target eq 'web' || $target eq 'edit') {
 	$currentstring = &Apache::lonxml::xmlbegin().
 	    &Apache::lonxml::fontsettings();     
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.28 loncom/xml/lontexconvert.pm:1.29
--- loncom/xml/lontexconvert.pm:1.28	Thu Nov  6 10:27:07 2003
+++ loncom/xml/lontexconvert.pm	Wed Jan 28 12:16:27 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # TeX Conversion Module
 #
-# $Id: lontexconvert.pm,v 1.28 2003/11/06 15:27:07 albertel Exp $
+# $Id: lontexconvert.pm,v 1.29 2004/01/28 17:16:27 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -51,24 +51,32 @@
 
 # ====================================================================== Header
 
+sub init_tth {
+    my $options=$ENV{'course.'.$ENV{'request.course.id'}.'.tthoptions'};
+    if ($ENV{'browser.mathml'}) {
+	&tth::ttminit();
+	if ($ENV{'browser.unicode'}) {
+	    &tth::ttmoptions('-L -u1 '.$options);
+	} else {
+	    &tth::ttmoptions('-L -u0 '.$options);
+	}
+    } else {
+	&tth::tthinit();
+	if ($ENV{'browser.unicode'}) {
+	    &tth::tthoptions('-L -u1 '.$options);
+	} else {
+	    &tth::tthoptions('-L -u0 '.$options);
+	}
+    }
+    &Apache::lonnet::logthis("caled and use $options");
+    &Apache::lonnet::logthis("caller ".join(':',caller(0)));
+
+}
+
 sub header {
   $errorstring='';
   my $time=time;
-  if ($ENV{'browser.mathml'}) {
-      &tth::ttminit();
-      if ($ENV{'browser.unicode'}) {
-	  &tth::ttmoptions('-L -u1');
-      } else {
-	  &tth::ttmoptions('-L -u0');
-      }
-  } else {
-      &tth::tthinit();
-      if ($ENV{'browser.unicode'}) {
-	  &tth::tthoptions('-L -u1');
-      } else {
-	  &tth::tthoptions('-L -u0');
-      }
-  }
+  &init_tth();
   return &Apache::lonxml::xmlbegin().
          &Apache::lonxml::fontsettings().
          "\n<head>\n".
@@ -164,21 +172,7 @@
     my $message=shift;
 
     $errorstring='';
-    if ($ENV{'browser.mathml'}) {
-	&tth::ttminit();
-	if ($ENV{'browser.unicode'}) {
-	    &tth::ttmoptions('-L -u1');
-	} else {
-	    &tth::ttmoptions('-L -u0');
-	}
-    } else {
-	&tth::tthinit();
-	if ($ENV{'browser.unicode'}) {
-	    &tth::tthoptions('-L -u1');
-	} else {
-	    &tth::tthoptions('-L -u0');
-	}
-    }
+    &init_tth();
     my $outmessage='';
     my $tex=0;
     foreach (split(/(?:\&lt\;|\<)\/*m\s*(?:\&gt\;|\>)/i,$message)) {