## WeBWorK Main Forum

### "Cannot generate enough points for comparison" error appears to ONLY affect Macs!?

by Christian Seberino -
Number of replies: 4
Several of my students had NO problems with the question below.  One student on a Mac had the "Cannot generate enough points for comparison" error. Another student also on a Mac had the same error for a similar question.

Why only seems to affect Macs?  How fix?

Thanks!

cs

DOCUMENT();
"MathObjects.pl",
"PGstandard.pl",
"PGML.pl",
"PGcourse.pl",
"parserNumberWithUnits.pl",
"contextArbitraryString.pl",
"parserPopUp.pl",
"contextInequalities.pl",
"PGgraphmacros.pl",
);
TEXT(beginproblem());
$showPartialCorrectAnswers = 1; ###################################################################### Context("Numeric") ; Context()->flags->set(tolerance => 0.01); Context()->variables->add(t => "Real"); BEGIN_PGML Find the derivative of [\sqrt{9x^3 - 4}]. [________________________]{"27*x^2/(2*sqrt(9*x^3 - 4))"} END_PGML ###################################################################### ENDDOCUMENT(); In reply to Christian Seberino ### Re: "Cannot generate enough points for comparison" error appears to ONLY affect Macs!? by Chrissy Safranski - I've been frustrated by that error before! It's a domain issue - sometimes the random numbers that WebWork picks to test whether the student's answer is the same as the correct one all (or almost all) fall outside of the domain of the function, so it can't tell whether the answer is correct or not. When dealing with square roots or other functions with limited domain, it's a good idea to specify where the test points will come from. I'm guessing it was a coincidence that the trouble happened with Mac's but maybe it does affect WebWork's point-picking algorithm. I'm not so good with PGML, so there's probably a way to do it like you were, but here is what I got to work: ---------------------------------------- Context("Numeric") ; Context()->flags->set(tolerance => 0.01); Context()->variables->add(t => "Real");$f=Compute("sqrt(9x^3-4)");
$fderiv=$f->D->with(limits=>[1,2]);

BEGIN_PGML
Find the derivative of [[$f]]. [________________________]{$fderiv}
END_PGML
-------------------------------------------

Picking [1,2] worked fine here because the domain would be any x>(4/9)^(1/3).  But you would obviously change it for different functions.

I used the MathObjects derivative function because it's less code to change if you change the function.

In reply to Christian Seberino

### Re: "Cannot generate enough points for comparison" error appears to ONLY affect Macs!?

by Alex Jordan -
It is probably just a coincidence that these students have Macs.

This error usually means that the student's seed is producing test points for the answer Formula that are outside of its domain. This can happen randomly if test points are randomly being chose from say [-1,1] and the Formula is like sqrt(x). Occasionally, an unlucky student will have all of their test points chosen within [-1,0). Hence, "cannot generate enough points for comparison".

To check, see if you can reproduce the error by experimenting with changing the seed from your own computer. If you have a problem on screen and click to Edit it, there is a field where you can change the seed and click View to see the result. You can determine the seeds for these students in a number of ways, including going to the Hmkw Sets Editor, then to the link listing students that are assigned to the set, then clicking to Edit a particular student's data, and finding the seed among the information there.

To fix the problem, see http://webwork.maa.org/wiki/FormulaTestPoints.
In reply to Christian Seberino

### Re: "Cannot generate enough points for comparison" error appears to ONLY affect Macs!?

by Daniele Arcara -
I am having a similar issue. Coincidentally, I also use a Mac…

Here is my code:

DOCUMENT();

"PGstandard.pl",
"PGML.pl",
"PGcourse.pl"
);

TEXT(beginproblem());

$f = Formula("x*sqrt(x^2-4)")->with(limits=>[-2,2]);$F = Formula("1/3*(x^2-4)**(3/2)")->with(limits=>[-2,2]);

$ans =$F;

BEGIN_PGML

[ \int [$f] \, dx = ] [_______________________]{$ans->cmp(upToConstant=>1)} [ +C ]

END_PGML

ENDDOCUMENT;

When trying to enter the correct answer, it tells me that it cannot generate enough valid points for comparison. Any help would be appreciated. Thank you!
In reply to Daniele Arcara

### Re: "Cannot generate enough points for comparison" error appears to ONLY affect Macs!?

by Daniele Arcara -
Never mind… I just realized I had the domain backwards… I just need some sleep or coffee :)