Khan/khan-exercises — comment on commit 87c2c5c6ddbe59f6bf9f06fc5ac33f2453e096c0
File: khan-exercise.js line 971
By divad12:

Good point. I don't want to always empty it, though, because that style tag `head #exercise-inline-style` is pre-filled by a server-side template in `exercises.py:ViewExercise.get`, so for regular exercise mode we would be erroneously clearing that without replacing its contents.

I think the simplest way to fix this, although not the most robust, is just to always save into jQuery data the result of the regex extraction in `loadExercise` (which may just be an empty array). This way, we will always be clearing and replacing the style tag appropriately for summatives and review mode when we dynamically load exercises, but never doing that for normal single exercises.

Thanks for bringing this up.