Skip to content

FERPA-compliant grader assignment system using automated stable matching algorithms for Vanderbilt CS department

License

Notifications You must be signed in to change notification settings

vanderbilt-data-science/grade-match

Repository files navigation

Grader Assignment System

Python 3.11+ FastAPI React 18 TypeScript License: MIT

A modern, FERPA-compliant system for assigning graduate students to grading positions using automated stable matching algorithms. Replaces legacy Microsoft Access database with a robust, multi-user web application.

๐ŸŽฏ Overview

This system manages the assignment of approximately 150 graduate students to grading positions each semester at Vanderbilt University's Computer Science department. It automates the complex matching process between student preferences and faculty requirements while respecting various constraints and qualifications.

Key Features

  • Automated Matching: Modified Gale-Shapley algorithm ensures stable, fair assignments
  • Excel Integration: Import/export data from existing systems (Kuali, OAS)
  • Multi-User Concurrent Access: SQLite with WAL mode supports simultaneous editing
  • Real-Time Updates: WebSocket-based live updates across connected users
  • FERPA Compliant: Comprehensive audit logging and access controls
  • Manual Overrides: Administrators can adjust automated assignments with justification
  • Rich Reporting: Generate faculty feedback forms and assignment summaries

๐Ÿ“Š Success Metrics

Primary Validation: System matches 80%+ of historical Fall 2024 assignments when given the same input data.

Performance Targets:

  • Import 150 applications in <10 seconds
  • Complete matching algorithm in <5 seconds
  • Database queries return in <500ms
  • 90%+ test coverage

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     User's Computer                          โ”‚
โ”‚                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚         React Frontend (Port 3000)                  โ”‚    โ”‚
โ”‚  โ”‚  โ€ข TypeScript + shadcn/ui                          โ”‚    โ”‚
โ”‚  โ”‚  โ€ข TanStack Query for state management             โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                           โ†• HTTP/WebSocket                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚         FastAPI Backend (Port 8000)                 โ”‚    โ”‚
โ”‚  โ”‚  โ€ข REST API endpoints                               โ”‚    โ”‚
โ”‚  โ”‚  โ€ข WebSocket for real-time updates                 โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Business logic & matching algorithm             โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                           โ†• SQLAlchemy ORM                   โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚         SQLite Database (WAL mode)                  โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Student records & applications                   โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Course details & grades                          โ”‚    โ”‚
โ”‚  โ”‚  โ€ข Faculty rankings & assignments                   โ”‚    โ”‚
โ”‚  โ”‚  โ€ข FERPA-compliant audit log                        โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • Git

Installation

# Clone the repository
git clone https://github.com/vanderbilt-data-science/grade-match.git
cd grade-match

# Backend setup
cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

# Initialize database
alembic upgrade head

# Start backend server
uvicorn app.main:app --reload

# Frontend setup (in new terminal)
cd frontend
npm install
npm run dev

Access the application at http://localhost:3000

๐Ÿ“ Project Structure

grade-match/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ models/          # SQLAlchemy database models
โ”‚   โ”‚   โ”œโ”€โ”€ schemas/         # Pydantic validation schemas
โ”‚   โ”‚   โ”œโ”€โ”€ api/             # FastAPI route handlers
โ”‚   โ”‚   โ”œโ”€โ”€ services/        # Business logic & matching algorithm
โ”‚   โ”‚   โ”œโ”€โ”€ utils/           # Helper functions
โ”‚   โ”‚   โ”œโ”€โ”€ database.py      # Database configuration (WAL mode)
โ”‚   โ”‚   โ””โ”€โ”€ main.py          # FastAPI application entry
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”‚   โ”œโ”€โ”€ critical/        # Fall 2024 validation test
โ”‚   โ”‚   โ”œโ”€โ”€ integration/     # Workflow tests
โ”‚   โ”‚   โ””โ”€โ”€ performance/     # Performance benchmarks
โ”‚   โ”œโ”€โ”€ alembic/             # Database migrations
โ”‚   โ””โ”€โ”€ requirements.txt
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/      # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/           # Application pages
โ”‚   โ”‚   โ”œโ”€โ”€ lib/             # Utilities and API client
โ”‚   โ”‚   โ””โ”€โ”€ App.tsx          # Main application component
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ vite.config.ts
โ””โ”€โ”€ docs/                    # Comprehensive documentation
    โ”œโ”€โ”€ 00-quick-start.md
    โ”œโ”€โ”€ 01-project-overview.md
    โ”œโ”€โ”€ 02-database-schema.md
    โ”œโ”€โ”€ 03-api-specification.md
    โ”œโ”€โ”€ 04-matching-algorithm.md
    โ”œโ”€โ”€ 05-excel-specification.md
    โ”œโ”€โ”€ 06-implementation-checklist.md
    โ”œโ”€โ”€ 07-ferpa-security.md
    โ””โ”€โ”€ 08-testing-strategy.md

๐Ÿ”„ Workflow

Typical Semester Cycle

  1. Import Student Data - Load student bio information from Kuali export
  2. Import Applications - Load student course preferences
  3. Import Course Grades - Load historical grades from OAS
  4. Generate Faculty Feedback Forms - Export Excel forms for each course
  5. Import Faculty Rankings - Load completed faculty feedback
  6. Prepare Matching Worksheet - Build all valid student-course combinations
  7. Run Matching Algorithm - Execute stable matching algorithm
  8. Review & Adjust - Manual overrides if needed with justification
  9. Finalize Assignments - Lock in final decisions
  10. Export Results - Generate assignment summaries and reports

๐Ÿงฎ Matching Algorithm

The system uses a modified Gale-Shapley stable matching algorithm with the following features:

Student Preferences

  • Ranked course choices (1st through 5th)
  • Validated against course availability

Faculty Preferences

  • Rankings: 1 (Best), 2 (Acceptable), 3 (Not Suitable)
  • Tiebreaking based on:
    • Previous grader experience (+100 points)
    • Course grade (A+ to F scale)
    • Overall GPA (0-4 scale ร— 10)
    • Student preference ranking

Hard Constraints

  • do_not_hire flag exclusion
  • Faculty rank 3 (not suitable) exclusion
  • Course capacity limits
  • Grade prerequisites

Validation

  • Stability verification (no blocking pairs)
  • Metrics calculation (student/faculty satisfaction)
  • 80%+ historical accuracy target

๐Ÿ“š Documentation

Comprehensive documentation is available in the /docs directory:

๐Ÿงช Testing

# Run all backend tests
cd backend
pytest

# Run with coverage report
pytest --cov=app --cov-report=html

# Run critical Fall 2024 validation test
pytest tests/critical/

# Run frontend tests
cd frontend
npm test

# Run E2E tests
npm run test:e2e

Critical Test: Fall 2024 Recreation

The most important test validates that the matching algorithm can recreate historical Fall 2024 assignments with 80%+ accuracy. This proves the system works correctly.

๐Ÿ”’ Security & Compliance

FERPA Compliance

  • Comprehensive audit logging of all data access
  • Role-based access control (Admin, Coordinator, Faculty, Read-Only)
  • PII encryption at rest for sensitive fields
  • Secure file permissions and data handling
  • 7-year audit log retention

Data Protection

  • Input validation on all endpoints (Pydantic schemas)
  • SQL injection prevention (SQLAlchemy ORM)
  • Secure file upload handling
  • Generic error messages (no info leakage)

๐Ÿ› ๏ธ Development

Backend Development

cd backend
source venv/bin/activate

# Run development server with auto-reload
uvicorn app.main:app --reload

# Run linters
black app/
ruff check app/
mypy app/

# Create new migration
alembic revision --autogenerate -m "Description"

# Apply migrations
alembic upgrade head

Frontend Development

cd frontend

# Development server
npm run dev

# Linting
npm run lint

# Type checking
npm run type-check

# Build for production
npm run build

๐Ÿ“ฆ Deployment

Local Deployment

System runs entirely on local machine - no cloud dependencies required.

Network Deployment (Optional)

Can be deployed on shared network drive with:

  • Multiple users accessing same SQLite database
  • WAL mode ensuring concurrent access safety
  • HTTPS/TLS for secure connections

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Write tests for all new features (90%+ coverage target)
  • Follow Python style guide (black + ruff)
  • Use TypeScript strict mode
  • Update documentation for API changes
  • Ensure FERPA compliance for data handling

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ฅ Authors

Vanderbilt University Data Science Institute

๐Ÿ™ Acknowledgments

  • Computer Science department for requirements and historical data
  • Carter and Graham for domain expertise and user testing
  • Student graders who will benefit from improved assignment process

๐Ÿ“ž Support

For questions or issues:

  • Create an issue in this repository
  • Contact: Vanderbilt Data Science Institute
  • Documentation: See /docs directory

๐Ÿ—บ๏ธ Roadmap

  • Complete system specifications
  • Phase 1: Core backend (Weeks 1-2)
  • Phase 2: Excel processing (Weeks 3-4)
  • Phase 3: Matching algorithm (Weeks 5-6)
  • Phase 4: Frontend UI (Weeks 7-10)
  • Phase 5: Real-time features (Week 11)
  • Phase 6: Integration & testing (Weeks 12-13)
  • Phase 7: Documentation & deployment (Week 14)
  • Phase 8: Training & handoff (Week 15)

Built with โค๏ธ by Vanderbilt Data Science

About

FERPA-compliant grader assignment system using automated stable matching algorithms for Vanderbilt CS department

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published