Skip to content

Conversation

@drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Nov 8, 2025

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 in the PG problem editor. Actually they are shown any time the renderRPC endpoint is used and the showMathJaxErrors parameter is set to a true value, but the only time that webwork2 now does this is in the problem editor.

Of #2837, #2838, and this pull request, I think this is the way to go.

This still includes thhe change from the webwork_url to the webwork_js_config method in the WeBWorK::ContentGenerator module. 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.

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 in the PG
problem editor. Actually they are shown any time the renderRPC endpoint
is used and the `showMathJaxErrors` parameter is set to a true value,
but the only time that webwork2 now does this is in the problem editor.

This still includes thhe change from the `webwork_url` to the
`webwork_js_config` method in the `WeBWorK::ContentGenerator` module.
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.

Test works fine, the error is only shown in the problem editor. Otherwise the raw tex is shown in yellow, so an error is known just not what it is.

@drgrice1
Copy link
Member Author

Note that this does not show TeX errors if you are using the problem editor and render in a new window. I think it is not worth it to add that.

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.

2 participants