Skip to content

Hohnik/Grader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automated Python Grading System

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.

For Server Administrators

System Requirements

  • Python 3.12+
  • Docker Desktop (for macOS/Windows) or Docker Engine (for Linux)
  • uv (for dependency management)

Initial Setup

  1. Clone the repository:
git clone <repository-url>
cd grader
  1. Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install uv and dependencies:
pip install uv
cd service
uv sync
  1. Start the grading service:
uvicorn api.main:app --host 0.0.0.0 --port 8000

Configuration

  • Ensure Docker is installed and running
  • The service stores submissions in service/_submissions/<course>/<student>/<submission_id>/
  • Logs are written to service/grader.log

For Teachers

Creating a New Course

  1. 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
# TODO: Example here
  1. 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
  1. Run the upload script:
python submit_prof.py

For Students

Submitting Assignments

  1. Edit your config.yaml:
student_name: "s-username"
course_name: "Programmieren"
server_url: "http://localhost:8000"
  1. 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
  1. Submit your solution:
python submit_stud.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages