diff --git a/app/assets/javascripts/exercise.js b/app/assets/javascripts/exercise.js index 9acea50121..a9f2f4c79e 100644 --- a/app/assets/javascripts/exercise.js +++ b/app/assets/javascripts/exercise.js @@ -7,10 +7,12 @@ function init_exercise_show(exerciseId, loggedIn, tests) { centerImagesAndTables(); + // create feedback table var feedbackTable = new FeedbackTable(tests); $("#feedback-loading").hide(); + // test source code if button is clicked on editor panel $("#editor-process-btn").click(function () { // test submitted source code @@ -34,8 +36,6 @@ function init_exercise_show(exerciseId, loggedIn, tests) { $('#exercise-feedback-link').tab('show'); }); - MathJax.Hub.Typeset(); - // hide/show correct test cases if button is clicked in menu on feedback // panel $("#feedback-menu-toggle-correct").click(function () { @@ -51,6 +51,13 @@ function init_exercise_show(exerciseId, loggedIn, tests) { $(this).dropdown('toggle'); return false; }); + + MathJax.Hub.Queue(function() { + /* MathJax has not been run yet*/ + if ($('span.MathJax').length === 0) { + MathJax.Hub.Queue(["Typeset",MathJax.Hub]); + } + }); } function initEditor() { diff --git a/app/views/exercises/show.html.erb b/app/views/exercises/show.html.erb index e7ed3823ff..6b7b4b70c9 100644 --- a/app/views/exercises/show.html.erb +++ b/app/views/exercises/show.html.erb @@ -23,9 +23,11 @@
+ <% if user_signed_in? %> + <% end %>