Shows how to implement any answer marked correct.
Download file: AnyAnswerMarkedCorrect.pg
DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl');
Preamble
We need to include the macros file unionTables.pl
$a = Compute(random(2, 9, 1));
$ans = $a->cmp(checker => sub { return 1; });
Setup
We wrap the random command with a Compute to make $a a MathObject.
The checker then returns 1 which will make any answer correct.
BEGIN_PGML
Enter anything, e. g. [`[$a] `] and it will be marked correct: [__]{$ans}
END_PGML
ENDDOCUMENT();
Setup
This perl code sets up the problem.