Skip to content

Save the useMathView user setting on the User Settings page#3055

Open
xcompass wants to merge 1 commit into
openwebwork:WeBWorK-2.21from
ubc:upstream-options-save-mathview
Open

Save the useMathView user setting on the User Settings page#3055
xcompass wants to merge 1 commit into
openwebwork:WeBWorK-2.21from
ubc:upstream-options-save-mathview

Conversation

@xcompass

Copy link
Copy Markdown
Member

Summary

When $pg{specialPGEnvironmentVars}{entryAssist} is set to 'MathView', the User Settings page (templates/ContentGenerator/Options.html.ep) shows a "Use Equation Editor?" radio group named useMathView. However, WeBWorK::ContentGenerator::Options::initialize never reads that parameter when saving display settings — the change-detection condition only checks displayMode, showOldAnswers, and useMathQuill, and the save block only writes those three fields. As a result the submitted useMathView value is silently discarded and the setting reverts to the course default ($pg{options}{useMathView}) on every page load.

This adds useMathView to the change-detection condition and saves it on the effective user record alongside the other display settings, exactly matching the existing handling of displayMode, showOldAnswers, and useMathQuill.

Testing

  • With entryAssist => 'MathView' set in specialPGEnvironmentVars for a course, toggle "Use Equation Editor?" on the User Settings page and save: the user.useMathView field is updated and the selection persists after a reload (previously it always fell back to the course default).
  • The MathQuill flow (entryAssist => 'MathQuill') is unaffected: the added disjunct is guarded by defined($c->param('useMathView')) and is inert when the MathView radios are not rendered, and useMathView($c->param('useMathView')) then stores undef/NULL exactly as the existing code already does for the unrendered useMathQuill parameter in the MathView flow.
  • perltidy (Perl::Tidy 20260204, as pinned in .github/workflows/check-formats.yml) produces no changes on the modified file.

The User Settings page shows a 'Use Equation Editor?' option when
$pg{specialPGEnvironmentVars}{entryAssist} is set to 'MathView', but
the useMathView parameter it submits was never read when saving, so the
selected value was silently discarded and the setting reverted to the
course default on every reload.

Include useMathView in the change detection and save it together with
the other display settings, matching how displayMode, showOldAnswers,
and useMathQuill are handled.

@drgrice1 drgrice1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The fact that none of us notices this shows how little MathView is used anymore. In fact, we will most likely be removing it soon. Unfortunately, it is vastly inferior to MathQuill. Also, I have been maintaining MathView, but that takes a lot of effort for this archaic approach to entry assistance.

@xcompass

xcompass commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

Totally understand. Just happen to notice this when we are doing merge to our fork.

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