CodeRunner Documentation (V3.1.0)

10.3 )

It was stated above that the values to be formatted by the format string (if given) were fields from the TestResult object. This is a slight simplification. The syntax actually allows for expressions of the form:

    filter(testResultField [,testResultField]... )

where filter is the name of a built-in filter function that filters the given testResult field(s) in some way. Currently the only such built-in filter function is diff. This is (or was) a function taking two test result fields as parameters and returning an HTML string that representing the first test field with embedded HTML <ins> and <del> elements that show the insertions and deletions necessary to convert the first field into the second. This was used to provide support for the Show Differences button, which the user could click in order to highlight differences between the Expected and Got fields. However that functionality is now provided by JavaScript; the Show Differences button is automatically displayed if an answer is being marked wrong and if an exact-match grader is being used. Hence the diff filter function is no longer functional but it remains supported syntactically to support legacy questions that use it.