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
e324dbaf
Commit
e324dbaf
authored
Sep 09, 2012
by
kimth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mathjax preprocessor is course-specific
parent
64e558e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+11
-3
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
e324dbaf
...
@@ -7,6 +7,11 @@ class @Problem
...
@@ -7,6 +7,11 @@ class @Problem
@
url
=
@
el
.
data
(
'url'
)
@
url
=
@
el
.
data
(
'url'
)
@
render
()
@
render
()
# TODO: Each course should be able to customize the MathJax preprocessor
# through a generic plug-in
if
(
@
id
).
search
(
'6.002x'
)
>=
0
@
mathjax_preprocessor
=
@
mathjax_preprocessor_for_6002x
$
:
(
selector
)
->
$
:
(
selector
)
->
$
(
selector
,
@
el
)
$
(
selector
,
@
el
)
...
@@ -299,12 +304,15 @@ class @Problem
...
@@ -299,12 +304,15 @@ class @Problem
target
=
"display_
#{
element
.
id
.
replace
(
/^input_/
,
''
)
}
"
target
=
"display_
#{
element
.
id
.
replace
(
/^input_/
,
''
)
}
"
if
jax
=
MathJax
.
Hub
.
getAllJax
(
target
)[
0
]
if
jax
=
MathJax
.
Hub
.
getAllJax
(
target
)[
0
]
eqn
=
@
mathjax_preprocessor
(
$
(
element
).
val
())
eqn
=
$
(
element
).
val
()
#eqn = $(element).val()
if
@
mathjax_preprocessor
eqn
=
@
mathjax_preprocessor
(
eqn
)
MathJax
.
Hub
.
Queue
[
'Text'
,
jax
,
eqn
],
MathJax
.
Hub
.
Queue
[
'Text'
,
jax
,
eqn
],
[
@
updateMathML
,
jax
,
element
]
[
@
updateMathML
,
jax
,
element
]
mathjax_preprocessor
:
(
eqn
)
->
# TODO: The 6.002x preprocessor should not be baked into capa/display.coffee, but should be a plug-in
mathjax_preprocessor_for_6002x
:
(
eqn
)
->
###
###
Translate 6.002x conventions for subscripts to standard Latex, e.g.
Translate 6.002x conventions for subscripts to standard Latex, e.g.
'R3' --> 'R_{3}'
'R3' --> 'R_{3}'
...
...
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