When I preview this exercise, I see the correct answer looking as expected if I do not enter any answer. When I do enter an answer and check, both the entered answer and the correct answer have the first two characters transposed, e.g. “89/” instead of “8/9”
DOCUMENT();loadMacros("PGstandard.pl","MathObjects.pl","PGML.pl","PGchoicemacros.pl",);TEXT(beginproblem());###############################################################Context("Numeric");Context()->flags->set( reduceConstants => 0);$d = random(3,9);$n = $d - 1;$d1 = random(3,9);$n1 = $d1 - 1;do {$d2 = random(2,9)} until ( gcd($d2 , $d1) == 1);$n2 = $d2 + 1;$a = Formula(" $n1 / $d1");$f = " \dfrac{$n1}{$d1}\left(\dfrac{$n2}{$d2} \right)^x ";##############################################################BEGIN_PGMLFind the [`y`]-intercept of each exponential function and decide whether the graph is increasing or decreasing.[` h(x)= [$f ] `]: The [`y`]-intercept is [___](Enter only the [`y`]-coordinate.)END_PGMLContext()->normalStrings;ANS( checkbox_cmp( $a->correct_ans() ) );ENDDOCUMENT();
Could someone please explain what’s going on?
Yeah, the anomaly disappears when I simply include the answer within the PGML. The reason I don’t include the answer within the PGML is that this is just a snippet of a problem of eight parts that alternate between fill-ins (as above) and multiple-choice. I have not yet learned how to include the answer to a MC within PGML and have instead put the answers afterwards. The anomaly persists if I give up on PGML but include all eight parts.
As far as I can tell, the answer checkers are marking answers correctly, it's just that the displayed Answer Preview and Correct Answer are off.
Thanks.
Bruce Yoshiwara