LMS MathJax output format Update

MathJax format updated to HTMLorMML instead of SVG
Test files updated in lms.
This commit is contained in:
usama sadiq
2019-05-21 15:08:13 +05:00
parent c1a2a60200
commit 2091535b2d
6 changed files with 13 additions and 9 deletions

View File

@@ -50,6 +50,6 @@ if (typeof MathJax === 'undefined') {
explorer: true
}
};
vendorScript.src = 'https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_CHTML';
vendorScript.src = 'https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML';
document.body.appendChild(vendorScript);
}

View File

@@ -89,5 +89,5 @@
<!-- This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of
MathJax extension libraries -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML"></script>
%endif

View File

@@ -91,7 +91,7 @@ class ProblemPage(PageObject):
"""
def mathjax_present():
""" Returns True if MathJax css is present in the problem body """
mathjax_container = self.q(css="div.problem p .MathJax_SVG")
mathjax_container = self.q(css="div.problem p .MathJax")
return mathjax_container.visible and mathjax_container.present
self.wait_for(
@@ -106,7 +106,7 @@ class ProblemPage(PageObject):
def mathjax_present():
""" Returns True if MathJax css is present inside the preview """
mathjax_container = self.q(css="div.problem div .MathJax_SVG")
mathjax_container = self.q(css="div.problem div .MathJax")
return mathjax_container.visible and mathjax_container.present
self.wait_for(
@@ -120,7 +120,7 @@ class ProblemPage(PageObject):
"""
def mathjax_present():
""" Returns True if MathJax css is present in the problem body """
mathjax_container = self.q(css="div.problem div.problem-hint .MathJax_SVG")
mathjax_container = self.q(css="div.problem div.problem-hint .MathJax")
return mathjax_container.visible and mathjax_container.present
self.wait_for(

View File

@@ -49,7 +49,7 @@ class TabNavPage(PageObject):
"""
Check that MathJax has rendered in tab content
"""
mathjax_container = self.q(css=".static_tab_wrapper .MathJax_SVG")
mathjax_container = self.q(css=".static_tab_wrapper .MathJax")
EmptyPromise(
lambda: mathjax_container.present and mathjax_container.visible,
"MathJax is not visible"

View File

@@ -1008,7 +1008,9 @@ class DiscussionEditorPreviewTest(UniqueCourseTest):
'Text line 2 \n'
'$$e[n]=d_2$$'
)
self.assertEqual(self.page.get_new_post_preview_text(), 'Text line 1\nText line 2')
self.assertEqual(self.page.get_new_post_preview_text(),
'Text line 1\ne[n]=\nd\n1\nText line 2\ne[n]=\nd\n2'
)
def test_inline_mathjax_rendering_in_order(self):
"""
@@ -1023,7 +1025,9 @@ class DiscussionEditorPreviewTest(UniqueCourseTest):
'Text line 2 \n'
'$e[n]=d_2$'
)
self.assertEqual(self.page.get_new_post_preview_text('.wmd-preview > p'), 'Text line 1 Text line 2')
self.assertEqual(self.page.get_new_post_preview_text('.wmd-preview > p'),
'Text line 1\ne[n]=\nd\n1\nText line 2\ne[n]=\nd\n2'
)
def test_mathjax_not_rendered_after_post_cancel(self):
"""