Unordered Answers

Answers can be entered in any order into answer blanks

Complete Code

Download file: UnorderedAnswers.pg

POD for Macro Files

PG problem file

Explanation

DOCUMENT();

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

Preamble

The macro unorderedAnswer.pl must be loaded.

Context()->variables->add(y => 'Real', z => 'Real');

$a = random(2, 9);

$answer1 = Compute("x^$a");
$answer2 = Compute("y^$a");
$answer3 = Compute("z^$a");

Setup

The answers use the variables x, y, and z. The variable x is already in the default Numeric context, but y and z need to be added.

BEGIN_PGML
Rewrite the following expression without parentheses. Simplify your answer as
much as possible.

[`(xyz)^{[$a]} =`] [_____] [`\cdot`] [_____] [`\cdot`] [_____]
END_PGML

Statement

This is the problem statement in PGML.
$showPartialCorrectAnswers = 0;

UNORDERED_ANS($answer1->cmp, $answer2->cmp, $answer3->cmp);

Answer

The method UNORDERED_ANS(checker1, checker2, ...) is used to associate the unordered answer evaluator with the answer rules defined in the problem. The variable $showPartialCorrectAnswers is set to 0 to withhold feedback until all answers are correct.

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution

A solution should be provided here.