WeBWorK::PG::SampleProblemParser - Parse sample problems and extract metadata, documentation, and code.
Parse a PG file with extra documentation comments. The input is the file and a hash of global variables:
metadata: A reference to a hash which has information (name, directory, types, subjects, categories) of every sample problem file.
macro_locations: A reference to a hash of macros to include as links within a problem.
pod_base_url: The base URL for the POD HTML files.
sample_problem_base_url: The base URL for the sample problem HTML files.
url_extension: The html url extension (including the dot) to use for pg doc links. The default is the empty string.
Build a hash of metadata for all PG files in the given directory. A reference to the hash that is built is returned.
Parse a PG file with extra documentation comments and strip that all out returning the clean problem code. This returns the same code that parseSampleProblem returns, except at much less expense as it does not parse the documentation, it does not require that the metadata be parsed first, and it does not need macro POD information.
Generate search data for sample problem files and macro POD. The only argument is required and should be a file name to write the search data to. If the file does not exist, then a new file containing the generated search data will be written. If the file exists and contains search data from previously using this method, then the data will be updated based on file modification times of the sample problem files and macros. In any case an array reference containing the generated search data will be returned.