A comprehensive online examination system built for the Information Technology Institute (ITI). This full-stack web application enables students to take randomized exams, view results, and track their academic progress across enrolled courses.
- Features
- Technology Stack
- Project Structure
- Prerequisites
- Installation
- Database Setup
- Running the Application
- API Endpoints
- Documentation
- Contributing
- License
-
User Authentication
- Secure signup with password hashing (SHA-256)
- Login with email and password
- Automatic course enrollment based on track
-
Exam Management
- Generate randomized exams per course
- Support for multiple question types (MCQ, True/False)
- Timed exam sessions
- Auto-save answers
- Submit exams and receive instant grades
-
Results & Review
- View exam scores and percentage
- Review completed exams with correct answers
- Track grades across all courses
- View enrollment status and courses
- Course management
- Question bank management
- Student enrollment tracking
- Department and track management
- Comprehensive stored procedures for all operations
- HTML5 - Structure and semantic markup
- CSS3 - Styling and responsive design
- JavaScript (ES6+) - Client-side logic
- Fetch API - HTTP requests to backend
- ASP.NET Core (.NET 8/10) - Web API framework
- C# - Primary programming language
- ADO.NET - Database access layer
- Entity Framework Core - ORM (minimal usage)
- SQL Server - Relational database
- T-SQL - Stored procedures and functions
- 66+ Stored Procedures - All database operations
- Repository Pattern - Data access abstraction
- Dependency Injection - Service management
- DTO Pattern - Data transfer objects
- Stored Procedure Architecture - Zero inline SQL queries
ITIExaminationSystem/
βββ backend/
β βββ ITI.ExamSystem.API/
β βββ Controllers/ # API endpoints
β β βββ ExamController.cs
β β βββ StudentController.cs
β βββ Repositry/ # Data access layer
β β βββ Interfaces/
β β βββ ExamRepository.cs
β β βββ StudentRepository.cs
β βββ Models/ # DTOs
β β βββ SignupDto.cs
β β βββ LoginDto.cs
β β βββ SubmitExamDto.cs
β β βββ ...
β βββ Data/ # EF Core context
β βββ Program.cs # App entry point
β βββ appsettings.json # Configuration
β
βββ frontend/
β βββ index.html # Landing/login page
β βββ html/
β β βββ portal.html # Student dashboard
β β βββ exam.html # Exam interface
β β βββ exam-result.html # Results display
β βββ css/ # Stylesheets
β βββ js/ # JavaScript modules
β βββ portal.js
β βββ exam.js
β βββ exam-result.js
β
βββ docs/ # Additional documentation
β βββ API.md
β βββ DATABASE.md
β βββ DEPLOYMENT.md
β βββ DEVELOPMENT.md
β
βββ README.md # This file
Before you begin, ensure you have the following installed:
- SQL Server (2019 or later) or SQL Server Express
- .NET SDK (8.0 or 10.0)
- Visual Studio 2022 or Visual Studio Code
- Node.js (for live server - optional)
- Git (for version control)
git clone https://github.com/MostafaHendy3/Web_App_DB_Project.git
cd Web_App_DB_Project- Open SQL Server Management Studio (SSMS)
- Connect to your SQL Server instance
- Create a new database:
CREATE DATABASE ITI_ExamSystem;
GONavigate to your stored procedures file and execute:
-- Execute the stored procedures script
-- File location: E:\ITI\DB_project\StoredP\all_v2_formatted.sqlNote: The script includes 66+ stored procedures for all database operations
If you have seed data scripts, run them to populate initial data:
-- Run your data seeding scripts hereOpen backend/ITI.ExamSystem.API/appsettings.json and update:
{
"ConnectionStrings": {
"DefaultConnection": "Server=YOUR_SERVER_NAME;Database=ITI_ExamSystem;Trusted_Connection=True;TrustServerCertificate=True"
}
}cd backend/ITI.ExamSystem.API
dotnet restoredotnet buildUpdate the API base URL in frontend JavaScript files if needed:
// In portal.js, exam.js, exam-result.js
const API_BASE_URL = 'http://localhost:5000/api';cd backend/ITI.ExamSystem.API
dotnet runThe API will be available at:
- HTTP:
http://localhost:5000 - HTTPS:
https://localhost:5001 - Swagger UI:
http://localhost:5000/swagger
- Open the frontend folder in VS Code
- Right-click
index.html - Select "Open with Live Server"
cd frontend
python -m http.server 5500cd frontend
npx http-server -p 5500Access the application at: http://localhost:5500 or http://127.0.0.1:5500
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/student/signup |
Register new student |
| POST | /api/student/login |
Authenticate student |
| GET | /api/student/tracks |
Get all tracks |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/exam/generate |
Generate randomized exam |
| POST | /api/exam/submit |
Submit exam answers |
| GET | /api/exam/review |
Get exam review with answers |
| GET | /api/exam/enrolled-courses |
Get student's courses |
Full API documentation available in
docs/API.md
Additional documentation is available in the docs/ directory:
- API Documentation - Detailed API reference with request/response examples
- Database Schema - Complete database design and stored procedures
- Deployment Guide - Production deployment instructions
- Development Guide - Setup for contributors
The API is configured to accept requests from:
http://127.0.0.1:5500
To add more origins, update Program.cs:
builder.Services.AddCors(options =>
{
options.AddDefaultPolicy(policy =>
{
policy.WithOrigins("http://127.0.0.1:5500", "YOUR_ORIGIN_HERE")
.AllowAnyHeader()
.AllowAnyMethod();
});
});- Navigate to
http://localhost:5000/swagger - Test endpoints directly from the browser
- Signup: Create a new student account
- Login: Authenticate with credentials
- Select Course: Choose from enrolled courses
- Take Exam: Answer randomized questions
- View Results: Check score and review answers
- Controllers: HTTP request handling
- Repositories: Data access logic
- Models: DTOs for data transfer
- Stored Procedures: All database operations
- SHA-256 password hashing
- Parameterized stored procedures (SQL injection protection)
- CORS policy enforcement
- Input validation
- Stored procedure query plan caching
- Connection pooling
- Efficient data transfer with DTOs
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow C# naming conventions
- Use meaningful variable names
- Add comments for complex logic
- Update documentation for new features
Watch the complete system walkthrough:
demo.mp4
Made with β€οΈ for ITI Advanced Database Project