Difference between revisions of "UnorderedAnswers1"
Jump to navigation
Jump to search
Paultpearson (talk | contribs) |
(add historical tag and give links to newer problems.) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{historical}} |
||
+ | |||
+ | <p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/Algebra/UnorderedAnswers.html a newer version of this problem]</p> |
||
+ | |||
+ | |||
<h2>Answers Can Be Entered Into Answer Blanks in Any Order</h2> |
<h2>Answers Can Be Entered Into Answer Blanks in Any Order</h2> |
||
Line 6: | Line 11: | ||
</p> |
</p> |
||
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1.pg FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1.pg] |
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1.pg FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1.pg] |
||
+ | * PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1_PGML.pg FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1_PGML.pg] |
||
<br clear="all" /> |
<br clear="all" /> |
Latest revision as of 04:48, 18 July 2023
This problem has been replaced with a newer version of this problem
Answers Can Be Entered Into Answer Blanks in Any Order
This PG code shows how to allow students to enter their answers into several answer blanks in any order.
- File location in OPL: FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1.pg
- PGML location in OPL: FortLewis/Authoring/Templates/Algebra/UnorderedAnswers1_PGML.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "unorderedAnswer.pl", ); TEXT(beginproblem()); |
Initialization:
We must load |
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 $showPartialCorrectAnswers = 0; install_problem_grader(~~&std_problem_grader); |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |