New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MathJax filter not applied to prologuehtml #182
Comments
Thanks for reporting. It is a bug in CodeRunner, exactly as you've identified. I have a tentative fix, but I want to see if it creates any new problems before releasing it. In the meantime, here's a workaround (slightly ugly):
Alternatively, if you want to live on the bleeding edge, you could checkout the development branch on github. Probably you'd only want the latest commit (to renderer.php) addressing this bug as some of the other changes are work-in-progress. |
Thanks very much. I won't actually be using CodeRunner properly until February, I am just experimenting and setting things up at the moment, so I won't worry about any workarounds for the time being. |
Fixed in version 5.2.4. |
This replicates the forum post https://coderunner.org.nz/mod/forum/discuss.php?d=646 but I now think it is more appropriate here.
Suppose we have a combinator template grader that returns a
prologuehtml
field which becomes part of the specific feedback. If there is LaTeX markup in that feedback, it seems that the MathJax filter will not be applied (even if it is enabled), so the LaTeX will not be displayed properly. If I understand correctly, question elements containing LaTeX are typically passed through the methodquestion::format_text()
, which calls the global Moodle functionformat_text()
, which applies any active filters. In particular, if the MathJax is active then LaTeX-containing elements will be wrapped in<span class="filter_mathjaxloader_equation">...</span>
which signals to the MathJax javascript code in the browser that they need to be processed. For example, the STACK question type plugin (https://github.com/maths/moodle-qtype_stack) callsformat_text()
in a number of places to ensure that this happens. However,coderunner
never callsformat_text()
. It seems that one could add calls toqtype_coderunner_renderer::feedback()
orqtype_coderunner_combinator_grader_outcome::get_prologue()
or something like that. I am not sufficiently expert to judge what details would be best.The text was updated successfully, but these errors were encountered: