-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Fix debugging messages in the formatRenderedProblem
method.
#2662
Fix debugging messages in the formatRenderedProblem
method.
#2662
Conversation
1ab5a8d
to
551001f
Compare
One way to test this is to get the MWE that @dlglin posted in #2661, and change line 399 of That also shows what would be needed to switch the PG problem editor to using the |
By the way, I don't think that anything ever sets the |
formatRenderedProblem
method.formatRenderedProblem
method.
The `formatRenderedProblem` method of the `FormatRenderedProblem` module ensures that the `debug_messages` key of the rendered problem result is an array reference, but checks the wrong thing. It checks if the result itself is an array reference instead of the `debug_messages` hash key of the result. Since the result is always a hash reference and never an array reference, this means that the debugging messages from PG are always wiped out and replaced with a reference to an empty array. This was discovered when investigating openwebwork#2661. If we want to switch the PG problem editor to using the `debug` output format of the `formatRenderedProblem` method we could, but in order to get the benefit of that change we need this.
551001f
to
313eb68
Compare
This is as discussed in openwebwork#2661, openwebwork#2662 and the developer meeting. The PG problem editor is switched to the debug format from the simple format. The only difference for the problem editor page is that if there are debug messages they are now shown. Usually there aren't any such messages, and so there isn't a difference. But if something is enabled like the MathObject diagnostics cmp flag, then those debug messages are shown.
The
formatRenderedProblem
method of theFormatRenderedProblem
module ensures that thedebug_messages
key of the rendered problem result is an array reference, but checks the wrong thing. It checks if the result itself is an array reference instead of thedebug_messages
hash key of the result. Since the result is always a hash reference and never an array reference, this means that the debugging messages from PG are always wiped out and replaced with a reference to an empty array.This was discovered when investigating #2661. If we want to switch the PG problem editor to using the
debug
output format of theformatRenderedProblem
method we could, but in order to get the benefit of that change we need this.