PG language Reference
-
Specifications of data types
-
Managing answers: Answer label specifications.
-
Describes the rules for labeling answer rules and answer evaluators, as
well as the macros which define answer rules and answer evaluators.
-
Answer hash datatype specification
-
Each answer evaluator should accept a single input from the student and
return an answer hash satisfying these specifications.
-
PG environment variables
-
A list of all of the variables that are predefined for a WeBWorK PG problem.
-
Define your own environment variables
-
How to define additional environment variables in webworkCourse.ph using
%PG_environment
List of Pod documents
Detailed descriptions of macros These
descriptions are intermixed with the code itself. They are likely to be
somewhat technical and terse, but, since they are close to the actual
code, they are also likely to be the most up-to-date and complete
descriptions available.
Note: If your are accessing this page from webwork.math.rochester.edu , these descriptions may not be viewable. If not, connect to our dynamic site webhost.math.rochester.edu/webworkdocs to view the descriptions.
-
PGtranslator.pm
-
The main code for rendering PG problems is found here. There is an
example showing the PGtranslator methods used in rendering a problem.
-
Macros in the file PG.pl
-
This macro file contains the macros which define the basic aspects of the Program Generating language.
DOCUMENT(); TEXT(); HEADER_TEXT(); ANS(); ENDDOCUMENT;
-
Macros in the file dangerousMacros.pl
-
This implements macros that require access to disk files:
alias, loadMacros,insertGraph,tth
-
Macros in the file extraAnswerEvaluators.pl
-
As the name implies, this contains additional answer evaluators contributed by John Jones at Arizona State University.
-
Macros in the file PGasu.pl
-
Additional macros contributed by John Jones at Arizona State University.
-
Macros in the file PGanswermacros.pl
-
This contains some details on how to use the basic answer evaluator
factories -- num_cmp, str_cmp and function_cmp. This documentation, and
the implementation of answer macros is due for redesign and
streamlining this summer.
-
Macros in the file PGbasicmacros.pl
-
The majority of the commonly used macros are in this file, including
ans_rule
-
Macros in the file PG_CAPAmacros.pl
-
Contains the runtime macros used to render files translated from the CAPA
language. (Currently these are mostly physics problems.)
-
Macros in the file PGchoicemacros.pl
-
Describes the basic macros for implimenting matching lists and true false questions. For examples see the Matching list example and the True false example
above. For more details look at the Match and Select packages described
below. Some older macros which were used in the past to implement
matching lists are also available, for backward compatibility.
-
Macros in the file PGcomplexmacros.pl
-
This describes some of the macros for printing and manipulating complex numbers. See also Complex.pm
-
Macros in the file PGdiffeqmacros.pl
-
Describes the macros for use with differential equations. While these
macros have been used in courses at the University of Rochester, these
macros
have not yet been completely tested and polished. Regard them as a Beta release and use at your own risk.
-
Macros in the file PGgraders.pl
-
A collection of alternative graders -- different methods of scoring the problems.
-
Macros in the file PGgraphmacros.pl
-
Describes the macros for simple uses of the graph objects.
-
Macros in the file PGmatrixmacros.pl
-
This describes some of the macros which manipulate and display matrices. See also Matrix.pm.
-
Macros in the file PGnumericalmacros.pl
-
This describes some of the numerical routines, including Newton's
method, and integration routines, which can be used in defining PG
problems.
-
Macros in the file PGpolynomialmacros.pl
-
Describes the macros for manipulating polynomials as objects.
-
Macros in the file PGstatisticsmacros.pl
-
Describes a few macros for statistics, in particular there are formulas
for calculating the area under the normal distribution between two
points (as well as the inverse of this function). See also Distributions.pm and Regression.pm
-
Macros in the file StdConst.pg and StdUnits.pg
-
These files contain runtime constants used by files translated from the CAPA language.
-
Detailed descriptions of packages augmenting the PG language:
These descriptions are intermixed with the code itself. They are likely
to be somewhat technical and terse, but, since they are close to the
actual code, they are also likely to be the most up-to-date and
complete descriptions available. - The AnswerHash.pm interface
-
Describes the structure of the AnswerHash object used by all answer
evaluators. Also contains a description of the AnswerEvaluator object
which can be used to build answer evaluators.
-
The Circle.pm interface
-
Describes the circle graph object.
-
The Complex.pm interface
-
Describes complex number objects.
-
The Distributions.pm interface
-
Objects for statistics problems
-
The Fun.pm interface
-
Describes the commands recognized by the function objects (which live
in the graph object). This is useful for creating more complicated
graphics examples than those described in PGgraphmacros.pl for
constructing PG macros such as those in PGgraphmacros.pl. T hey can
also be used directly to create things such as parametric functions, or
functions with complicated definitions or other special functions that
are not easily handled by the macro
plot_functions in PGgraphmacros.pl.
-
The Hermite.pm interface
-
Describes the commands for defining a Hermite polynomial (for use in drawing graphs).
-
The Label.pm interface
-
Describes the label graph object.
-
The List.pm interface
-
The list object is a powerful replacement for both the Match.pm and Select.pm modules. It also has additional capabilities.
-
The Match.pm interface
-
Describes the commands for writing questions involving matching.
-
The Matrix.pm interface
-
Describes matrix objects and operations
-
The Multiple.pm interface
-
Describes the commands for writing multiple choice objects.
-
The PGrandom.pm interface
-
Low level pseudo-random generator object. Used mostly in other macro files.
-
The Regression.pm interface
-
Objects for use in statistics problems.
-
The Select.pm interface
-
Describes the commands for writing true-false questions or lists of short answer questions.
-
The Units.pm interface
-
Describes the basic command for using units in answers. There is also a complete List of Units one can use. See also macros in the file PGanswermacros.pl
-
The VectorField.pm interface
-
Describes the commands for drawing graphs of vector fields.
-
The WWPlot.pm interface
-
Describes the commands recognized by the graph objects. Useful for
constructing PG macros such as the ones in PGgraphmacros.pl
- The GD.pm interface
- Each WWPlot object contains a GD object in which to draw. The GD.pm
module is maintained on CPAN. You can reach the GD object within WWplot
like so:
$gd_object = $wwplot_object->im$ .
<| Post or View Comments |> |