I'd like to ask that the documentation be clarified on a confusing point.
According to several sources, including https://stackoverflow.com/questions/42068/how-do-i-handle-newlines-in-json, json format does not support imbedded newline characters. However, the example in section 9.1 (https://coderunner.org.nz/mod/book/view.php?id=198&chapterid=820) implies such is indeed supported. In the example, the python code (without much explanation) simply prints new line characters (without escaping them) into a string which is later interpolated into the string printed to stdout. The implication is this is the correct way to achieve newlines in the output of a custom grader.
What should be clarified unambiguously in the documentation (in my opinion) is exactly what needs to be printed to stdout. Should the output contain newline characters or should they contain a backslash followed by an n?
Of course anyone interested can experiment to find out, but it would be better, in my opinion, that the documentation explain this explicitly.