SolutionForEquation1
Revision as of 23:36, 6 December 2010 by Pearson (talk | contribs) (Created page with '<h2>Answer is Any Solution For an Equation</h2> 300px|thumb|right|Click to enlarge <p style="background-color:#f9f9f9;border:black solid 1px;pa…')
Answer is Any Solution For an Equation
This PG code shows how to check whether the student's answer is a solution to an equation.
- Download file: File:SolutionForEquation1.txt (change the file extension from txt to pg when you save it)
- File location in NPL:
FortLewis/Authoring/Templates/Algebra/SolutionForEquation1.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserSolutionFor.pl", "AnswerFormatHelp.pl", ); TEXT(beginproblem()); |
Initialization: |
Context("Vector"); $r = random(3,6,1); $answer = SolutionFor("x^2+y^2+z^2=$r^2", [$r,0,0] ); |
Setup: |
Context()->texStrings; BEGIN_TEXT A solution to the equation \( $answer->{f} \) is \( (x,y,z) = \) \{ ans_rule(20) \} \{ AnswerFormatHelp("points") \} END_TEXT Context()->normalStrings; |
Main Text: |
$showPartialCorrectAnswers = 1; ANS( $answer->cmp() ); |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |