WeBWorK Problems

Disable MathQuill in a single problem or answer blank?

Disable MathQuill in a single problem or answer blank?

by Paul Seeburger -
Number of replies: 5

I am new to using MathQuill with my Problem Sets, and the strange messages that sometimes are produced for some problems is causing some confusion.

How can I disable MathQuill on particular problems or for particular answer blanks?

Thanks!

Paul

In reply to Paul Seeburger

Re: Disable MathQuill in a single problem or answer blank?

by Alex Jordan -

I don't believe this can be done in the current versions of WeBWorK. It can be turned on/off at the level of a config file, which is loaded before anything in the problem code is processed.

In the situations I know of where MathQuill causes issues, using the MathQuill text entry mode gets past the issues. For example, if the answer is "2 m/s", MathQuill will make it look like \frac{2m}{s} and it will turn the submitted answer into "(2m)/s", which WW's unit parser will not understand. But if you click the MathQuill "Tt" (or pres the " character on your keyboard) then MathQuill allows you to type text that will not be altered upon submission.

So if you get students to be aware of this, it can work. In the extreme, you could print a message in the problem telling students to do this for the answers to that problem. The message can be conditioned upon whether or not MathQuill is in use:

TEXT('Push the "Tt" button before typing your answer.') if $entryAssist eq 'MathQuill';

or in PGML:

[@ 'Push the "Tt" button before typing your answer.' if $entryAssist eq 'MathQuill';@]

You could probably find a way to display a message like this for all problems that are in a particular set. If the set's name is "MySet", then the environment variable $setNumber carries that. So one idea is you could modify the beginproblem() subroutine in PGbasicmacros to print the message conditionally on the $setNumber.



In reply to Alex Jordan

Re: Disable MathQuill in a single problem or answer blank?

by Sean Fitzpatrick -

Thanks for the tip on conditional message display. That will come in handy.

Here is a problem that we discovered this term doesn't function with MathQuill:

Library/Hope/Multi1/03-01-Vector-spaces/Proof_02c.pg

It's basically a 2-column proof, where you fill in the reasons. There is a list of reasons at the bottom, and as you begin to type one of them, options pop up below the answer blank for selection.

Even with the text mode on, the autocompletion is broken. (And without text mode on, the problem is completely broken.)

In reply to Sean Fitzpatrick

Re: Disable MathQuill in a single problem or answer blank?

by Glenn Rice -

Yeah, at this point the parserWordCompletion.pl macro will not work with MathQuill.  That macro uses the original text input which is hidden when MathQuill is used.  This is a problem where per-response disabling of MathQuill would be advisable.  I posted a patch to WeBWorK on Github (see https://github.com/openwebwork/webwork2/issues/1155) that makes this possible.  You need server access to apply the patch though.  Se the instructions in that issue.

Eventually I would like to see macros/contexts for which MathQuill doesn't work (like parserWordCompletion.pl where MathQuill doesn't even really make sense) automatically disable MathQuill for those answers.

In reply to Alex Jordan

Re: Disable MathQuill in a single problem or answer blank?

by Paul Seeburger -

That's too bad.

I love MathQuill and I don't like it at the same time.

As I think Sean Fitzpatrick pointed out in another thread, it's automatic formatting undermines some of the things students learn when entering their math in one line.  But it looks so nice with MathQuill, and now more complicated expressions are a bit less painful to enter.

If there were a way to select to not use it on a per problem basis, it would make it much easier to use.

As it is, I am seeing confusion from students on problems they've never asked questions about before, and it seems like it stems mostly from the way MathQuill works in the problems, or strange error messages about an "Unknown character '('" which the student never entered.

I also use some problems with units and others with text, so I may indeed need these tips that you shared, Alex.

Thanks so much!

If anyone else has any tips related to MathQuill, I'd love to hear them!

Paul

In reply to Paul Seeburger

Re: Disable MathQuill in a single problem or answer blank?

by Nathan Wallach -
Alex is correct - it is not yet possible. When MathQuill was first added, I and several others raised the issue of a need to have such a feature, but it has not yet been implemented.

There are issues in GitHub in both webwork2 and pg:
and discussions in prior conversations. Chime in and give examples of where it really matters. Eventually we hope to have a solution. Some of the issues may also be things which can be overcome by fixing either the WW MQ support or specific PG contexts to be more compatible. (I think I recall having some issues with Integer contexts with MQ on, as MQ seems to add "invisible" parenthesis which the student does not see in some places to what is sent to the server.)

In the meanwhile - one option is to recommend that students turn MathQuill off for specific questions on their own - annoying but feasible where really necessary.