Skip to main content

Intelligent Online Examination System with AI Grading

Project description

FlashExam

PyPI version Python 3.10+ License: GPL v3 macOS Linux Windows

English | 中文


FlashExam - Intelligent Online Examination System with AI Grading

A Flask-based intelligent online examination system with AI grading support, compatible with macOS, Linux, and Windows.

Features

  • Multiple Question Types: Multiple choice, true/false, short answer, fill-in-the-blank, programming, code execution
  • AI Intelligent Grading: Subjective question grading based on Qwen model
  • Code Execution: Online execution support for Python, C, Java, Shell, JavaScript
  • Reading Comprehension: TOEFL-style reading comprehension exams
  • Real-time Monitoring: Tab switch detection and anti-cheating features
  • Batch Import: Import questions and students via Excel/CSV
  • Admin Panel: Teacher account management and system configuration
  • Cross-platform: Supports macOS, Linux, Windows
  • Dark/Light Theme: Elegant theme system with automatic system preference detection
  • Port Conflict Handling: Automatic detection and resolution of port conflicts

Quick Start

Installation

# Install from PyPI
pip install flashexam

# Or install from source
git clone https://github.com/cycleuser/flashexam.git
cd flashexam
pip install -e .

Initialize Database

flashexam --init-db

Start Server

# Development mode (default)
flashexam

# Production mode
flashexam --mode prod

# High-performance mode
flashexam --mode high-perf --workers 8

# Custom port
flashexam --port 8080

# Force start (kill process using the port)
flashexam --force

Access the System

  • Homepage: http://localhost:5000
  • Teacher Portal: http://localhost:5000/teacher
  • Student Portal: http://localhost:5000/student
  • Admin Panel: http://localhost:5000/admin

First startup requires setting up an administrator account.

Command Line Arguments

flashexam [options]

Options:
  --mode {dev,prod,high-perf}  Run mode (default: dev)
  --host HOST                  Bind address (default: 0.0.0.0)
  --port PORT                  Port number (default: 5000)
  --workers N                  Worker processes (default: 4)
  --init-db                    Initialize database
  --force                      Force start (kill process using port)
  --version                    Show version information

Question Import

Supports importing questions from Excel (.xlsx) and CSV files.

CSV Format

Number,question_type,question_text,option_A,option_B,option_C,option_D,correct_answer,score,difficulty,subject
1,choice,What is Python?,A programming language,A snake,Both A and B,None of the above,A,5,2,Computer Science
2,judge,Python is a compiled language,true,false,,false,3,1,Computer Science

Excel Format

Number Material question_type question_text option_A option_B correct_answer score subject
1 Reading passage text... choice Question text Option A Option B A 5 English

Project Structure

flashexam/
├── __init__.py          # Application factory
├── cli.py               # CLI entry point
├── database.py          # Database operations
├── teacher.py           # Teacher endpoints
├── student.py           # Student endpoints
├── auth.py              # Authentication module
├── admin.py             # Admin module
├── api.py               # API endpoints
├── code_executor.py     # Code executor
├── smart_import_manager.py  # Question import
├── models.py            # Data models
├── utils.py             # Utility functions
├── templates/           # HTML templates
├── static/              # Static resources
│   ├── css/
│   │   ├── themes.css   # Dark/light theme
│   │   └── app.css      # Custom styles
│   └── js/
└── storage/             # Data storage (not in repo)

Development

Install Development Dependencies

pip install -e ".[dev]"

Run Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=flashexam

# Run import tests
python test_import.py

Code Style

ruff check .
ruff format .

Publish to PyPI

# Linux/macOS
./upload_pypi.sh

# Windows
upload_pypi.bat

Tech Stack

  • Backend: Flask, SQLite, Flask-Login, Flask-Session
  • Frontend: Bootstrap 5, jQuery, Bootstrap Icons
  • AI: PyTorch, Transformers, Qwen (optional)
  • Server: Waitress (production)

Security Notes

  • Database files are excluded from version control
  • Session files are excluded from version control
  • No sensitive data is uploaded to GitHub or PyPI
  • Secret keys should be set via environment variables in production

License

This project is licensed under the GNU General Public License v3.0.

Contributing

Issues and Pull Requests are welcome!

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

Author

FlashExam Contributors

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flashexam-2.0.10.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flashexam-2.0.10-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file flashexam-2.0.10.tar.gz.

File metadata

  • Download URL: flashexam-2.0.10.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for flashexam-2.0.10.tar.gz
Algorithm Hash digest
SHA256 5f6301395bfd5b67f0af84a9e088da9d8222fa990c015f899897db07ba93eace
MD5 f125ad700897ecb3d21dbdcd8143d72f
BLAKE2b-256 594aa812393671122001c563f77c7fefdcd8f7c1cd0b99b2fb394dd7582e239f

See more details on using hashes here.

File details

Details for the file flashexam-2.0.10-py3-none-any.whl.

File metadata

  • Download URL: flashexam-2.0.10-py3-none-any.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for flashexam-2.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f573d25415774ffc25e76d90ecf5e1ff700d45c5b1a42da221ab49171520732f
MD5 9fef49f0d3540ae6230957bb65ccc616
BLAKE2b-256 d73f4e5bba44326ad71620b0cb9c098da086926f9dea3df71370e84afb8a8b00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page