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
4110a4e2
Commit
4110a4e2
authored
Dec 21, 2012
by
Victor Shnayder
Committed by
Victor Shnayder
Feb 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect against failure to load MathJax
- e.g. if on a train and don't have access to S3 or the rest of the web
parent
6b468df5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+12
-8
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
4110a4e2
...
...
@@ -11,8 +11,9 @@ class @Problem
$
(
selector
,
@
el
)
bind
:
=>
@
el
.
find
(
'.problem > div'
).
each
(
index
,
element
)
=>
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
]
if
MathJax
?
@
el
.
find
(
'.problem > div'
).
each
(
index
,
element
)
=>
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
]
window
.
update_schematics
()
...
...
@@ -31,8 +32,9 @@ class @Problem
# Dynamath
@
$
(
'input.math'
).
keyup
(
@
refreshMath
)
@
$
(
'input.math'
).
each
(
index
,
element
)
=>
MathJax
.
Hub
.
Queue
[
@
refreshMath
,
null
,
element
]
if
MathJax
?
@
$
(
'input.math'
).
each
(
index
,
element
)
=>
MathJax
.
Hub
.
Queue
[
@
refreshMath
,
null
,
element
]
updateProgress
:
(
response
)
=>
if
response
.
progress_changed
...
...
@@ -230,8 +232,9 @@ class @Problem
showMethod
=
@
inputtypeShowAnswerMethods
[
cls
]
showMethod
(
inputtype
,
display
,
answers
)
if
showMethod
?
@
el
.
find
(
'.problem > div'
).
each
(
index
,
element
)
=>
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
]
if
MathJax
?
@
el
.
find
(
'.problem > div'
).
each
(
index
,
element
)
=>
MathJax
.
Hub
.
Queue
[
"Typeset"
,
MathJax
.
Hub
,
element
]
@
$
(
'.show'
).
val
'Hide Answer'
@
el
.
addClass
'showed'
...
...
@@ -273,7 +276,7 @@ class @Problem
preprocessor_tag
=
"inputtype_"
+
elid
mathjax_preprocessor
=
@
inputtypeDisplays
[
preprocessor_tag
]
if
jax
=
MathJax
.
Hub
.
getAllJax
(
target
)[
0
]
if
MathJax
?
and
jax
=
MathJax
.
Hub
.
getAllJax
(
target
)[
0
]
eqn
=
$
(
element
).
val
()
if
mathjax_preprocessor
eqn
=
mathjax_preprocessor
(
eqn
)
...
...
@@ -286,7 +289,8 @@ class @Problem
$
(
"#
#{
element
.
id
}
_dynamath"
).
val
(
jax
.
root
.
toMathML
''
)
catch
exception
throw
exception
unless
exception
.
restart
MathJax
.
Callback
.
After
[
@
refreshMath
,
jax
],
exception
.
restart
if
MathJax
?
MathJax
.
Callback
.
After
[
@
refreshMath
,
jax
],
exception
.
restart
refreshAnswers
:
=>
@
$
(
'input.schematic'
).
each
(
index
,
element
)
->
...
...
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