Skip to content

BU-Spark/ml-bu-autograder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MET BU Autograder πŸš€

A Boston University SPARK Project
For Boston University’s Metropolitan College Office of Education Technology and Innovation (MET ETI)


πŸ“– Table of Contents

  1. Overview
  2. ✨ Key Features
  3. 🎯 Goals
  4. πŸ› οΈ Tech Stack
  5. πŸ“Œ Development Roadmap
  6. πŸš€ Setup Instructions
  7. πŸ“Š Workflow Diagram
  8. πŸ“‚ Project Structure
  9. ☁️ Azure Storage Format
  10. πŸ‘₯ Team
  11. πŸ“œ License

🌍 Overview

MET BU Autograder is a web-based REST API for AI-Assisted Grading of written and β€œcomplex” assignments. It refines and optimizes grading capabilities using various Large Language Models (LLMs) and advanced context management.

Developed as part of a Boston University SPARK project for BU MET ETI, this tool is designed to integrate seamlessly with multiple LLM backends and provide a robust, well-documented API for clients seeking to enhance their grading workflows.


✨ Key Features

βœ”οΈ Context Management Strategies - Ensures the AI retains necessary context across requests over otherwise stateless APIs.

βœ”οΈ Retrieval-Augmented Generation - Uses a vector database to store supplemental data like documents, videos, images, and graphs.

βœ”οΈ Web Crawling - Gathers assignment-relevant information with optional automatic update checking.

βœ”οΈ Prompt Engineering - Uses zero-shot, few-shot, self-consistency prompting, and instruction tuning.

βœ”οΈ File Conversion & Extraction - Supports multiple formats (CSV, PDF, diagrams, PowerPoints) to feed into LLM APIs.


🎯 Goals

🎯 Future-Proof Design: Integrate with multiple text-based or vision-based LLM backends.
🎯 Consistent Grading: Standardized grading approach for improved fairness and reliability.
🎯 Well-Documented API: Clear and accessible documentation for clients and contributors.
🎯 Efficiency: Minimize unnecessary external API calls to reduce costs while maintaining high accuracy.


πŸ› οΈ Tech Stack

🟑 Language: Python 🐍
🟒 Framework: FastAPI ⚑
πŸ”΅ Others:

  • LLM integration (multiple providers)
  • Vector databases (for retrieval-augmented generation)
  • Web crawling utilities (Selenium, requests)

πŸ“Œ Development Roadmap

πŸš€ Phase 0: Project Vision & Goals βœ…

πŸš€ Phase 1: Project Setup & Initial API Development βœ…

πŸš€ Phase 2: LLM Integration & Context Management ⏳

πŸš€ Phase 3: Web Crawling & Vector Database Implementation ⏳

πŸš€ Phase 4: Performance Optimization & API Documentation ⏳

πŸš€ Phase 5: Deployment & User Testing ⏳


πŸ“Š Workflow Diagram

Below is a visual representation of our current workflow for the MET BU Autograder workflow:

proposed-workflow


πŸš€ Setup Instructions

πŸ“¦ Prerequisites

  • Python 3.11 or higher installed on your system.
  • Pip 24.0 or higher installed on your system.

Older versions may work

πŸ“₯ Clone the Repository

Clone the project repository to your local machine:

git clone <repository_url>
cd <repository_folder>

Replace <repository_url> with your repository URL and <repository_folder> with the cloned folder name.

🐍 Create a Virtual Environment

It is recommended to use a virtual environment to manage project dependencies.

On Linux/macOS:

python3 -m venv venv
source venv/bin/activate

On Windows:

python -m venv venv
venv\Scripts\activate

πŸ“œ Install Dependencies

Upgrade pip and install the project requirements using the provided requirements.txt file:

pip install --upgrade pip
pip install -r requirements.txt

βš™οΈ Setup Environment Variables

Copy the sample .env-example file to .env. Then provide or modify all environment variables as needed.

To generate a secure JWT encryption secret, run the script located at the root of the repository:

python generate_jwt_secret.py

Then, set the JWT_ENCRYPTION_SECRET_FILE environment variable to the path of the generated secret file (output by the script).

πŸ–₯️ Start the Application

Start the FastAPI application using Uvicorn with the auto-reload option for development:

uvicorn app.main:app --reload --port 8000

The server should start on http://localhost:8000.

To start the FastAPI application for production use, run the following instead:

uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4

Feel free to modify the port or host to your use case in either case.

πŸ“‘ API Documentation

Once the application is running, you can view the interactive API documentation generated by FastAPI:

πŸ“‚ Project Structure

πŸ–₯️ Backend

app
β”œβ”€β”€ README.md
β”œβ”€β”€ __init__.py
β”œβ”€β”€ main.py
β”œβ”€β”€ models
β”‚ β”œβ”€β”€ __init__.py
β”‚ β”œβ”€β”€ assignment.py
β”‚ β”œβ”€β”€ course.py
β”‚ β”œβ”€β”€ course_material.py
β”‚ β”œβ”€β”€ grade.py
β”‚ β”œβ”€β”€ rubric.py
β”‚ β”œβ”€β”€ student.py
β”‚ β”œβ”€β”€ student_response.py
β”‚ β”œβ”€β”€ token.py
β”‚ β”œβ”€β”€ uploaded_file.py
β”‚ └── user.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ routes
β”‚ β”œβ”€β”€ __init__.py
β”‚ β”œβ”€β”€ assignment.py
β”‚ β”œβ”€β”€ auth.py
β”‚ β”œβ”€β”€ course.py
β”‚ β”œβ”€β”€ course_material.py
β”‚ β”œβ”€β”€ grading.py
β”‚ β”œβ”€β”€ rubric.py
β”‚ β”œβ”€β”€ student_response.py
β”‚ └── user.py
└── utils
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ azure_ai_service.py
    β”œβ”€β”€ azure_blob_uploader.py
    └── json_web_token.py

πŸ’» Frontend

frontend
β”œβ”€β”€ README.md
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ public
β”‚ β”œβ”€β”€ icons
β”‚ β”‚ └── favicon.ico
β”‚ β”œβ”€β”€ images
β”‚ β”‚ β”œβ”€β”€ avatar-placeholder.png
β”‚ β”‚ β”œβ”€β”€ bu-logo.png
β”‚ β”‚ β”œβ”€β”€ bu-met-logo.png
β”‚ β”‚ β”œβ”€β”€ favicon.png
β”‚ β”‚ └── login-background.png
β”‚ └── robots.txt
└── src
    β”œβ”€β”€ ThemeContext.js
    β”œβ”€β”€ api.js
    β”œβ”€β”€ components
    β”‚ β”œβ”€β”€ AISuggestionCard.js
    β”‚ β”œβ”€β”€ CardSkeleton.js
    β”‚ β”œβ”€β”€ ConfirmationDialog.js
    β”‚ β”œβ”€β”€ Footer.js
    β”‚ β”œβ”€β”€ GradingModeSelect.js
    β”‚ β”œβ”€β”€ Header.js
    β”‚ β”œβ”€β”€ Layout.js
    β”‚ β”œβ”€β”€ Navigation.js
    β”‚ β”œβ”€β”€ SelectableList.js
    β”‚ └── ThemeToggle.js
    β”œβ”€β”€ config.js
    β”œβ”€β”€ pages
    β”‚ β”œβ”€β”€ _app.js
    β”‚ β”œβ”€β”€ course
    β”‚ β”‚ └── [id]
    β”‚ β”‚     β”œβ”€β”€ assignments.js
    β”‚ β”‚     β”œβ”€β”€ grading.js
    β”‚ β”‚     β”œβ”€β”€ index.js
    β”‚ β”‚     β”œβ”€β”€ instructors.js
    β”‚ β”‚     β”œβ”€β”€ materials.js
    β”‚ β”‚     └── rubrics.js
    β”‚ β”œβ”€β”€ courses.js
    β”‚ β”œβ”€β”€ login.js
    β”‚ β”œβ”€β”€ manual_submission.js
    β”‚ └── settings.js
    β”œβ”€β”€ styles
    β”‚ β”œβ”€β”€ globals.css
    β”‚ β”œβ”€β”€ theme.js
    β”‚ └── variables.css
    └── utils
        └── createEmotionCache.js

☁️ Azure Storage Format

This document outlines the directory and file structure used within the Azure Blob Storage container.

πŸ“‚ `/`
β”œβ”€β”€ πŸ“‚ `course/`
β”‚   └── πŸ“‚ `{semester_key}/`                   *(e.g., "Fall2024")*
β”‚       └── πŸ“‚ `{course_id}/`                   *(e.g., "CS101")*
β”‚           β”œβ”€β”€ πŸ“„ `course.json`                *(Course metadata - `Course` model)*
β”‚           β”œβ”€β”€ πŸ“‚ `assignment/`
β”‚           β”‚   └── πŸ“‚ `{assignment_id}/`       *(Integer ID)*
β”‚           β”‚       β”œβ”€β”€ πŸ“„ `assignment.json`    *(Assignment metadata - `Assignment` model)*
β”‚           β”‚       β”œβ”€β”€ πŸ“‚ `{question_index}/`  *(Integer index, 0-based)*
β”‚           β”‚       β”‚   β”œβ”€β”€ πŸ“„ `question.json`    *(Question metadata - `Question` model)*
β”‚           β”‚       β”‚   └── πŸ“‚ `student_response/`
β”‚           β”‚       β”‚       └── πŸ“‚ `{student_id}/`  *(Student identifier, often email)*
β”‚           β”‚       β”‚           β”œβ”€β”€ πŸ“„ `response.*`  *(Student's answer file - `StudentResponse` model, extension from `data.data_type`)*
β”‚           β”‚       β”‚           └── πŸ“„ `grade.json`   *(Grading details - `Grade` model, part of `GradedStudentResponse`)*
β”‚           β”‚       └── πŸ“‚ `rubrics/`
β”‚           β”‚           β”œβ”€β”€ πŸ“„ `assignment.json` *(Overall assignment rubric - `Rubric` model)*
β”‚           β”‚           └── πŸ“„ `{question_index}.json` *(Sub-rubric for a specific question - `SubRubric` model)*
β”‚           └── πŸ“‚ `course_material/`
β”‚               └── πŸ“„ `{material_id}.*`         *(Course materials - `CourseMaterial` model, extension from `data.data_type`)*
β”‚
└── πŸ“‚ `user/`
    └── πŸ“‚ `{user_email}/`
        β”œβ”€β”€ πŸ“„ `user.json`               *(User metadata - `User` model)*
        └── πŸ“‚ `tokens/`
            └── πŸ“„ `{token_name}.json`         *(Personal Access Token details - `PersonalAccessToken` model)*


πŸ‘₯ Team

πŸ‘€ First Name Last Name βœ‰οΈ Email Address πŸ–₯️ GitHub Username
Fahim Uddin fahuddin@bu.edu fahimuddin/fahimuddin1
Zach Gentile zgentile@bu.edu zgentile
Josh Yip joshyjip@bu.edu joshyipp
Muhammad Aseef Imran aseef@bu.edu Aseeef

πŸ“œ License

This project is licensed under the GNU General Public License (GPL). See the LICENSE file for more details.


⚠️ Note: This project is in active development. For more details on installation, usage, or contributing, please refer to the project’s documentation and issue tracker.


If you have any questions or feedback, feel free to open an issue or reach out via email.

About

DS 549 BU MET Autograder Project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6