A Flask-based web app to search student exam results by exam number and name. It shows results in the browser and lets users download a PDF report.
- Result search by exam number and student name
- Arabic/English UI with RTL/LTR support
- PDF export for the displayed result
- JSON API endpoint for programmatic access
- Responsive layout for mobile and desktop
- Backend: Flask (Python)
- Database: SQLite
- PDF: ReportLab
- Frontend: HTML, CSS, JavaScript
- Python 3.7+
- SQLite (bundled with Python)
-
Install dependencies:
pip install -r requirements.txt
-
Database (SQLite):
students.db- Table schema:
CREATE TABLE students ( exam_number TEXT, name TEXT, math REAL, arabic REAL, english REAL, total REAL );
- Example row:
INSERT INTO students (exam_number, name, math, arabic, english, total) VALUES ('12345', 'John Doe', 85.5, 90.0, 88.0, 263.5);
- Table schema:
-
Run the app:
python app.py
-
Open in browser:
-
Web UI:
- Enter
exam_numberandname. - Click “Check Result”.
- Download the PDF from the result card.
- Enter
-
API:
- Endpoint:
POST /api/check - JSON body:
{"exam_number": "123", "name": "John Doe"} - Responses:
200:{ "success": true, "student": { ... } }400/404:{ "success": false, "error": "..." }
- Endpoint:
-
PDF:
- Endpoint:
POST /pdf - Form fields:
exam_number,name
- Endpoint:
.
├── app.py
├── students.db
├── templates/
│ └── index.html
├── static/
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ └── script.js
│ └── img/
│ └── Mitan.jpg
└── README.md
This project is not fully complete yet. Some features are still in progress and will be improved in future updates.
Contributions are welcome!
- Fork the repository.
- Create a feature branch.
- Make your changes.
- Submit a pull request.
This project is still a work in progress 🚀