Difference between revisions of "PointsInAnswers"
Line 49: | Line 49: | ||
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context(" |
+ | Context("LimitedPoint"); |
− | # Context("LimitedPoint"); |
||
$f = Formula("2-x"); |
$f = Formula("2-x"); |
||
Line 60: | Line 60: | ||
<p> |
<p> |
||
<b>Setup:</b> |
<b>Setup:</b> |
||
− | Everything is as usual. The <code>LimitedPoint</code> context does not allow operations among points (such as adding, etc.). |
+ | Everything is as usual. The <code>LimitedPoint</code> context does not allow operations among points (such as adding, etc.). We could have used <code>Context("Point");</code> instead. |
</p> |
</p> |
||
<p> |
<p> |
Revision as of 15:11, 18 February 2010
Points in Student Answers
This PG code shows how to check student answers that are points.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "contextLimitedPoint.pl", "PGcourse.pl", ); TEXT(beginproblem()); |
Initialization:
We load the Alternatively, instead of loading |
Context("LimitedPoint"); $f = Formula("2-x"); $xint = Point("(2,0)"); $yint = Point("(0,2)"); |
Setup:
Everything is as usual. The
If we had loaded |
Context()->texStrings; BEGIN_TEXT If \( y = f(x) = $f \), find the x- and y-intercepts. Enter your answers as points \( (a,b) \) that include parentheses. $BR x-intercept: \{ ans_rule(15) \} $BR y-intercept: \{ ans_rule(15) \} END_TEXT Context()->normalStrings; |
Main Text: The main text section of the file is as we'd expect. |
ANS( $xint->cmp() ); ANS( $yint->cmp() ); ENDDOCUMENT(); |
Answer Evaluation:
We can control the hints students receive using |
- POD documentation: contextLimitedPoint.pl
- PG macro: contextLimitedPoint.pl
- Specialized_contexts
- POD documentation: MathObjectsAnswerCheckers.html