Difference between revisions of "SnippetTemplate"

From WeBWorK_wiki
Jump to navigation Jump to search
m (3 revisions: import all default namespace pages from old wiki)
Line 109: Line 109:
<li>POD documentation: [http://webwork.maa.org/doc/cvs/pg_CURRENT/ nameOfMacro.pl.html]</li>
<li>POD documentation: [https://webwork.maa.org/pod/pg/current/nameOfMacro.html nameOfMacro.pl]</li>
<li>PG macro: [http://cvs.webwork.rochester.edu/viewcvs.cgi/pg/macros/#dirlist nameOfMacro.pl]</li>
<li>PG macro: [https://github.com/openwebwork/pg/blob/master/macros/nameOfMacro.pl nameOfMacro.pl]</li>

Latest revision as of 23:41, 14 April 2021

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.

Problem Techniques Index

PG problem file Explanation

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 -------.pl.

Define context and  variables for the questions

$expr = Formula("....");

Setup: We specify that the Context should be ......, and define the answer to be a formula.

Notes: on using this and related Contexts.

...... question text ......

Main Text: The problem text section of the file is as we'd expect.

$showPartialCorrectAnswers = 1;

ANS( $expr->cmp() );


Answer Evaluation: As is the answer.

Problem Techniques Index