Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a72d4a04
Commit
a72d4a04
authored
Jan 07, 2016
by
Awais Jibran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable MathJax in Course Pages
TNL-3968
parent
e8925972
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
common/test/acceptance/pages/lms/tab_nav.py
+10
-0
common/test/acceptance/tests/lms/test_lms.py
+13
-1
lms/templates/courseware/static_tab.html
+5
-0
No files found.
common/test/acceptance/pages/lms/tab_nav.py
View file @
a72d4a04
...
...
@@ -36,6 +36,16 @@ class TabNavPage(PageObject):
self
.
wait_for_page
()
self
.
_is_on_tab_promise
(
tab_name
)
.
fulfill
()
def
mathjax_has_rendered
(
self
):
"""
Check that MathJax has rendered in tab content
"""
mathjax_container
=
self
.
q
(
css
=
".static_tab_wrapper .MathJax .math"
)
EmptyPromise
(
lambda
:
mathjax_container
.
present
and
mathjax_container
.
visible
,
"MathJax is not visible"
)
.
fulfill
()
def
is_on_tab
(
self
,
tab_name
):
"""
Return a boolean indicating whether the current tab is `tab_name`.
...
...
common/test/acceptance/tests/lms/test_lms.py
View file @
a72d4a04
...
...
@@ -571,7 +571,7 @@ class HighLevelTabTest(UniqueCourseTest):
course_fix
.
add_handout
(
'demoPDF.pdf'
)
course_fix
.
add_children
(
XBlockFixtureDesc
(
'static_tab'
,
'Test Static Tab'
),
XBlockFixtureDesc
(
'static_tab'
,
'Test Static Tab'
,
data
=
r"static tab data with mathjax \(E=mc^2\)"
),
XBlockFixtureDesc
(
'chapter'
,
'Test Section'
)
.
add_children
(
XBlockFixtureDesc
(
'sequential'
,
'Test Subsection'
)
.
add_children
(
XBlockFixtureDesc
(
'problem'
,
'Test Problem 1'
,
data
=
load_data_str
(
'multiple_choice.xml'
)),
...
...
@@ -631,6 +631,18 @@ class HighLevelTabTest(UniqueCourseTest):
self
.
tab_nav
.
go_to_tab
(
'Test Static Tab'
)
self
.
assertTrue
(
self
.
tab_nav
.
is_on_tab
(
'Test Static Tab'
))
def
test_static_tab_with_mathjax
(
self
):
"""
Navigate to a static tab (course content)
"""
# From the course info page, navigate to the static tab
self
.
course_info_page
.
visit
()
self
.
tab_nav
.
go_to_tab
(
'Test Static Tab'
)
self
.
assertTrue
(
self
.
tab_nav
.
is_on_tab
(
'Test Static Tab'
))
# Verify that Mathjax has rendered
self
.
tab_nav
.
mathjax_has_rendered
()
def
test_wiki_tab_first_time
(
self
):
"""
Navigate to the course wiki tab. When the wiki is accessed for
...
...
lms/templates/courseware/static_tab.html
View file @
a72d4a04
...
...
@@ -6,6 +6,11 @@
<
%
static:css
group=
'style-course-vendor'
/>
<
%
static:css
group=
'style-course'
/>
</
%
block>
<
%
block
name=
"js_extra"
>
<
%
include
file=
"/mathjax_include.html"
args=
"disable_fast_preview=True"
/>
</
%
block>
<
%
block
name=
"pagetitle"
>
${tab['name']} | ${course.display_number_with_default | h}
</
%
block>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment