Difference between revisions of "SnippetTemplate"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
||
− | <em>This code |
+ | <em>This PG code shows how to check student answers that are equations. Note that this is an <b>insertion</b>, not a complete PG file. This code will have to be incorporated into the problem file on which you are working.</em> |
</p> |
</p> |
||
Revision as of 19:40, 14 April 2010
Your title here: PG Code Snippet
This PG code shows how to check student answers that are equations. Note that this is an insertion, not a complete PG file. This code will have to be incorporated into the problem file on which you are working.
PG problem file | Explanation |
---|---|
DOCUMENT(); loadMacros( "PGstandard.pl", "MathObjects.pl", ); TEXT(beginproblem()); |
Initialization:
To do ..(what you are doing)........., we don't have to change the
tagging and documentation section of the problem file.
In the initialization section, we need to include the macros file |
Context("....."); Define context and variables for the questions $expr = Formula("...."); |
Setup:
We specify that the Context should be Notes: on using this and related Contexts. |
BEGIN_TEXT ...... question text ...... END_TEXT |
Main Text: The problem text section of the file is as we'd expect. |
$showPartialCorrectAnswers = 1; ANS( $expr->cmp() ); ENDDOCUMENT(); |
Answer Evaluation: As is the answer. |