Skip to content

Conversation

@drgrice1
Copy link
Member

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 just removes the noerrors MathJax extension. So TeX errors are shown for all users.

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.

The change from the webwork_url to the webwork_js_config method in the WeBWorK::ContentGenerator module is not needed for this, but 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.

Copy link
Contributor

@somiaj somiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there is a specific reason to not show errors (and only the raw tex) to students, I think this method is preferable.

@dpvc
Copy link
Member

dpvc commented Oct 29, 2025

The original reason for the noerrors extension is that, for most people reading the page, the TeX errors are of no use at all, and if they can see the original TeX, they at least have some chance of understanding what the author had originally intended, even if it contains errors.

The TeX errors are really only useful for page authors, and the other PR at least tried to handle that by using the permissions to determine who sees them. It would be better if the PG editor could control the presentation of the messages, rather than trying to use the permission as a proxy for that, or always showing errors. I haven't looked at the editor code in decades, but I wonder if it could insert some javascript to set the needed value to prevent the noerrors package from being used.

Perhaps it was just in the configuration that @dpvc recommended

You probably used the v2-to-v3 configuration conversion tool to convert the old configuration to the new one. Since the v2 default has noerrors, it would have kept that in the new configuration that you obtained.

@somiaj
Copy link
Contributor

somiaj commented Oct 29, 2025

I also wondered if we could just disable noerrors on the problem editor page, but that leads to a few concerns. One is the problem editor page can open the problem as its own page, and then showing possible errors is no longer contained to just the problem editor page. Also some authors may edit the problem files directly with their own text editor, and not be able to see the error messages when they view the problem normally.

@dpvc
Copy link
Member

dpvc commented Oct 29, 2025

One is the problem editor page can open the problem as its own page, and then showing possible errors is no longer contained to just the problem editor page

I was thinking that maybe if the problem is being run from a URL that includes the tmpEdit directory (if that is still being used -- again, I haven't edited a problem in many years), that could be used to set the needed flag. For those using an external editor on a file in a different directory (like the actual problem file), then perhaps there could be a PG variable that could be set during the editing process (and if the author forgets to remove it when done, that is not all that bad, as there should really not be TeX errors at that point).

But feel free to remove the noerrors extension altogether if that is the consensus of the community. I was just suggesting an alternative to consider.

@drgrice1
Copy link
Member Author

There are certainly ways that the PG problem editor could set a flag to make this happen only for that page. It shouldn't be hard to make that work even when someone opens the problem in a new page from the PG problem editor. I don't think we need to be concerned with someone editing a problem from a text editor outside of the browser (like me).

@drgrice1
Copy link
Member Author

The original reason for the noerrors extension is that, for most people reading the page, the TeX errors are of no use at all, and if they can see the original TeX, they at least have some chance of understanding what the author had originally intended, even if it contains errors.

So that is basically what I told everyone at the developer meeting yesterday. But I do recall using the conversion tool.

@drgrice1 drgrice1 force-pushed the mathjax-noerror-config-alt branch from 5222b8f to 62188c0 Compare October 31, 2025 00:56
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 just removes the `noerrors` MathJax extension. So TeX
errors are shown for all users.

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.

The change from the `webwork_url` to the `webwork_js_config` method in
the `WeBWorK::ContentGenerator` module is not needed for this, but
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.
@Alex-Jordan Alex-Jordan merged commit 9f8587f into openwebwork:develop Nov 11, 2025
2 checks passed
@drgrice1 drgrice1 deleted the mathjax-noerror-config-alt branch November 11, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants