Commit 449edae
committed
Make MathJax show errors for bad TeX.
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_info` permission (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 `noerrors` MathJax 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), the
`noerrors` extension was included by default, but with MathJax version 3
it must be explicitly loaded.
Even if we decide to drop the `noerrors` extension, the change from the
`webwork_url` to the `webwork_js_config` method in the
`WeBWorK::ContentGenerator` module should be made anyway. There is also
a `webwork_url` method in the `Mojolicious::WeBWorK` module 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 that `WeBWorK::ContentGenerator` method called the
`location` helper which returns the empty string if the root URL is '/',
and the `webwork_url` helper returns '/' in that case. I don't know what
I was thinking creating the `WeBWorK::ContentGenerator` method which was
really just an alies for the `location` helper method anyway.1 parent d3708c5 commit 449edae
File tree
5 files changed
+15
-13
lines changed- htdocs/js/MathJaxConfig
- lib/WeBWorK
- templates
- ContentGenerator
- RPCRenderFormats
- layouts
5 files changed
+15
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
682 | 683 | | |
683 | 684 | | |
684 | 685 | | |
685 | | - | |
| 686 | + | |
686 | 687 | | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
| 688 | + | |
| 689 | + | |
694 | 690 | | |
695 | 691 | | |
696 | 692 | | |
697 | | - | |
698 | | - | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments