Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ITI Examination System πŸŽ“

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.

GitHub repo size GitHub last commit GitHub issues


πŸ“‹ Table of Contents


✨ Features

Student Features

  • 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

Admin Features (Database Level)

  • Course management
  • Question bank management
  • Student enrollment tracking
  • Department and track management
  • Comprehensive stored procedures for all operations

πŸ›  Technology Stack

Frontend

  • HTML5 - Structure and semantic markup
  • CSS3 - Styling and responsive design
  • JavaScript (ES6+) - Client-side logic
  • Fetch API - HTTP requests to backend

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)

Database

  • SQL Server - Relational database
  • T-SQL - Stored procedures and functions
  • 66+ Stored Procedures - All database operations

Architecture

  • Repository Pattern - Data access abstraction
  • Dependency Injection - Service management
  • DTO Pattern - Data transfer objects
  • Stored Procedure Architecture - Zero inline SQL queries

πŸ“ Project Structure

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

πŸ“¦ Prerequisites

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)

πŸš€ Installation

1. Clone the Repository

git clone https://github.com/MostafaHendy3/Web_App_DB_Project.git
cd Web_App_DB_Project

2. Database Setup

a. Create the Database

  1. Open SQL Server Management Studio (SSMS)
  2. Connect to your SQL Server instance
  3. Create a new database:
CREATE DATABASE ITI_ExamSystem;
GO

b. Run Database Scripts

Navigate to your stored procedures file and execute:

-- Execute the stored procedures script
-- File location: E:\ITI\DB_project\StoredP\all_v2_formatted.sql

Note: The script includes 66+ stored procedures for all database operations

c. Seed Data (Optional)

If you have seed data scripts, run them to populate initial data:

-- Run your data seeding scripts here

3. Backend Configuration

a. Update Connection String

Open backend/ITI.ExamSystem.API/appsettings.json and update:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=YOUR_SERVER_NAME;Database=ITI_ExamSystem;Trusted_Connection=True;TrustServerCertificate=True"
  }
}

b. Restore NuGet Packages

cd backend/ITI.ExamSystem.API
dotnet restore

c. Build the Project

dotnet build

4. Frontend Configuration

Update 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';

🎯 Running the Application

1. Start the Backend API

cd backend/ITI.ExamSystem.API
dotnet run

The API will be available at:

  • HTTP: http://localhost:5000
  • HTTPS: https://localhost:5001
  • Swagger UI: http://localhost:5000/swagger

2. Serve the Frontend

Option A: Using Live Server (VS Code Extension)

  1. Open the frontend folder in VS Code
  2. Right-click index.html
  3. Select "Open with Live Server"

Option B: Using Python

cd frontend
python -m http.server 5500

Option C: Using Node.js http-server

cd frontend
npx http-server -p 5500

Access the application at: http://localhost:5500 or http://127.0.0.1:5500


πŸ”Œ API Endpoints

Student Authentication

Method Endpoint Description
POST /api/student/signup Register new student
POST /api/student/login Authenticate student
GET /api/student/tracks Get all tracks

Exam Operations

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


πŸ“š Documentation

Additional documentation is available in the docs/ directory:


βš™οΈ Configuration

CORS Settings

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();
    });
});

πŸ§ͺ Testing

Manual Testing via Swagger

  1. Navigate to http://localhost:5000/swagger
  2. Test endpoints directly from the browser

Using the Frontend

  1. Signup: Create a new student account
  2. Login: Authenticate with credentials
  3. Select Course: Choose from enrolled courses
  4. Take Exam: Answer randomized questions
  5. View Results: Check score and review answers

πŸ—οΈ Architecture Highlights

Clean Architecture

  • Controllers: HTTP request handling
  • Repositories: Data access logic
  • Models: DTOs for data transfer
  • Stored Procedures: All database operations

Security Features

  • SHA-256 password hashing
  • Parameterized stored procedures (SQL injection protection)
  • CORS policy enforcement
  • Input validation

Performance Optimizations

  • Stored procedure query plan caching
  • Connection pooling
  • Efficient data transfer with DTOs

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the 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. Open a Pull Request

Coding Standards

  • Follow C# naming conventions
  • Use meaningful variable names
  • Add comments for complex logic
  • Update documentation for new features

Demo

Watch the complete system walkthrough:

demo.mp4

Made with ❀️ for ITI Advanced Database Project

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages