[LON-CAPA-cvs] cvs: rat /client parameter.html loncom loncapa_apache.conf loncom/interface lonparmset.pm loncom/publisher packages.tab loncom/xml lontex.pm

raeburn raeburn at source.lon-capa.org
Fri Dec 22 08:38:03 EST 2023


raeburn		Fri Dec 22 13:38:03 2023 EDT

  Modified files:              
    /loncom/xml	lontex.pm 
    /loncom/publisher	packages.tab 
    /loncom/interface	lonparmset.pm 
    /loncom	loncapa_apache.conf 
    /rat/client	parameter.html 
  Log:
  - .tex file in Resource Space or uploaded to Main Content area:
    - texdisplay parameter can determine whether TtH of MathJax is used for
      conversion (web context) 
    - values in effect for contentopen, contentclose, and acc params honored
  
  
Index: loncom/xml/lontex.pm
diff -u loncom/xml/lontex.pm:1.13 loncom/xml/lontex.pm:1.14
--- loncom/xml/lontex.pm:1.13	Mon Nov 24 17:17:52 2008
+++ loncom/xml/lontex.pm	Fri Dec 22 13:38:01 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # TeX Content Handler
 #
-# $Id: lontex.pm,v 1.13 2008/11/24 17:17:52 jms Exp $
+# $Id: lontex.pm,v 1.14 2023/12/22 13:38:01 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -103,8 +103,15 @@
 						($env{'form.inhibitmenu'} 
 						 eq 'yes'), }));
 
+  my $displaymode;
+  if (&Apache::lonnet::EXT('resource.0.texdisplay') =~ /^(tth|mathjax)$/i) {
+      $displaymode = $1;
+  }
+  if ($env{'form.texengine'} =~ /^(tth|mathjax)$/i) {
+      $displaymode = $1;
+  }
   $r->print(&Apache::lontexconvert::converted(\$texstring,
-					      $env{'form.texengine'}));
+					      $displaymode));
   $r->print(&footer());
 
   return OK;
Index: loncom/publisher/packages.tab
diff -u loncom/publisher/packages.tab:1.82 loncom/publisher/packages.tab:1.83
--- loncom/publisher/packages.tab:1.82	Sat Feb  4 22:38:32 2023
+++ loncom/publisher/packages.tab	Fri Dec 22 13:38:02 2023
@@ -179,6 +179,10 @@
 extension_html&cssfile&display:CSS file to link
 extension_html&cssfile&type:string
 
+import_defaults&extension_tex:1
+extension_tex&texdisplay&display:TeX File Display
+extension_tex&texdisplay&type:string_tex
+
 standardLTI&contentopen&display:Content Opening Date
 standardLTI&contentopen&type:date_start
 standardLTI&contentclose&display:Content Close Date
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.620 loncom/interface/lonparmset.pm:1.621
--- loncom/interface/lonparmset.pm:1.620	Mon May 22 21:10:55 2023
+++ loncom/interface/lonparmset.pm	Fri Dec 22 13:38:02 2023
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.620 2023/05/22 21:10:55 raeburn Exp $
+# $Id: lonparmset.pm,v 1.621 2023/12/22 13:38:02 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2482,6 +2482,7 @@
         'lenient' => 'grading',
         'retrypartial' => 'tries',
         'discussvote'  => 'misc',
+        'texdisplay' => 'misc',
         'examcode' => 'high_level_randomization',
     );
 }
@@ -3711,7 +3712,7 @@
             'date_interval','int','float','string','string_lenient',
             'string_examcode','string_deeplink','string_discussvote',
             'string_useslots','string_problemstatus','string_ip',
-            'string_questiontype') {
+            'string_questiontype','string_tex') {
         $r->print('<input type="hidden" value="'.
             &HTML::Entities::encode($env{'form.recent_'.$item},'"&<>').
             '" name="recent_'.$item.'" />');
@@ -4472,6 +4473,8 @@
                         if ($thiskey =~ /\.retrypartial$/) {
                             $name = 'retrypartial';
                         }
+                    } elsif ($typeof eq 'string_tex') {
+                        $name = 'texdisplay';
                     }
                 } elsif ($cmd eq 'datepointer') {
                     $data=&Apache::lonhtmlcommon::get_date_from_form($env{$key});
@@ -5546,6 +5549,9 @@
                  ['_denyfrom_','Hostname(s) or IP(s) from which access is disallowed']], 
      'string_deeplink'
              => [['on','Set choices for link protection, resource listing, access scope, shown menu items, embedding, and exit link']],
+     'string_tex'
+             => [['tth', 'tth (TeX to HTML)'],
+                 ['mathjax', 'MathJax']],
     );
    
 
@@ -5567,6 +5573,7 @@
                     examcode     => 'string_examcode',
                     acc          => 'string_ip',
                     deeplink     => 'string_deeplink',
+                    texdisplay   => 'string_tex',
                   );
 
 # Returns the possible values and titles for a given string type, or undef if there are none.
@@ -5627,6 +5634,7 @@
             ($thistype eq 'string_discussvote') ||
             ($thistype eq 'string_ip') ||
             ($thistype eq 'string_deeplink') ||
+            ($thistype eq 'string_tex') ||
             ($name eq 'retrypartial')) {
         my ($got_chostname,$chostname,$cmajor,$cminor); 
         foreach my $possibilities (@{ $strings{$thistype} }) {
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.284 loncom/loncapa_apache.conf:1.285
--- loncom/loncapa_apache.conf:1.284	Fri Nov  3 01:12:17 2023
+++ loncom/loncapa_apache.conf	Fri Dec 22 13:38:02 2023
@@ -2,7 +2,7 @@
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
 
-# $Id: loncapa_apache.conf,v 1.284 2023/11/03 01:12:17 raeburn Exp $
+# $Id: loncapa_apache.conf,v 1.285 2023/12/22 13:38:02 raeburn Exp $
 
 #
 # LON-CAPA Section (extensions to httpd.conf daemon configuration)
@@ -193,6 +193,13 @@
 PerlHandler Apache::lonsequence
 </LocationMatch>
 
+<LocationMatch "^/+uploaded/.*/.*/docs/.*\.tex$">
+SetHandler perl-script
+PerlHandler Apache::londatecheck
+PerlHandler Apache::lonipcheck
+PerlHandler Apache::lontex
+</LocationMatch>
+
 <LocationMatch "^/+public/.*/syllabus$">
 PerlAccessHandler      Apache::publiccheck
 AuthType LONCAPA
@@ -433,7 +440,7 @@
 PerlCleanupHandler	Apache::lonacc::cleanup
 </LocationMatch>
 
-<LocationMatch "^/+res.*\.tex$">
+<LocationMatch "^/+res/.*\.tex$">
 SetHandler perl-script
 PerlHandler Apache::lontex
 </LocationMatch>
Index: rat/client/parameter.html
diff -u rat/client/parameter.html:1.90 rat/client/parameter.html:1.91
--- rat/client/parameter.html:1.90	Thu Jul  7 03:37:02 2022
+++ rat/client/parameter.html	Fri Dec 22 13:38:03 2023
@@ -5,7 +5,7 @@
 The LearningOnline Network with CAPA
 Parameter Input Window
 //
-// $Id: parameter.html,v 1.90 2022/07/07 03:37:02 raeburn Exp $
+// $Id: parameter.html,v 1.91 2023/12/22 13:38:03 raeburn Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -1138,6 +1138,18 @@
            if (svalue=='no') { choicewrite(' checked="checked"'); }
            choicewrite(' /> No</label><br />');
         }
+        if (pscat=='tex') {
+           tablestart('TeX file display');
+           choicewrite('<tr><td>Value:</td><td colspan="2">');
+           choicewrite('<label><input name="stringval" value="tth"'+
+                  ' type="radio" '+callradiostringeval('tth'));
+           if (svalue=='tth') { choicewrite(' checked="checked"'); }
+           choicewrite(' /> tth (TeX to HTML)</label><br />');
+           choicewrite('<label><input name="stringval" value="mathjax"'+
+                  ' type="radio" '+callradiostringeval('mathjax'));
+           if (svalue=='mathjax') { choicewrite(' checked="checked"'); }
+           choicewrite(' /> MathJax</label><br />');
+        }
         if (pscat=='ip') {
             var currallow = new Array;
             var currdeny = new Array;
@@ -1835,6 +1847,7 @@
      else if (pscat == 'fileext')      { sopt('fileext','File Extension'); }
      else if (pscat == 'useslots')     { sopt('useslots','Slots control access'); }
      else if (pscat == 'deeplink')     { sopt('deeplink','Deep-linked items'); }
+     else if (pscat == 'tex')   { sopt('texdisplay','TeX File Display'); }
      else { pscat = 'any'; }
      if (pscat != 'deeplink') { sopt('any','String Value'); }
   }




More information about the LON-CAPA-cvs mailing list