This PG code shows how to allow students to enter their answers into several answer blanks in any order.

PG problem file Explanation

Problem tagging:

DOCUMENT();

"PGstandard.pl",
"MathObjects.pl",
);

TEXT(beginproblem());


Initialization: We must load unorderedAnswer.pl.

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

$a = random(2,9,1);$answer1 = Compute("x^$a");$answer2 = Compute("y^$a");$answer3 = Compute("z^$a");  Setup: Context()->texStrings; BEGIN_TEXT Rewrite the following expression without parentheses. Simplify your answer as much as possible, and assume that all variables are positive.$BR
$BR $$(xyz)^{a} =$$ \{ ans_rule(5) \} $$\cdot$$ \{ ans_rule(5) \} $$\cdot$$ \{ ans_rule(5) \} \{ AnswerFormatHelp("formulas") \} END_TEXT Context()->normalStrings;  Main Text: $showPartialCorrectAnswers = 1;

UNORDERED_ANS(
$answer1->cmp(),$answer2->cmp(),
$answer3->cmp(), );  Answer Evaluation: We use UNORDERED_ANS( checker1, checker2, ...); to evaluate the answers. It is possible to withhold feedback and credit until everything is correct by using the standard problem grader, which awards no partial credit and full credit only when everything is correct. $showPartialCorrectAnswers = 0;



Context()->texStrings;
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;

COMMENT('MathObject version.');

ENDDOCUMENT();


Solution: