WeBWorK Main Forum

comparing MathObjects Formulas (problem generating test points)

by William Boshuck -
Number of replies: 10
Can anyone reproduce the following problem?

The Problem

Union/setDervBasic/s2_2_17.pg

(from the OPL) is in a homework set
with seed 1728.

The problem is to compute f'(x), where
f(x) = sqrt(6x).

The correct answer 6 / (2 sqrt(6x)) is
marked incorrect, with the Message:

Can't generate enough valid points for comparison

The same is true with other (e.g., simplified)

We have recently upgraded to WeBWorK 2.7
and PG 2.7.

It looks as though the most obvious files
have not changed since 2.7.

Related information:

If I change the seed and edit the problem
to force the coefficient of x to be 6, the

It is of course easy to avoid this problem

Re: comparing MathObjects Formulas (problem generating test points)

by William Boshuck -
I was never able to do this directly,
although I have needed something like
it. In the example along the lines of
the one Alex mentioned, what I did
would amount to something like this:

$xs = [ ( map { [random(-3, -2, .01)] } ( 0 .. 4) ), ( map { [random(-1, 0, .01)] } ( 0 .. 4) ), ( map { [random(1.5, 2, .01)] } ( 0 .. 4) ), ( map { [random(3, 4, .01)] } ( 0 .. 4) ) ];$g = Formula("|2x + 3| + |x - 1| + |3x - 7|")->with(
test_points => \$xs
);

cheers,
-wb

Re: comparing MathObjects Formulas (problem generating test points)

by William Boshuck -
Hi,
sorry, I was not explicit.

I was wondering whetherI should submit a PR
regarding the problem itself (it is from the
OPL).

cheers,
-wb

Re: comparing MathObjects Formulas (problem generating test points)

by Alex Jordan -
Oh! Good question, this may be helpful if you want to fix it yourself for the library. Otherwise it looks like using Bugzilla is what you do and someone else will get to it following these steps.

Re: comparing MathObjects Formulas (problem generating test points)

by Paul Pearson -
Hi all,

The bug is that the domain needs to be set manually, as below, so that none of the test points for function evaluation throw an error. Just below the
TEXT(beginproblem());

Context('Numeric');
Context()->variables->set(x=>{limits=>[1,5]});

to the file

https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/Union/setDervBasic/s2_2_17.pg

You can modify your local copy or update your copy of the OPL to the github version. In the future, filling out a bugzilla report for such things is a good idea.

Best regards,

Paul Pearson

Re: comparing MathObjects Formulas (problem generating test points)

by William Boshuck -
Thanks.

I have fixes for quite a few bugs in
problems in the Libarary, but until
recently the server I'm using hasn't
been using the OPL. I will look into
Alex's suggestion.

cheers,
-wb