Difference between revisions of "PointAnswers1"
Line 1: | Line 1: | ||
<h2>Answer is a Point or a List of Points</h2> |
<h2>Answer is a Point or a List of Points</h2> |
||
+ | [[File:PointAnswers1.png|300px|thumb|right|Click to enlarge]] |
||
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
||
This PG code shows how to evaluate answers that are points or lists of points. |
This PG code shows how to evaluate answers that are points or lists of points. |
||
− | <ul> |
||
− | <li>Download file: [[File:PointAnswers1.txt]] (change the file extension from txt to pg when you save it)</li> |
||
− | <li>File location in NPL: <code>NationalProblemLibrary/FortLewis/Authoring/Templates/Precalc/PointAnswers1.pg</code></li> |
||
− | </ul> |
||
</p> |
</p> |
||
+ | * Download file: [[File:PointAnswers1.txt]] (change the file extension from txt to pg when you save it) |
||
+ | * File location in NPL: <code>FortLewis/Authoring/Templates/Precalc/PointAnswers1.pg</code> |
||
+ | |||
+ | <br clear="all" /> |
||
<p style="text-align:center;"> |
<p style="text-align:center;"> |
||
[[SubjectAreaTemplates|Templates by Subject Area]] |
[[SubjectAreaTemplates|Templates by Subject Area]] |
Revision as of 15:33, 2 December 2010
Answer is a Point or a List of Points
This PG code shows how to evaluate answers that are points or lists of points.
- Download file: File:PointAnswers1.txt (change the file extension from txt to pg when you save it)
- File location in NPL:
FortLewis/Authoring/Templates/Precalc/PointAnswers1.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", "AnswerFormatHelp.pl", "contextLimitedPoint.pl", ); TEXT(beginproblem()); |
Initialization:
We only need to load |
Context("LimitedPoint"); $f = Compute("x^2-1"); $xint = List( Point("(1,0)"), Point("(-1,0)") ); $yint = List( Point("(0,-1)") ); |
Setup:
We could have used |
Context()->texStrings; BEGIN_TEXT Enter the x-intercept(s) and y-intercept(s) of \( y = $f \). Enter a point as \( (a,b) \), including the parentheses. If there is more than one correct answer, enter a comma separated list of points. $BR $BR x-intercept(s): \{ ans_rule(20) \} \{ AnswerFormatHelp("points") \} $BR y-intercept(s): \{ ans_rule(20) \} \{ AnswerFormatHelp("points") \} END_TEXT Context()->normalStrings; |
Main Text: Be sure to tell students the proper syntax for how to enter their answers. |
$showPartialCorrectAnswers = 1; ANS( $xint->cmp() ); ANS( $yint->cmp() ); |
Answer Evaluation: |
Context()->texStrings; BEGIN_SOLUTION ${PAR}SOLUTION:${PAR} Solution explanation goes here. END_SOLUTION Context()->normalStrings; COMMENT('MathObject version.'); ENDDOCUMENT(); |
Solution: |