[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm /xml lontexconvert.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 19 Jun 2007 20:11:17 -0000
albertel Tue Jun 19 16:11:17 2007 EDT
Modified files:
/loncom/xml lontexconvert.pm
/loncom/interface lonparmset.pm
Log:
- add ability for a course to specify a tex engine to be used in the course,
currently overrides user's setting if they have one.
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.82 loncom/xml/lontexconvert.pm:1.83
--- loncom/xml/lontexconvert.pm:1.82 Tue Jun 12 20:21:03 2007
+++ loncom/xml/lontexconvert.pm Tue Jun 19 16:10:55 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# TeX Conversion Module
#
-# $Id: lontexconvert.pm,v 1.82 2007/06/13 00:21:03 albertel Exp $
+# $Id: lontexconvert.pm,v 1.83 2007/06/19 20:10:55 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -205,11 +205,24 @@
}
}
+sub tex_engine {
+ if (exists($env{'form.texengine'})) {
+ return $env{'form.texengine'};
+ }
+ if ($env{'request.course.id'}
+ && exists($env{'course.'.$env{'request.course.id'}.'.texengine'})) {
+ return $env{'course.'.$env{'request.course.id'}.'.texengine'};
+ }
+ if (exists($env{'environment.texengine'})) {
+ return $env{'environment.texengine'};
+ }
+ return 'tth';
+}
+
sub init_math_support {
&init_tth();
&Apache::lontexconvert::jsMath_push();
- if ($env{'environment.texengine'} eq 'jsMath' ||
- $env{'form.texengine'} eq 'jsMath' ) {
+ if (lc(&tex_engine()) eq 'jsmath') {
return &Apache::lontexconvert::jsMath_header();
}
return;
@@ -233,7 +246,7 @@
sub converted {
my ($string,$mode)=@_;
- if ($mode eq '') { $mode=$env{'environment.texengine'}; }
+ if ($mode eq '') { $mode = &tex_engine(); }
if ($mode =~ /tth/i) {
return &tth_converted($string);
} elsif ($mode =~ /jsmath/i) {
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.366 loncom/interface/lonparmset.pm:1.367
--- loncom/interface/lonparmset.pm:1.366 Wed Jun 6 16:19:38 2007
+++ loncom/interface/lonparmset.pm Tue Jun 19 16:11:14 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.366 2007/06/06 20:19:38 albertel Exp $
+# $Id: lonparmset.pm,v 1.367 2007/06/19 20:11:14 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2249,7 +2249,10 @@
'externalsyllabus'
=> '<b>'.&mt('URL of Syllabus (not using internal handler)').'</b>',
'tthoptions'
- => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>'
+ => '<b>'.&mt('Default set of options to pass to tth/m when converting tex').'</b>',
+
+ 'texengine'
+ => '<b>'.&mt('Force all studnets in the course to use a specific math rendering engine.').'</b><br />'.&mt('(Valid options are [_1].)','"tth", "jsMath", "mimetex"').'</b>',
);
my @Display_Order = ('url','description','courseid','cloners','grading',
'externalsyllabus',
@@ -2276,6 +2279,7 @@
'default_enrollment_start_date',
'default_enrollment_end_date',
'tthoptions',
+ 'texengine',
'disablesigfigs',
'disableexampointprint',
'task_messages'