DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'parserMultiAnswer.pl', 'PGcourse.pl');

$fac1 = Formula("(1 - x)");
$fac2 = Formula("(1 + x)");

$multians = MultiAnswer($fac1, $fac2)->with(
    singleResult => 0,
    checker      => sub {
        my ($correct, $student, $self) = @_;
        my ($f1stu, $f2stu) = @$student;
        my ($f1,    $f2)    = @$correct;
        if (($f1 == $f1stu && $f2 == $f2stu)
            || ($f1 == $f2stu && $f2 == $f1stu))
        {
            return [ 1, 1 ];
        } else {
            if ($f1 == $f1stu || $f2 == $f1stu) {
                return [ 1, 0 ];
            } elsif ($f1 == $f2stu || $f2 == $f2stu) {
                return [ 0, 1 ];
            } else {
                return [ 0, 0 ];
            }
        }
    }
);

BEGIN_PGML
Factor:
[`1-x^2 = \big(`] [___]{$multians} [`\big)\big(`] [___]{$multians} [`\big)`]
END_PGML

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();