[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Sun Sep 5 01:55:50 EDT 2021


raeburn		Sun Sep  5 05:55:50 2021 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
    /loncom/homework	inputtags.pm 
  Log:
  - Bug 6953 
    Run MathJax typesetting again after Previous Tries modal window opened. 
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1364 loncom/interface/loncommon.pm:1.1365
--- loncom/interface/loncommon.pm:1.1364	Sat Aug  7 20:49:11 2021
+++ loncom/interface/loncommon.pm	Sun Sep  5 05:55:50 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1364 2021/08/07 20:49:11 raeburn Exp $
+# $Id: loncommon.pm,v 1.1365 2021/09/05 05:55:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9314,7 +9314,15 @@
 }
 
 sub modal_adhoc_script {
-    my ($funcname,$width,$height,$content)=@_;
+    my ($funcname,$width,$height,$content,$possmathjax)=@_;
+    my $mathjax;
+    if ($possmathjax) {
+        $mathjax = <<'ENDJAX';
+               if (typeof MathJax == 'object') {
+                   MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
+               }
+ENDJAX
+    }
     return (<<ENDADHOC);
 <script type="text/javascript">
 // <![CDATA[
@@ -9325,6 +9333,7 @@
                 modalWindow.height = $height;
                 modalWindow.content = '$content';
                 modalWindow.open();
+                $mathjax
         };  
 // ]]>
 </script>
@@ -9332,7 +9341,7 @@
 }
 
 sub modal_adhoc_inner {
-    my ($funcname,$width,$height,$content)=@_;
+    my ($funcname,$width,$height,$content,$possmathjax)=@_;
     my $innerwidth=$width-20;
     $content=&js_ready(
                  &start_page('Dialog',undef,{'only_body'=>1,'bgcolor'=>'#FFFFFF'}).
@@ -9341,12 +9350,12 @@
                  &end_scrollbox().
                  &end_page()
              );
-    return &modal_adhoc_script($funcname,$width,$height,$content);
+    return &modal_adhoc_script($funcname,$width,$height,$content,$possmathjax);
 }
 
 sub modal_adhoc_window {
-    my ($funcname,$width,$height,$content,$linktext)=@_;
-    return &modal_adhoc_inner($funcname,$width,$height,$content).
+    my ($funcname,$width,$height,$content,$linktext,$possmathjax)=@_;
+    return &modal_adhoc_inner($funcname,$width,$height,$content,$possmathjax).
            "<a href=\"javascript:$funcname();void(0);\">".$linktext."</a>";
 }
 
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.352 loncom/homework/inputtags.pm:1.353
--- loncom/homework/inputtags.pm:1.352	Thu Nov 21 14:48:31 2019
+++ loncom/homework/inputtags.pm	Sun Sep  5 05:55:50 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.352 2019/11/21 14:48:31 raeburn Exp $
+# $Id: inputtags.pm,v 1.353 2021/09/05 05:55:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1916,7 +1916,9 @@
         $function_name .= &js_escape($id);
     }
     $function_name .= '_'.$Apache::lonxml::counter;
-    my $result = &Apache::loncommon::modal_adhoc_window($function_name,420,410,$output,&mt($tries_text))."<br />";
+    my $possmathjax = 1;
+    my $result = &Apache::loncommon::modal_adhoc_window($function_name,420,410,$output,
+                                                        &mt($tries_text),$possmathjax)."<br />";
     return $result;
 }
 




More information about the LON-CAPA-cvs mailing list