[LON-CAPA-cvs] cvs: loncom /interface lonpreferences.pm

raeburn raeburn at source.lon-capa.org
Fri Aug 8 20:17:30 EDT 2025


raeburn		Sat Aug  9 00:17:30 2025 EDT

  Modified files:              
    /loncom/interface	lonpreferences.pm 
  Log:
  - Show current domain default for math display and tell unprivileged users
    that instructors can override user's preferred choice for math display. 
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.248 loncom/interface/lonpreferences.pm:1.249
--- loncom/interface/lonpreferences.pm:1.248	Fri Mar  7 02:13:40 2025
+++ loncom/interface/lonpreferences.pm	Sat Aug  9 00:17:30 2025
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.248 2025/03/07 02:13:40 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.249 2025/08/09 00:17:30 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -179,7 +179,7 @@
     my $MathJax_start=&Apache::lontexconvert::MathJax_header();
     my %lt=&Apache::lonlocal::texthash(
       'headline' => 'Change how math is displayed',
-      'preftxt'  => 'Preferred method to display math',
+      'preftxt'  => 'Your preferred method to display math',
       'change'   => 'Save',
       'exmpl'    => 'Examples',
       'mathjax'  => 'MathJax:',
@@ -188,8 +188,28 @@
       'mimetex'  => 'mimetex (Convert to Images):',
     );
 
+    my ($defaultmsg,$precedence);
+    my $default = $mathchoices{'MathJax'};
+    my %domdefaults = &Apache::lonnet::get_domain_defaults($domain);
+    if (($domdefaults{'texengine'} ne '') &&
+        (exists($mathchoices{$domdefaults{'texengine'}}))) {
+        $default = $mathchoices{$domdefaults{'texengine'}};
+    }
+    $defaultmsg = '<span class="LC_fontsize_medium">'.
+                  &mt('Default for [_1] is [_2]',
+                      &Apache::lonnet::domain($domain,'description'),
+                      '<b>'.$default.'</b>').
+                  '</span>';
+    unless ($env{'user.adv'}) {
+        $precedence =
+            '<span class="LC_fontsize_medium">'.
+            &mt("Your instructor can set a course's math display.").' '.
+            &mt('When set that will apply when you view course content.').
+            '</span>';
+    }
     $r->print(<<ENDLSCREEN);
 <h2>$lt{'headline'}</h2>
+$defaultmsg
 <form name="prefs" action="/adm/preferences" method="post">
 <input type="hidden" name="action" value="verify_and_change_texengine" />
 <p>
@@ -199,6 +219,7 @@
 </p>
 </form>
 <br />
+$precedence
 <hr />
 $lt{'exmpl'}
 




More information about the LON-CAPA-cvs mailing list