WeBWorK Problems

MathQuill flag to allow word "infinite" to be typed?

MathQuill flag to allow word "infinite" to be typed?

by Paul Seeburger -
Number of replies: 4

I have  a problem in which students are asked to type the number of solutions of a given system.

One option is to type infinite number of solutions.  See: https://github.com/openwebwork/webwork-open-problem-library/blob/main/Contrib/PCC/BasicAlgebra/SystemsOfLinearEquations/SystemEquation60.pg

But MathQuill is automatically converting the first three letters of infinite to the infinity symbol.  Is there a flag that I can set to turn off this behavior?

It seems that when the word "infinite" is a known word in the Context, it should be allowed to type it.

I know that using the Tt Text mode will get around this, but these basic algebra students are already challenged.  I want to remove every source of confusion that I can, while still being able to have them type a response.

Is there now perhaps a flag to make an answer blank automatically use the text mode?  That could be very helpful in handling a number of issues of this kind.

Thanks!

Paul

In reply to Paul Seeburger

Re: MathQuill flag to allow word "infinite" to be typed?

by Glenn Rice -
Questions like that need to be updated to not ask students to type things like it does. A better way to do that type of problem is to use the parserRadioMultiAnswer.pl macro. I have attached a rewrite of the problem that does that instead.

To answer your question, there is no way to make MathQuill be in text mode by default.  However, you could disable the inf auto command.  To do this for all answers in the problem add

TEXT(MODES(TeX => '', HTML => << 'END_SCRIPT'));
<script>
window.addEventListener('DOMContentLoaded', () => {
    if (window.answerQuills) {
        for (const answerQuill of Object.values(answerQuills))
            answerQuill.mathField.options.removeAutoCommands('inf');
    }
});
</script>
END_SCRIPT
after the BEGIN_PGML/END_PGML section.  I don't recommend this approach though for this type of problem.

In reply to Glenn Rice

Re: MathQuill flag to allow word "infinite" to be typed?

by Paul Seeburger -

Thank you, Glenn!

I can see that some problems could be easier to use with a radio button, but there are times where the answer could be a phrase or a number (like this one) where it certainly makes sense to allow phrases to be entered like this.  My students might be a little confused if they were asked to sometimes leave an answer blank empty, although once they had 100%, I'd guess they'd be ok.

I could not get the version of the problem you sent to work.  It did not like the RadioMultiAnswer, saying it is an undefined subroutine.  I am on the U of R server, so it is probably not a new enough version of WeBWorK for this macro.

And the script code you gave does not seem to work for me either.  But this could also be because I am on WeBWorK version 2.15+develop.  I believe they are updating this this summer sometime.

Thanks so much for your help though!!

Paul

In reply to Paul Seeburger

Re: MathQuill flag to allow word "infinite" to be typed?

by Glenn Rice -

The parserRadioMultiAnswer.pl macro would not be available on WeBWorK 2.15+develop.  It wasn't added until WeBWorK 2.18 in 2022.

MathQuill has also changed quite a bit since then.  The method to remove the inf auto command was not added until recently.  So that also wouldn't work for 2.15+develop.

WeBWork 2.15 is rather dated now.  It certainly is time to upgrade.

I don't think that you understand how the parserRadioMultiAnswer.pl macro works.  It gives a radio button choice,  but within each part there are inputs that need to also be filled in with answers if that particular radio button is chosen.  It is much better than having a student type a phrase like "infinite number of solutions".  Here is what the problem I attached looks like:

radio multi answer problem

In reply to Glenn Rice

Re: MathQuill flag to allow word "infinite" to be typed?

by Paul Seeburger -
Thanks for the image of your problem, Glenn!

Yes, I can see how that would be a nicer option for this problem.

I like how it's set up!

Hopefully I will have this option for the coming year.