WeBWorK Problems

Radicals and MathQuill

Radicals and MathQuill

by Alex Jordan -
Number of replies: 3

What is the proper way to have a radical in a MathQuill answer blank send the `root( , )` construct to WeBWorK, instead of raising to a reciprocal power? I thought I knew how this worked, but my example is not working for a ~2.20 server, nor a 2.19 server, nor a 2.17 server. Here is my example below. Entering a radical expression with MathQuill, the answer is rejected because it has been converted to an exponent behind the scenes.

DOCUMENT();

loadMacros(qw(PGstandard.pl PGML.pl contextLimitedRadical.pl));

Context("LimitedRadical");
$inverse = Formula("root(3, x)");

BEGIN_PGML
Enter a formula for the inverse function of [`f`], where [`f(x)=x^3`].

    [`f^{-1}(x)={}`][_]{$inverse->cmp(mathQuillOpts => "rootsAreExponents: false")}
END_PGML

ENDDOCUMENT();
In reply to Alex Jordan

Re: Radicals and MathQuill

by Glenn Rice -
Change that to

[`f^{-1}(x)={}`][_]{$inverse->cmp(mathQuillOpts => { rootsAreExponents => 0 }}
In reply to Glenn Rice

Re: Radicals and MathQuill

by Alex Jordan -

OK, thanks. Did it used to take JSON notation instead? I had local examples with that when I went searching.

In reply to Alex Jordan

Re: Radicals and MathQuill

by Glenn Rice -
Yes, I think that when MathQuill was first added (with PG 2.15 I believe) that was the case.  I believe it was changed for the next release after that.