English | 简体中文
AI Exam Grader is an intelligent grading assistant powered by Large Language Models (LLMs), designed for teachers and educators. It leverages the visual understanding capabilities of OpenAI (GPT-4o) or Google Gemini (Pro) to automatically grade handwritten exam papers and generate detailed reports.
Important
License Notice
This project is licensed under the NCEL-Strict License (Version 2.0). This is a Source Available but Strictly Limited non-commercial license.
🚫 Commercial Use Strictly Prohibited: Includes sale, subscription, sponsorship, Internal Use, SaaS services, and AI model training.
🚫 Distribution of Modified Versions Prohibited: You may NOT directly distribute modified source code or binaries (only Patch/Diff files are allowed).
🚫 Fork Restriction: Public Forks are allowed ONLY for submitting PRs and must be deleted within 14 days after the PR is closed.
✅ Non-Commercial Only: Personal study, academic research, and non-commercial use must retain the full copyright notice and license file.
💼 Commercial License: For commercial use or custom development, please contact the author for licensing: nicofiela@outlook.com
-
🤖 Intelligent Grading Engine
- Multi-Model Support:
- Supports OpenAI (GPT-4o, etc.) and compatible APIs (Custom Base URL)
- Supports Google Gemini (gemini-3.0-pro, etc.)
- Smart OCR Recognition: Automatically extracts handwritten student names, IDs, and class information
- Flexible Grading Rubrics: Supports custom rubrics for precise subjective question grading
- Batch Concurrent Processing: Multi-threaded architecture for high-speed grading of large batches
[!NOTE] This application relies heavily on the model's visual understanding and reasoning capabilities. For best results, we recommend using more powerful models (e.g., GPT-4o, Gemini 3.0 Pro).
- Multi-Model Support:
-
📊 Smart Data Management
- Chain auto-validation (Answer Key → Layout → CSV)
- Automatic CSV rebuild when missing
- Incremental processing with resume capability
- Seamless CN/EN directory support
-
🔍 Manual Review System
- Three-step review process (Info → Objective → Subjective)
- Dual-mode viewing (Text/Image)
- Smart navigation and search
- Complete review history tracking
-
📋 Comprehensive Reports + 🌐 Internationalization
- Markdown reports + Enhanced CSV + Structured JSON
- Full Chinese-English support
- Quick-switch configuration profiles
- macOS (Recommended) / Windows / Linux
- Python 3.10+
pip install -r requirements.txtMethod 1: Using Configuration Profiles (Recommended)
Copy the example configuration file:
cp config_example.json config.jsonEdit config.json with your actual API keys and file paths.
Method 2: Manual Configuration
You can also configure settings directly in the application interface.
See README_CONFIG.md for detailed configuration guide.
python AutoGrader.pymacOS:
python build.pyThe .app bundle will be generated in the dist/ folder.
Windows:
python build_windows.pyThe executable (.exe) will be generated in the dist/ folder.
API Settings
├─ API Key: Enter your API key
├─ Service Provider: OpenAI / Gemini
├─ Model Name: gpt-4o / gemini-1.5-pro
└─ Base URL: (Optional)
Resource Files
├─ 📄 Rubric: Upload exam questions and answers document
├─ 📁 Answer Sheets Folder: Select folder containing scanned images
└─ 👥 Student List: (Optional) Upload Excel/CSV student roster
Click "Start Grading" button
Automated Flow:
Check Answer Key → Confirm Answers → Detect Layout → Confirm Layout → Generate CSV → Start Grading
User Interaction Points:
- 🔍 Answer Key Confirmation: Confirm AI-extracted answers on first run
- 🔍 Layout Description Confirmation: Confirm answer sheet structure on first run
After grading completes, click "Review" button
Three-Step Review Process:
Step 1: Verify Student Information
Step 2: Verify Objective Questions
Step 3: Verify Subjective Question Scores
Quick Actions:
- 📝/🖼 Toggle Text/Image Mode
- ⬅️/➡️ Previous/Next Student
- 🔍 Search Student (Name/ID)
- ✅ Confirm and Continue
Output File Locations
├─ 📊 Grade_Summary.csv (in grading_data/ folder)
├─ 📝 Grading_Report.md (in reports/ folder, one per student)
└─ 📄 Student_Data.json (in reports/ folder, one per student)
When you start grading, the application automatically creates:
Answer Sheets Folder/
├─ grading_data/ # Configuration and summary data
│ ├─ answer_key.json # Standard answers
│ ├─ layout_config.json # Answer sheet layout
│ └─ Grade_Summary.csv # Grade summary table
│
├─ reports/ # Grading results
│ ├─ 01-01.json # Student grade data
│ ├─ 01-01.md # Student grading report
│ └─ ...
│
├─ original_files/ # Original answer sheet backups
│ └─ *.jpg/png
│
├─ success/ # Successfully graded sheets
│ └─ *.jpg/png
│
└─ failed/ # Failed grading attempts
└─ *.jpg/png
Start Grading → Answer Key → Layout Config → CSV File → File Integrity → Begin Grading
↓ ↓ ↓ ↓ ↓ ↓
Basic Check Smart Extract Auto-Detect Smart Recovery Incremental Batch Process
Key Features:
- ✅ Chain Validation: Answer Key → Layout → CSV → Grading
- ✅ Smart Recovery: Automatically rebuilds CSV from JSON if missing
- ✅ Incremental Processing: Only grades incomplete files
- ✅ Auto Migration: Legacy files automatically moved to new structure
- ✅ User Confirmation: Answer key and layout require user approval
- ✅ Data Consistency: Rebuilds CSV after grading to ensure accuracy
Grade Summary (CSV)
Contains complete grades and information for all students
- Basic Info: Room, Seat, Name, ID, Class
- Scores: Total, Objective, Subjective, Individual Questions
- OCR Info: Recognized name, ID, etc.
- Review Status: Unreviewed/Reviewed/Second Review
Grading Report (Markdown)
Detailed grading report for each student
- Student information verification
- Objective question answer comparison table
- Subjective question analysis for each question
- Total score statistics
Grade Data (JSON)
Structured data containing all grading details
- Used for data recovery
- Supports secondary development
- Review history records
Before Grading
- ✅ Prepare high-resolution scanned answer sheets
- ✅ Prepare complete rubric document
- ✅ Check API quota is sufficient
During Grading
- ✅ Maintain stable network connection
- ✅ Do not close the application window
- ✅ Monitor progress and logs
During Review
- ✅ Verify each student's information individually
- ✅ Focus on checking subjective question scores
- ✅ Use search function to quickly locate students
After Completion
- ✅ Export CSV to a safe location
- ✅ Backup the grading data folder
- ✅ Verify CSV row count matches student count
AIExamGrader/
├── AutoGrader.py # Main application
├── config_manager.py # Configuration management
├── student_manager.py # Student database management
├── grader_engine.py # AI grading engine
├── review_window.py # Manual review interface
├── standard_answer_dialog.py # Standard answer configuration
├── splash_screen.py # Application splash screen
├── translations.py # Internationalization
├── utils.py # Helper functions
├── tooltip.py # Tooltip widget
├── theme.py # UI Theme definitions
├── generate_icon.py # Icon generation script
├── config_example.json # Example configuration
├── README_CONFIG.md # Configuration guide
├── requirements.txt # Dependencies
├── rthook_google.py # PyInstaller runtime hook
├── build.py # macOS build script
├── build_windows.py # Windows build script
├── test_core.py # Core functionality tests
└── test_review_logs.py # Review log tests
config.json: Main configuration file (created fromconfig_example.json)config_example.json: Example configuration with sample profiles- See README_CONFIG.md for detailed configuration documentation
Contributions are welcome! Please read CONTRIBUTING.md for details.
This project is licensed under the NCEL-Strict License (Version 2.0) - see the LICENSE file for details.
For commercial use, please contact the project author for licensing options: nicofiela@outlook.com
Made with ❤️ for educators worldwide