Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a
getSampleProblemCode
method to SampleProblemParser.pm
.
This method is much more efficient than calling `parseSampleProblem` to obtain the code as it does not parse documentation, does not require that the sample problem metadata be parsed first, and it does not need macro POD information. Note that to obtain the code via the `parseSampleProblem` method, 253 files need to be read and parsed (all sample problems and all macros). The `getSampleProblemCode` method only needs to read 1 file, and the parsing of that is more efficient as well. It should be used if all you want is the code as it does not return the documentation and other data returned by the `parseSampleProblem` method. Also remove the unused `$macro_locations` argument to the `parseMetadata` method. These changes are used to implement sample problem editing in the PG problem editor for webwork2 in a corresponding pull request.
- Loading branch information