Skip to content
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

operators in MathQuill #2203

Open
Alex-Jordan opened this issue Sep 6, 2023 · 2 comments
Open

operators in MathQuill #2203

Alex-Jordan opened this issue Sep 6, 2023 · 2 comments

Comments

@Alex-Jordan
Copy link
Contributor

This relates to some of the discussion on #1804. I have an exercise where the units on a certain answer are "min/mi" as in minutes per mile. But the "min" is understood by MathQuill to be the minimum operator, so typing 5 min/mi in a MQ answer blank doesn't work as I'd hope. The "min" is not placed in a numerator.

In #1804, @drgrice1 posted:

Currently the default autoOperatorNames for MathQuill are 'arg', 'det', 'dim', 'exp', 'gcd', 'hom', 'ker', 'lg', 'lim', 'max', 'min', 'sup', 'limsup', 'liminf', 'injlim', 'projlim', 'Pr', 'gcf', 'hcf', 'lcm', 'proj', and 'span'. I see no reason that 'Pr' needs to be in this list for WeBWorK. What about the others? Should any of the others be considered for removal?

And I posted my thoughts on that, which are essentially that almost all of these should be removed as they are not MathObjects operators. I think that is consistent with removing min. It's not an operator that you get from any MathObjects context that I know of.

@drgrice1
Copy link
Sponsor Member

drgrice1 commented Sep 6, 2023

This is not to hard to change. We can do this either by making this the MathQuill default, or by setting the autoOperatorNames option in mqeditor.js.

If you want this now without a modification to the PG code, you could add the following to the problem. This will set autoOperatorNames to be the empty list.

TEXT(MODES(TeX => '', HTML => << 'END_SCRIPT'));
<script>
window.addEventListener('DOMContentLoaded', function() {
	if (window.answerQuills) {
		for (const ans_name of Object.keys(window.answerQuills)) {
			answerQuills[ans_name].mathField.options.autoOperatorNames = [];
		}
	}
});
</script>
END_SCRIPT

@drgrice1
Copy link
Sponsor Member

drgrice1 commented Sep 6, 2023

Actually, you could just add that code to PGcourse.pl, and it will be in effect for all problems in the course. That is probably a better way to do it. Then it is also easy to remove once the changes are committed to the PG code.

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

No branches or pull requests

2 participants