Difference between revisions of "AnswerIsSolutionToEquation"
Jump to navigation
Jump to search
(Update links to http://webwork.maa.org/viewvc/system/trunk/pg/macros/parserSolutionFor.pl?view=log, etc) |
|||
Line 109: | Line 109: | ||
<ul> |
<ul> |
||
− | <li>POD documentation: [http://webwork.maa.org/pod/ |
+ | <li>POD documentation: [http://webwork.maa.org/pod/pg/macros/parserSolutionFor.html parserSolutionFor.pl]</li> |
<li>PG macro: [http://webwork.maa.org/viewvc/system/trunk/pg/macros/parserSolutionFor.pl?view=log parserSolutionFor.pl]</li> |
<li>PG macro: [http://webwork.maa.org/viewvc/system/trunk/pg/macros/parserSolutionFor.pl?view=log parserSolutionFor.pl]</li> |
||
</ul> |
</ul> |
Revision as of 18:07, 7 April 2021
Answer is any Solution to an Equation
This PG code shows how to check student answers that can be any point satisfying an equation.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "parserSolutionFor.pl", ); TEXT(beginproblem()); |
Initialization:
We need to include the macros file |
Context("Vector")->variables->are(x=>'Real',y=>'Real'); $f = SolutionFor("x^2 = cos(y)","(1,0)"); #$f = SolutionFor("x^2 - y = 0",[2,4]); #$f = SolutionFor("x^2 - y = 0",Point(4,2),vars=>['y','x']); |
Setup:
The routine |
Context()->texStrings; BEGIN_TEXT A solution to \($f->{f}\) is \((x,y)\) = \{ans_rule(30)\}. END_TEXT Context()->normalStrings; |
Main Text:
We can use |
$showPartialCorrectAnswers = 1; ANS( $f->cmp() ); ENDDOCUMENT(); |
Answer Evaluation: As is the answer. |
- POD documentation: parserSolutionFor.pl
- PG macro: parserSolutionFor.pl