NAME

WeBWorK::PG::SampleProblemParser - Parse sample problems and extract metadata, documentation, and code.

parseSampleProblem

Parse a PG file with extra documentation comments. The input is the file and a hash of global variables:

generateMetadata

Build a hash of metadata for all PG files in the given directory. A reference to the hash that is built is returned.

getSampleProblemCode

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.

getSearchData

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.