Difference between revisions of "PointAnswers1"
(add historical tag and give links to newer problems.) |
|||
(4 intermediate revisions by 2 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>Answer is a Point or a List of Points</h2> |
<h2>Answer is a Point or a List of Points</h2> |
||
Line 5: | Line 10: | ||
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. |
||
</p> |
</p> |
||
− | * Download file: [[File:PointAnswers1.txt]] (change the file extension from txt to pg when you save it) |
||
+ | * File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Precalc/PointAnswers1.pg FortLewis/Authoring/Templates/Precalc/PointAnswers1.pg] |
||
− | * File location in NPL: <code>FortLewis/Authoring/Templates/Precalc/PointAnswers1.pg</code> |
||
+ | * PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/Precalc/PointAnswers1_PGML.pg FortLewis/Authoring/Templates/Precalc/PointAnswers1_PGML.pg] |
||
− | |||
<br clear="all" /> |
<br clear="all" /> |
||
Line 17: | Line 21: | ||
<tr valign="top"> |
<tr valign="top"> |
||
− | <th> PG problem file </th> |
+ | <th style="width: 40%"> PG problem file </th> |
<th> Explanation </th> |
<th> Explanation </th> |
||
</tr> |
</tr> |
||
Line 44: | Line 48: | ||
loadMacros( |
loadMacros( |
||
− | + | 'PGstandard.pl', |
|
− | + | 'MathObjects.pl', |
|
− | + | 'contextLimitedPoint.pl', |
|
− | + | 'PGML.pl', |
|
+ | 'PGcourse.pl' |
||
); |
); |
||
Line 67: | Line 71: | ||
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context( |
+ | Context('LimitedPoint'); |
− | $f = Compute( |
+ | $f = Compute('x^2-1'); |
− | $xint = List( Point( |
+ | $xint = List( Point('(1,0)'), Point('(-1,0)') ); |
− | + | $yint = List( Point('(0,-1)') ); |
|
− | $yint = List( Point("(0,-1)") ); |
||
</pre> |
</pre> |
||
</td> |
</td> |
||
Line 95: | Line 99: | ||
<td style="background-color:#ffdddd;border:black 1px dashed;"> |
<td style="background-color:#ffdddd;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context()->texStrings; |
||
+ | BEGIN_PGML |
||
− | BEGIN_TEXT |
||
+ | Enter the [`x`]-intercept(s) and [`y`]-intercept(s) |
||
− | Enter the x-intercept(s) and y-intercept(s) |
||
+ | of [` y = [$f] `]. Enter a point as [` (a,b) `], |
||
− | of \( y = $f \). Enter a point as \( (a,b) \), |
||
+ | including the parentheses. If there is more |
||
− | including the parentheses. If there is more |
||
+ | than one correct answer, enter a comma |
||
− | than one correct answer, enter a comma |
||
separated list of points. |
separated list of points. |
||
− | $BR |
||
+ | |||
− | $BR |
||
+ | + [`x`]-intercept(s): [_________________]{$xint} |
||
− | x-intercept(s): \{ ans_rule(20) \} |
||
+ | |||
− | \{ AnswerFormatHelp("points") \} |
||
+ | + [`y`]-intercept(s): [_________________]{$yint} |
||
− | $BR |
||
+ | |||
− | y-intercept(s): \{ ans_rule(20) \} |
||
+ | [@ helpLink('points') @]* |
||
− | \{ AnswerFormatHelp("points") \} |
||
+ | END_PGML |
||
− | END_TEXT |
||
− | Context()->normalStrings; |
||
</pre> |
</pre> |
||
<td style="background-color:#ffcccc;padding:7px;"> |
<td style="background-color:#ffcccc;padding:7px;"> |
||
Line 116: | Line 117: | ||
<b>Main Text:</b> |
<b>Main Text:</b> |
||
Be sure to tell students the proper syntax for how to enter their answers. |
Be sure to tell students the proper syntax for how to enter their answers. |
||
− | </p> |
||
− | </td> |
||
− | </tr> |
||
− | |||
− | <!-- Answer evaluation section --> |
||
− | |||
− | <tr valign="top"> |
||
− | <td style="background-color:#eeddff;border:black 1px dashed;"> |
||
− | <pre> |
||
− | $showPartialCorrectAnswers = 1; |
||
− | |||
− | ANS( $xint->cmp() ); |
||
− | |||
− | ANS( $yint->cmp() ); |
||
− | </pre> |
||
− | <td style="background-color:#eeccff;padding:7px;"> |
||
− | <p> |
||
− | <b>Answer Evaluation:</b> |
||
</p> |
</p> |
||
</td> |
</td> |
||
Line 143: | Line 126: | ||
<td style="background-color:#ddddff;border:black 1px dashed;"> |
<td style="background-color:#ddddff;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context()->texStrings; |
||
+ | BEGIN_PGML_SOLUTION |
||
− | BEGIN_SOLUTION |
||
− | ${PAR}SOLUTION:${PAR} |
||
Solution explanation goes here. |
Solution explanation goes here. |
||
− | END_SOLUTION |
||
+ | END_PGML_SOLUTION |
||
− | Context()->normalStrings; |
||
− | |||
− | COMMENT('MathObject version.'); |
||
− | |||
ENDDOCUMENT(); |
ENDDOCUMENT(); |
||
</pre> |
</pre> |
||
Line 168: | Line 145: | ||
[[Category:Top]] |
[[Category:Top]] |
||
− | [[Category: |
+ | [[Category:Sample Problems]] |
+ | [[Category:Subject Area Templates]] |
Latest revision as of 05:08, 18 July 2023
This problem has been replaced with a newer version of this problem
Answer is a Point or a List of Points
This PG code shows how to evaluate answers that are points or lists of points.
- File location in OPL: FortLewis/Authoring/Templates/Precalc/PointAnswers1.pg
- PGML location in OPL: FortLewis/Authoring/Templates/Precalc/PointAnswers1_PGML.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( 'PGstandard.pl', 'MathObjects.pl', 'contextLimitedPoint.pl', 'PGML.pl', 'PGcourse.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 |
BEGIN_PGML 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. + [`x`]-intercept(s): [_________________]{$xint} + [`y`]-intercept(s): [_________________]{$yint} [@ helpLink('points') @]* END_PGML |
Main Text: Be sure to tell students the proper syntax for how to enter their answers. |
BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION ENDDOCUMENT(); |
Solution: |