This README is under construction!
- TODO: document CHECKOUT and SOURCES, more broadly the build infrastructure
- TODO: add some example scripts because walls of text aren't always useful
This template closely follows the shape of the Gradescope API specification.
I strongly recommend reading this, and maybe even playing around with it to get a feel for how it works.
At the highest level, we're reading some student submitted file(s) and writing JSON to results/results.json
.
Gradescope promises to read this and show a prettier and possibly truncated version of this to the student, as feedback for their submission.
Zooming in a little, this feedback consists of a sequence of test cases.
Cases are the basic building blocks of the template (in code this is the Case
class).
This is a shared concept between the Gradescope API and this template, so many Case
fields are directly passed to it.
It is the responsibility of the script author to produce a sequence of test cases (see get_test_cases
; it may be helpful to read the function autograder_main
).
The Case
class isn't useful on its own, since it doesn't do anything, it's just an interface.
Instead, you can use the subclasses defined in cases.py
to evaluate the submission.
If the functionality you're looking for isn't present or is inadequate, you can totally write your own subclasses and use them in your scripts!
This repository is laid out so that you can run script_*.py
and it should work as expected.
It will look for submission files in submission/
.
Once you've run it, take a look at results/results.json
for your output, as Gradescope will see it.
The zip file must contain the following:
setup.sh
run_autograder
- Source code for the autograding script (probably
*.py
)
The build.py
script is cross-platform and creates a conformant ZIP file.
Run it by invoking Python:
$ python3 tools/build.py --help
This template is licensed under the MIT No Attribution license (SPDX: MIT-0
).