Make MathJax show errors for bad TeX. #2837
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There have been requests to either remove this extension or at least make it so that those editing problems do not have it loaded, as it makes it easier to determine what is wrong with TeX in a problem.
This pull request makes it so that these errors are only shown for users that have the
view_problem_debugging_infopermission (which is those with the ta role or higher by default). So students will still see the usual faulty TeX code in yellow.Another option would be to just remove the
noerrorsMathJax extension instead of optionally loading it. I am not sure why this package was added. It seems that I added it when I upgraded from MathJax version 2 to version 3, but I don't remember why. Perhaps it was just in the configuration that @dpvc recommended, or maybe I added it for some reason. Perhaps it was just about maintaining compatibility with version 2 of MathJax. For version 2 (as I understand it), thenoerrorsextension was included by default, but with MathJax version 3 it must be explicitly loaded.Even if we decide to drop the
noerrorsextension, the change from thewebwork_urlto thewebwork_js_configmethod in theWeBWorK::ContentGeneratormodule should be made anyway. There is also awebwork_urlmethod in theMojolicious::WeBWorKmodule that is already available for all controller modules (since it is a Mojolicious helper method), and having this other one overrides that one and it is confusing to have both that return almost the same value. The only difference is thatWeBWorK::ContentGeneratormethod called thelocationhelper which returns the empty string if the root URL is '/', and thewebwork_urlhelper returns '/' in that case. I don't know what I was thinking creating theWeBWorK::ContentGeneratormethod which was really just an alies for thelocationhelper method anyway.