gradescope / gradescope-utils

Python package for building Gradescope autograders
https://gradescope-utils.readthedocs.io/en/latest/
MIT License
34 stars 25 forks source link

Instructors can override results (e.g. set late penalties) in a post-processor function #16

Closed ibrahima closed 4 years ago

ibrahima commented 4 years ago

Adds a callback function to JSONTestRunner which can be used to modify the autograder results at the end of the test suite but before they are written to disk.

Usage Example:

def post_process(results):
    results["score"] = 9001

if __name__ == '__main__':
    suite = unittest.defaultTestLoader.discover('tests')

    JSONTestRunner(visibility='visible', post_processor=post_process).run(suite)