Difference between revisions of "PointsInAnswers"

From WeBWorK_wiki
Jump to navigation Jump to search
m (New page: <h2>Points in Student Answers</h2> <!-- Header for these sections -- no modification needed --> <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> <em>This PG co...)
 
 
(9 intermediate revisions by 3 users 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/PointAnswers.html a newer version of this problem]</p>
  +
  +
 
<h2>Points in Student Answers</h2>
 
<h2>Points in Student Answers</h2>
   
Line 60: Line 65:
 
<p>
 
<p>
 
<b>Setup:</b>
 
<b>Setup:</b>
Everything is as usual.
 
  +
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>
If we had loaded <code>parserVectorUtils.pl</code> instead, we would use <code>Context("Vector2D");</code> for two-dimensional space or <code>Context("Vector");</code> for three-dimensional space.
+
Alternatively, if we had loaded <code>parserVectorUtils.pl</code>, we would use <code>Context("Vector2D");</code> for two-dimensional space or <code>Context("Vector");</code> for three-dimensional space.
 
</p>
 
</p>
   
Line 76: Line 81:
 
Context()->texStrings;
 
Context()->texStrings;
 
BEGIN_TEXT
 
BEGIN_TEXT
If \( y = f(x) = $f \), find
+
If \( y = f(x) = $f \), find the x- and y-intercepts.
the x- and y-intercepts. Enter your
+
Enter your answers as points \( (a,b) \) that include parentheses.
answers as points \( (a,b) \) that
 
include parentheses.
 
 
$BR
 
$BR
 
x-intercept: \{ ans_rule(15) \}
 
x-intercept: \{ ans_rule(15) \}
Line 106: Line 111:
 
<p>
 
<p>
 
<b>Answer Evaluation:</b>
 
<b>Answer Evaluation:</b>
As is the answer.
 
  +
We can control the hints students receive using <code>cmp(showDimensionHints=>1, showCoordinateHints=>1)</code>.
  +
For all options, see "Flags for Point()->cmp" on [http://webwork.maa.org/pod/pg/doc/MathObjects/MathObjectsAnswerCheckers.html MathObjectsAnswerCheckers.html]
 
</p>
 
</p>
 
</td>
 
</td>
Line 115: Line 121:
 
[[IndexOfProblemTechniques|Problem Techniques Index]]
 
[[IndexOfProblemTechniques|Problem Techniques Index]]
 
</p>
 
</p>
  +
  +
   
 
[[Category:Problem Techniques]]
 
[[Category:Problem Techniques]]
  +
  +
  +
  +
<ul>
  +
<li>POD documentation: [http://webwork.maa.org/pod/pg/macros/contextLimitedPoint.pl.html contextLimitedPoint.pl.html]</li>
  +
<li>PG macro: [http://webwork.maa.org/viewvc/system/trunk/pg/macros/contextLimitedPoint.pl?view=log contextLimitedPoint.pl]</li>
  +
<li>[http://webwork.maa.org/wiki/Specialized_contexts Specialized_contexts]</li>
  +
</ul>
  +
  +
  +
  +
<ul>
  +
<li>POD documentation: [http://webwork.maa.org/pod/pg/doc/MathObjects/MathObjectsAnswerCheckers.html MathObjectsAnswerCheckers.html]</li>
  +
</ul>

Latest revision as of 11:14, 16 July 2023

This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.

This problem has been replaced with a newer version of this problem


Points in Student Answers


This PG code shows how to check student answers that are points.

Problem Techniques Index

PG problem file Explanation
DOCUMENT();

loadMacros(
"PGstandard.pl",
"contextLimitedPoint.pl",
"PGcourse.pl",
);

TEXT(beginproblem());

Initialization: We load the contextLimitedPoint.pl macro which automatically loads MathObjects.pl. The LimitedPoint context does not allow operations between points.

Alternatively, instead of loading contextLimitedPoint.pl, we could have loaded MathObjects.pl and parserVectorUtils.pl. This would allow operations, such as addition and subtraction, between points.

Context("LimitedPoint");

$f = Formula("2-x");

$xint = Point("(2,0)");
$yint = Point("(0,2)");

Setup: Everything is as usual. The LimitedPoint context does not allow operations among points (such as adding, etc.). We could have used Context("Point"); instead.

Alternatively, if we had loaded parserVectorUtils.pl, we would use Context("Vector2D"); for two-dimensional space or Context("Vector"); for three-dimensional space.

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 cmp(showDimensionHints=>1, showCoordinateHints=>1). For all options, see "Flags for Point()->cmp" on MathObjectsAnswerCheckers.html

Problem Techniques Index