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
f9d58db5
Commit
f9d58db5
authored
Jun 01, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
template for textinput dynamath (separate from textinput.html)
parent
b4f8473c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
templates/textinput_dynamath.html
+51
-0
No files found.
templates/textinput_dynamath.html
0 → 100644
View file @
f9d58db5
###
### version of textline.html which does dynammic math
###
<section
class=
"text-input-dynamath"
>
<table><tr><td>
<input
type=
"text"
name=
"input_${id}"
id=
"input_${id}"
value=
"${value}"
%
if
size:
size=
"${size}"
%
endif
onkeyup=
"DoUpdateMath('${id}')"
/>
</td><td>
<span
id=
"answer_${id}"
></span>
% if state == 'unsubmitted':
<span
class=
"unanswered"
style=
"display:inline-block;"
id=
"status_${id}"
></span>
% elif state == 'correct':
<span
class=
"correct"
id=
"status_${id}"
></span>
% elif state == 'incorrect':
<span
class=
"incorrect"
id=
"status_${id}"
></span>
% elif state == 'incomplete':
<span
class=
"incorrect"
id=
"status_${id}"
></span>
% endif
</td></tr><tr><td>
<span
id=
"display_${id}"
>
`{::}`
</span>
</td><td>
<textarea
style=
"display:none"
id=
"input_${id}_dynamath"
name=
"input_${id}_dynamath"
>
none
</textarea>
</td></tr>
</table>
##
## javascript for dynamic math: add this math element to the MathJax rendering queue
## also adds to global jaxset js array
##
<script>
MathJax
.
Hub
.
queue
.
Push
(
function
()
{
math
=
MathJax
.
Hub
.
getAllJax
(
"display_${id}"
)[
0
];
if
(
math
){
jaxset
[
"${id}"
]
=
math
;
math
.
Text
(
document
.
getElementById
(
"input_${id}_dynamath"
).
defaultValue
);
// initial render
UpdateMathML
(
math
,
"${id}"
);
// initial MathML
}
});
</script>
% if msg:
<br/>
<span
class=
"debug"
>
${msg|n}
</span>
% endif
</section>
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