CSCE4350_gradebot

command module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 7 Imported by: 0

README

CSCE 4350 Gradebot

Go Version Build Status Coverage Status Quality Gate Status Go Report Card Release

Automated code grading system for CSCE 4350 assignments.

Features

  • Server Mode: HTTP server for receiving and grading code submissions
  • Client Mode: CLI tool for submitting assignments for grading
  • OpenAI Integration: Uses GPT-4o Mini for code analysis and feedback
  • Web Interface: HTML dashboard for viewing submissions and grades
  • Cross-Platform: Native binaries for Linux, macOS, and Windows
  • Koyeb Deployment: Optimized for cloud deployment

Architecture

Overview

The gradebot consists of:

  • Server: HTTP API server handling grading requests
  • Client: CLI tool for submitting assignments
  • Rubrics: Evaluation logic and test runners

Local Development

Setup
  1. Clone the repository:

    git clone https://github.com/jh125486/CSCE4350_gradebot.git
    cd CSCE4350_gradebot
    
  2. Set up environment variables:

    # Copy the example environment file
    cp .env.example .env
    
    # Edit .env with your actual secrets
    nano .env  # or your preferred editor
    
  3. Initialize development environment:

    go mod tidy
    make init    # Installs git hooks
    make build
    

    The make init command installs a pre-push hook that runs tests and linting before allowing a push.

Testing Locally

The application automatically loads environment variables from a .env file when running locally.

Start the server:

# Using Makefile
make local-test

# Or manually
./bin/gradebot server --port 8080

Test the client:

# Submit a project for grading
./bin/gradebot project1 --dir /path/to/your/project --run "python main.py"
Environment Variables

The following environment variables are required for full functionality:

  • OPENAI_API_KEY: Your OpenAI API key
  • BUILD_ID: Unique build identifier for authentication
  • R2_ENDPOINT: Cloudflare R2 endpoint URL
  • AWS_ACCESS_KEY_ID: R2 access key
  • AWS_SECRET_ACCESS_KEY: R2 secret key

Optional variables:

  • R2_BUCKET: Custom bucket name (defaults to "gradebot-storage")
  • AWS_REGION: AWS region (defaults to "auto")
  • USE_PATH_STYLE: Use path-style S3 URLs (for LocalStack testing)
Development Workflow

Run tests:

make test          # Run all tests with race detection
make test-verbose  # Run tests with verbose output

Run linting:

make lint          # Run golangci-lint and security checks

Git Hooks: The pre-push hook automatically runs before each git push to ensure:

  • All tests pass (including race detection)
  • Code passes all linting checks

To bypass the hook (not recommended):

git push --no-verify

Usage

Submit assignments for grading:

# Project 1
./gradebot project1 --dir /path/to/project --run "python main.py"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL