The JavaScript autograder consists of two key functions where tests can be implemented:
beforeRun(code)
code
is an object with keys student
and solution
code.student
→ A string containing all of the student’s code.code.solution
→ A string containing all of the solution code.afterRun(output)
output
is an object mapping {String:object}. The keys are student
and solution
output.student
→ An object containing different types of student output:
output.student.console
→ Array of strings, each representing a line of console output from the student’s program.output.student.graphics
→ Array of graphic objects created by the student’s program.output.solution
→ An object similar to output.student
, but for the solution program.💡 Important: The console
output does not include text that was printed using readInt
, readLine
, etc.