aga grades assignments
Project description
aga
aga (aga grades assignments) is a tool for easily producing autograders for python programming assignments, originally developed for Reed College's CS1 course.
Installation
Install from pip:
pip install aga
Quickstart
In square.py
(or any python file), write:
from aga import problem, test_case
@test_case(-3)
@test_case(100)
@test_case(2, aga_output=4)
@test_case(-2, aga_output=4)
@problem()
def square(x: int) -> int:
"""Square x."""
return x * x
Then run aga gen square
from the directory with square.py
. This will generate a ZIP file suitable for upload to gradescope.
Usage
Aga relies on the notion of a golden solution to a given problem which is known to be correct. The main work of the library is to compare the output of this golden solution on some family of test inputs against the output of a student submission. To that end, aga integrates with frontends: existing classroom software which allow submission of student code. Currently, only gradescope is supported.
To use aga:
- Write a golden solution to some programming problem.
- Decorate this solution with the
problem
decorator. - Decorate this problem with any number of
test_case
decorators, which take arbitrary positional or keyword arguments and pass them verbatim to the golden and submitted functions. - Generate the autograder using the CLI:
aga gen <function_name>
.
The test_case
decorator may optionally take a special keyword argument called aga_output
. This allows easy testing of the golden solution: aga will not successfully produce an autograder unless the golden solution's output matches the aga_output
. You should use these as sanity checks to ensure your golden solution is implemented correctly.
For complete documentation, including configuring problem and test case metadata, see the API reference.
For CLI documentation, run aga --help
, or access the docs online.
Contributing
Bug reports, feature requests, and pull requests are all welcome. For details on our test suite, development environment, and more, see the developer documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aga-0.5.0.tar.gz
.
File metadata
- Download URL: aga-0.5.0.tar.gz
- Upload date:
- Size: 17.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.15.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2909d23154587cd0a380058ccaa2ecfede118bcbafba4f550fc872f5d3768ca4 |
|
MD5 | f5324dbb501784da93af32af8e8d208a |
|
BLAKE2b-256 | 006adca50144f14c9489da272abe66fa5f4b4ab5762b1ab792ac6fe8a8957fd9 |
File details
Details for the file aga-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: aga-0.5.0-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.6 Linux/5.15.0-1017-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cf0aa5340184b68cedd0614299601780612bc4509f10e42ccd69b311f85b275 |
|
MD5 | d04ccdcf325b3e8319092e746cc73d68 |
|
BLAKE2b-256 | f01963c78553ddce730658dee5f1dace0ec42ca3df4d5c53793abc1a66fc2420 |