Commit 06145e9
committed
Add a
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.getSampleProblemCode method to SampleProblemParser.pm.1 parent c50623b commit 06145e9
1 file changed
+40
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
231 | 268 | | |
0 commit comments