Any element of the hash %Global::PG_environment
will also be inserted as an environmental variable. These elements are most
often defined in webworkCourse.ph. (Every variable in webworkCourse.ph
is implicitly in the package Global::, hence in that file you don't need to
include the prefix., a statement such as
$PG_environment{NEW_ENVIRONMENT_VARIABLE} = 5000;
will be enough. )
This defines an environment variable $NEW_ENVIRONMENT_VARIABLE
which can be used in any problem and which has the value of 5000.
You should use this feature cautiously. Because these PG_environment environment variables
are the last ones defined, they can overwrite previously defined environment variables, and
this might cause unexpected problems if it is done accidently.
Here are several environment variables commonly defined in webworkCourse.ph.
PRINT_FILE_NAMES_FOR
$PG_environment{'PRINT_FILE_NAMES_FOR'} = ['gage','apizer'];
is used by the macro beginproblem()
defined in PGbasicmacros.pl. If the current users name
is in this array reference, then beginproblem()
prints out the name of the file containing the problem template, in
addition to printing the number of points the problem is worth, and
other information. This is very helpful for making corrections to the
problem template.
PROBLEM_GRADER_TO_USE
$PG_environment{PROBLEM_GRADER_TO_USE} = 'std_problem_grader';
Defines the 'std_problem_grader' as the one to use in grading
a problem, unless the problem explicitly asks that another problem be
used.
This variable is used in the ENDDOCUMENT()
mac