Fixed MathJax rendering in problem hint

TNL-2857
This commit is contained in:
Awais Jibran
2015-07-23 19:30:26 +05:00
parent cb3140e953
commit 0cda1aaffb
3 changed files with 77 additions and 3 deletions

View File

@@ -711,7 +711,13 @@ class @Problem
else
next_index = parseInt(hint_index) + 1
$.postWithPrefix "#{@url}/hint_button", hint_index: next_index, input_id: @id, (response) =>
@$('.problem-hint').html(response.contents)
@$('.problem-hint').attr('hint_index', response.hint_index)
hint_container = @.$('.problem-hint')
hint_container.html(response.contents)
MathJax.Hub.Queue [
'Typeset'
MathJax.Hub
hint_container[0]
]
hint_container.attr('hint_index', response.hint_index)
@$('.hint-button').focus() # a11y focus on click, like the Check button