A containerized grading system for Python(for now) assignments that provides automated testing and scoring. The system supports weighted tests and maintains a history of student submissions.
- Python 3.12+
- Docker Desktop (for macOS/Windows) or Docker Engine (for Linux)
- uv (for dependency management)
- Clone the repository:
git clone <repository-url>
cd grader
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install uv and dependencies:
pip install uv
cd service
uv sync
- Start the grading service:
uvicorn api.main:app --host 0.0.0.0 --port 8000
- Ensure Docker is installed and running
- The service stores submissions in
service/_submissions/<course>/<student>/<submission_id>/
- Logs are written to
service/grader.log
- Create a container and upload it to dockerhub.
- It has to contain a
/app/src/
and/app/output/
directory. These will get mounted to the server. - The students code is mounted to
/app/src/
and the score needs to be written to/app/output/score.txt
- It has to contain a
# TODO: Example here
- Edit the
config.yaml
in your course directory:
username: example_username
password: example_password
course_name: example_course
container_name: example_user/example_repo:latest # TODO: Check if it is possible to make this a full URL
start_date: 02.12.2024
end_date: 30.12.2024
- Run the upload script:
python submit_prof.py
- Edit your
config.yaml
:
student_name: "s-username"
course_name: "Programmieren"
server_url: "http://localhost:8000"
- Create your solution in
src/main.py
:
# src/main.py
def add(a: int, b: int) -> int:
return a + b
def multiply(a: int, b: int) -> int:
return a * b
- Submit your solution:
python submit_stud.py