Repository navigation
Conversation
ProblemParser.pm parses a pg problem into the source and metadata and can extract all correct answers. test-pg-problem.pl runs tests on a set of pg problems and outputs the results in various formats.
pstaabp
force-pushed
the
test-pg-problems
branch
from
October 20, 2026 18:08
ef4d681 to
46fbd19
Compare
Member
Author
|
I've removed the pg-critic and check-metadata options from the script. This still has the parsing of the testing information in a YAML block, but if we decide to go with the mini-YAML block as in #1558, then I'll update to support that. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think it's time to get this into the wild... at least as a draft. I've been using this for problems updated in the OPL.
This is a test script with a helper module.
test-pg-problem.plruns tests on a set of pg problems and outputs the results in various formats.ProblemParser.pmparses a pg problem into the source and metadata and then can be used to extract correct answers from a problem.I have run this on a few thousand problems in the OPL. It skips any problems with non-Math Object answer checking. There are still a few issues that I haven't ironed out yet--some are listed below.
For testing, the script can extract the correct answers from a problem and then test that those answers are correct. Otherwise, if testing data is within the problem. I have converted some problems into a YAML block at the bottom of the file), then it will test against those answers. I was thinking this is helpful for testing different correct answers (MultiAnswer) or different format of answers. I have examples in a repository: https://github.com/pstaabp/OPL-next
Note: I have a script to take problems and convert them to this new YAML format. This will be submitted later, but there is some code related to this in this branch. I can remove this if needed.
There is still some work to do on this. A couple of known problems that I haven't figured out:
Contrib/Hope/Multi1/05-04-Diagonalization/Geom_diag_03.pgis giving errors I can't track down yet. It may be that it is in a scaffold.