Commit 997190c9 by ichuang

problem.coffee change: show answer -> also show solution_* & do mathjax typeset

parent a29ad95a
...@@ -48,11 +48,15 @@ class @Problem ...@@ -48,11 +48,15 @@ class @Problem
@$("label[for='input_#{key}_#{choice}']").attr @$("label[for='input_#{key}_#{choice}']").attr
correct_answer: 'true' correct_answer: 'true'
else else
@$("#answer_#{key}").html(value) // needs to be html, not text, for complex solutions (eg coding) @$("#answer_#{key}").html(value) # needs to be html, not text, for complex solutions (eg coding)
@$("#solution_#{key}").html(value) # needs to be html, not text, for complex solutions (eg coding)
MathJax.Hub.Queue ["Typeset", MathJax.Hub]
MathJax.Hub.Queue ["Typeset", MathJax.Hub]
@$('.show').val 'Hide Answer' @$('.show').val 'Hide Answer'
@element.addClass 'showed' @element.addClass 'showed'
else else
@$('[id^=answer_]').text '' @$('[id^=answer_]').text ''
@$('[id^=solution_]').text ''
@$('[correct_answer]').attr correct_answer: null @$('[correct_answer]').attr correct_answer: null
@element.removeClass 'showed' @element.removeClass 'showed'
@$('.show').val 'Show Answer' @$('.show').val 'Show Answer'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment