-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
Submitting ajax-exercises throws a JS error when embedded into course material. When grading results come back, an a-plus-refresh-stats event is emitted, the handler for the event tries to update an #exercise-info element, which only exists on standalone exercise pages.
FIX: Add a check to see if the element is present before trying to run the .load function.
a-plus/exercise/templates/exercise/exercise.html
Lines 94 to 103 in 7290300
| window.addEventListener("message", function (event) { | |
| if (event.data.type === "a-plus-refresh-stats") { | |
| $("#submit-progress").addClass("hide"); | |
| var $stats = $("#exercise-info"), | |
| url = $stats.data("url"); | |
| $stats.load(url, function() { | |
| $stats.find('[data-toggle="tooltip"]').tooltip(); | |
| }); | |
| } | |
| }); |
Metadata
Metadata
Assignees
Labels
No labels
