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() macro defined in PG.pl.
CAPA directories
The PG_environment feature is also used when
{relativeLink("rendering physics problems translated from CAPA", ,"http://webhost.math.rochester.edu/webworkdocs/docs/install/capamodifications")}
in order to specify the directories in which the translated CAPA problems and associated
graphics files can be found.
$PG_environment{'CAPA_Tools'} = "${macroDirectory}CAPA_Tools/";
$PG_environment{'CAPA_MCTools'} = "${macroDirectory}CAPA_MCTools/";
$PG_environment{'CAPA_Graphics_URL'} = "${htmlURL}CAPA_Graphics/";
$PG_environment{'CAPA_GraphicsDirectory'} = "${htmlDirectory}CAPA_Graphics/";
ALLOW_MAIL_TO
$PG_environment{'ALLOW_MAIL_TO'} =
['mth163Email-list@mail.math.rochester.edu','gage@math.rochester.edu',];
This is used by the mail_answers_to() macro defined in PGanswermacros.pl
as a safety feature and prevents responders from using the questionnaire feature to spam arbitrary mail addresses, by hacking the questionnaire response forms. Only the mail addresses listed in this array reference are legal.