Class SelfScoredOracle


  • public class SelfScoredOracle
    extends Oracle
    An oracle that scans the output for the score. Each line is matched against a pattern that must supply a named capturing group "pts" and, optionally, a named capturing group "poss". If the pattern provides only pts, the match is considered to be the score. If the pattern provides both pts and poss, the score is 100*pts/poss. The patten is applied to each line of the out. It can match a substring of that line. The last line of observed output containing a match to the pattern is the one that is used.
    • Constructor Detail

      • SelfScoredOracle

        public SelfScoredOracle​(OracleProperties config,
                                TestCase testCase,
                                Submission submission,
                                Stage submitterStage)
        Create a new oracle.
        Parameters:
        config - configuration properties
        testCase - the test case to which this oracle will apply
        submission - the submission being judged
        submitterStage - the stage where the submitted code has been built
    • Method Detail

      • compare

        public OracleResult compare​(java.lang.String expected,
                                    java.lang.String actual)
        Compare two strings to see if one is an acceptable variant of the other. The precise meaning of "acceptable" depends on the settings.
        Specified by:
        compare in class Oracle
        Parameters:
        expected - the expected string
        actual - the string being examined
        Returns:
        true if actual is an acceptable variant of expected.