Answers with Alternate Forms

Answer that may not be an equation.

Complete Code

Download file: NoSolution.pg

POD for Macro Files

PG problem file

Explanation

DOCUMENT();

loadMacros(
    'PGstandard.pl',             'PGML.pl',
    'parserRadioMultiAnswer.pl', 'PGcourse.pl'
);

Preamble

Load the parserRadioMultiAnswer.pl macro in addition to the usual macros.

$y = random(0, 4);

$rma = RadioMultiAnswer(
    [
        [ 'The equation of the line is \(y = \) %s.', '2x' ],
        ['No such line exists.']
    ],
    $y < 4 ? 1 : 0
);

Setup

A RadioMultiAnswer produces a set of radio buttons for each of the given statements. The format is

RadioMultiAnswer([
    [statement1, first answer in statement 1, second answer in statement 1, ...],
    [statement2, first answer in statement 2, ...],
    ...
    [last statement]
], correct index, options)

Answer blanks can be added to a part with the %s in the string. If an array answer is desired, use %s* instead. See the parserRadioMultiAnswer.pl macro for more details.

BEGIN_PGML
Is there a line through the points [`(0, 0)`], [`(1, 2)`], and [`(2, [$y])`]?
If there is, then give the equation for this line.

[_]{$rma}
END_PGML

Statement

This is the problem statement in PGML.
BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.