WeBWorK::PG::Local - Use the WeBWorK::PG API to invoke a local WeBWorK::PG::Translator object.
WeBWorK::PG::Local encapsulates the PG translation process, making multiple calls to WeBWorK::PG::Translator. Much of the flexibility of the Translator is hidden, instead making choices that are appropriate for the webwork2 system
It implements the WeBWorK::PG interface and uses a local WeBWorK::PG::Translator to perform problem rendering. See the documentation for the WeBWorK::PG module for information about the API.
WeBWorK::PG::Local goes through the following operations when constructed:
Instantiate a WeBWorK::PG::Translator object.
Set the translator's directory hash (courseScripts, macros, templates, and temp directories) from the course environment.
Using the module list from the course environment (pg->modules), perform a ``use''-like operation to evaluate modules at runtime.
Use data from the user, set, and problem, as well as the course environemnt and translation options, to set the problem environment. The default subroutine, &WeBWorK::PG::defineProblemEnvir, is used.
Call &WeBWorK::PG::Translator::initialize. What more do you want?
These macros must be loaded without opcode masking, so they are loaded here.
Set the opcode mask to the default specified by WeBWorK::PG::Translator.
Give the problem source to the translator.
The safety filter is used to preprocess student input before evaluation. The default safety filter, &WeBWorK::PG::safetyFilter, is used.
Call &WeBWorK::PG::Translator::translate to render the problem source into the format given by the display mode.
Use form field inputs to evaluate student answers.
Use values from the database to initialize the problem state, so that the grader will have a point of reference.
Use the ANSWER_ENTRY_ORDER flag to determine the order of answers in the problem. This is important for problems with dependancies among parts.
Use the PROBLEM_GRADER_TO_USE flag, or a default from the course environment, to install a grader.
Use the selected grader to grade the problem.
Written by Sam Hathaway, sh002i (at) math.rochester.edu.