0% found this document useful (0 votes)
6 views35 pages

Phpfinal

The document is a project report on the 'Online Examination System' developed by students of Computer Engineering at SVERI’s College of Engineering. It outlines the system's objectives, benefits, and methodology, emphasizing its efficiency in conducting tests and managing questions through a user-friendly interface. The project aims to automate the examination process, ensuring accuracy and accessibility while reducing manual efforts and paper usage.

Uploaded by

hukesakshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views35 pages

Phpfinal

The document is a project report on the 'Online Examination System' developed by students of Computer Engineering at SVERI’s College of Engineering. It outlines the system's objectives, benefits, and methodology, emphasizing its efficiency in conducting tests and managing questions through a user-friendly interface. The project aims to automate the examination process, ensuring accuracy and accessibility while reducing manual efforts and paper usage.

Uploaded by

hukesakshi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

A PROJECT REPORT ON

“Online Examination System ”


Submitted in partial fulfillment of the requirements of the award of
degree of
DIPLOMA ENGINEERING
In

Computer Engineering

BY:-

1. Isha Abhijit Lokhande


2. Sakshi Kishor Huke
3. Ananya Dhananjay Asabe
4. Srushti Sachin Patil
5. Mayuri Mahesh Tapkire

UNDER THE GUIDANCE:

Ms. V. B. Maskar

SVERI’S
COLLEGE OF ENGINEERING (POLY),
PANDHARPUR 2024-25

1
CERTIFICATE

The project report entitled “Railway Reservation App”

Submitted by:

1. Isha Abhijit Lokhande


2. Sakshi Kishor Huke
3. Ananya Dhananjay Asabe
4. Srushti Sachin Patil
5. Mayuri Mahesh Tapkire

is approved for the Diploma of Engineering in Computer from SVERI’S College of


Engineering (Polytechnic), Pandharpur.

Name of Guide Name of H.O.D


(Ms. V. B. Maskar) (Mr. P. S. Bhandare)
Department of Computer Engineering Department of Computer Engineering
SVERI’S COE (Poly), Pandharpur. SVERI’S COE (Poly), Pandharpur.

Examiner Principal
(Prof. ) (Prof. Dr. N. D. Misal)
Place: Pandharpur
Date:

2
Annexure II
Evolution sheet for Micro Project
Academic Year: - 2024-25 Name of Faculty: -Ms. V. B. Maskar
Course: - Computer Engineering Course Code: - CO6I
Subject: -Web Based Application Development Subject Code: -22619
With PHP
Semester:- 6th Scheme: - I
Title of Online Examination System
Project: -
COs addressed by the Micro Project:
CO4 Use form controls with validation to collect user’s input.

CO5 Perform Database Operation in PHP.

Major Learning Outcomes achieved by students by doing the Project:

(b) Unit Outcomes in 4a. Use the relevant form controls to get user’s input.
Cognitive domain: 4e. Manage the given session using session variables.
5a. Create database for the given problem using PHP script.

a. Follow safety practices.


(c) Outcomes in Affective
b. Follow ethical practices.
Domain:
c. Demonstrate working as a leader/ a team member.

Comments/Suggestions about teamwork/leadership/interpersonal communication (if any)

Marks out of
Marks out
6 for Total marks out
of 4 for
Roll No Name of student performance of 10
performance in
ingroup
activity oral/Presentation

04 Isha Abhijit Lokhande

19 Sakshi Kishor Huke


42 Ananya Dhananjay Asabe

56 Srushti Sachin Patil

58 Mayuri Mahesh Tapkire


Name &
Signature of Name: Ms. V. B. Maskar Signature:
faculty

3
ACKNOWLEDGEMENT

I take this opportunity to express my sincere thanks and deep sense of gratitude to my
guide, Ms. V. B. Maskar Madam for her constant support, motivation, valuable guidance and
immense help during the entire course of this work. Without her constant encouragement, timely
advice and valuable discussion, it would have been difficult in completing this work. I would also
like to acknowledge the Computer Engineering department who provided me the facilities for
completion of the project. We are thankful to her for sharing her experience in the research field
with me and providing constant motivation during entire project work.

Name of Student:-

1. Isha Abhijit Lokhande


2. Sakshi Kishor Huke
3. Ananya Dhananjay Asabe
4. Srushti Sachin Patil
5. Mayuri Mahesh Tapkire

4
Railway Reservation App

1 . Rationale:

The Online Examination System, developed using PHP, provides an efficient platform for
conducting tests and managing questions. It consists of two main pages: the first page displays
test questions for users, while the second page shows results, including correct and incorrect
answers. An admin panel, accessible via login, allows authorized users to add or delete
questions, ensuring secure management. All data is stored in a database for efficient handling.
This system simplifies online testing, offering a user-friendly experience for both test-takers and
administrators.

2 . Aim/Benefits of the Micro-project:


Aim:

The aim of the Online Examination System is to provide an efficient, user-friendly, and secure
platform for conducting tests, evaluating user responses, and managing test questions. It
automates the examination process, ensuring accuracy, accessibility, and ease of administration.

Benefits:
a. Reduces manual effort and paper usage.
b. Automated evaluation with correct and incorrect answers.
c. Users can take tests anytime, anywhere.

3. Course Outcomes Achieved:


a. Apply the given validation rules on form.
b. Design web page using multiple forma for the given problem.
c. Insert data in the database using PHP script.

4. .Literature Review:

The Online Examination System has evolved as a modern solution to replace traditional paper-
based exams, offering automated question delivery, evaluation, and result analysis. Studies
highlight its efficiency in reducing administrative workload, ensuring instant feedback, and
improving accuracy by minimizing human errors in grading. Secure authentication mechanisms
restrict question management to authorized admins, preventing unauthorized modifications.
Additionally, database integration enhances systematic storage and retrieval of questions and
results, ensuring data integrity. Overall, research supports online examination systems as a
reliable, accessible, and efficient method for conducting assessments.

5
5. Actual Methodology Followed:

a. index.php:
<?php
session_start();
try {
$db = new mysqli('localhost', 'root', 'root', 'online_test');
if ($db->connect_error) {throw new Exception("Connection failed: " . $db->connect_error);
}
$db->query("CREATE TABLE IF NOT EXISTS admins(id INT AUTO_INCREMENT
PRIMARY KEY, username VARCHAR(50) UNIQUE NOT NULL, password_hash VARCHAR(255)
NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP )");

$db->query("CREATE TABLE IF NOT EXISTS questions ( id INT AUTO_INCREMENT


PRIMARY KEY, question_text TEXT NOT NULL, option_a VARCHAR(255) NOT NULL,
option_b VARCHAR(255) NOT NULL, option_c VARCHAR(255) NOT NULL,
option_d VARCHAR(255) NOT NULL, correct_answer CHAR(1) NOT NULL )");

$db->query("CREATE TABLE IF NOT EXISTS test_results (


id INT AUTO_INCREMENT PRIMARY KEY,
student_name VARCHAR(255) NOT NULL,
enrollment_number VARCHAR(50) NOT NULL,
score INT NOT NULL,
total_questions INT NOT NULL,
submission_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)");

// Create default admin if none exists


$result = $db->query("SELECT id FROM admins LIMIT 1");
if ($result->num_rows === 0) {
$username = "admin";
$password = "admin123";
$hashed_password = password_hash($password, PASSWORD_DEFAULT);
$db->query("INSERT INTO admins (username, password_hash) VALUES ('$username',
'$hashed_password')");
}

// Handle admin login


if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["admin_login"])) {
6
$username = $db->real_escape_string($_POST["username"]);
$password = $_POST["password"];

$stmt = $db->prepare("SELECT id, password_hash FROM admins WHERE username = ?");


$stmt->bind_param("s", $username);
$stmt->execute();
$result = $stmt->get_result();

if ($result->num_rows === 1) {
$admin = $result->fetch_assoc();
if (password_verify($password, $admin['password_hash'])) {
$_SESSION['admin_logged_in'] = true;
$_SESSION['admin_id'] = $admin['id'];
} else {
$login_error = "Invalid username or password";
}
} else {
$login_error = "Invalid username or password";
}
}

// Handle admin logout


if (isset($_GET['logout'])) {
unset($_SESSION['admin_logged_in']);
unset($_SESSION['admin_id']);
session_destroy();
header("Location: index.php");
exit;
}

// Check if admin is logged in


$admin_logged_in = isset($_SESSION['admin_logged_in']) && $_SESSION['admin_logged_in']
=== true;

// Add question to database


if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["add_question"]) &&
$admin_logged_in) {
$question = $db->real_escape_string($_POST["question"]);
$option_a = $db->real_escape_string($_POST["option_a"]);
$option_b = $db->real_escape_string($_POST["option_b"]);
6
$option_c = $db->real_escape_string($_POST["option_c"]);
$option_d = $db->real_escape_string($_POST["option_d"]);
$correct_answer = $db->real_escape_string($_POST["correct_answer"]);

$sql = "INSERT INTO questions (question_text, option_a, option_b, option_c, option_d,


correct_answer)
VALUES ('$question', '$option_a', '$option_b', '$option_c', '$option_d', '$correct_answer')";

if ($db->query($sql)) {
$message = "Question added successfully!";
$message_type = "success";
} else {
$message = "Error: " . $db->error;
$message_type = "error";
}
}

// Delete question from database


if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_GET["delete_question"])) {
$question_id = intval($_GET["delete_question"]);
$sql = "DELETE FROM questions WHERE id = $question_id";

if ($db->query($sql)) {
$message = "Question deleted successfully!";
$message_type = "success";
} else {
$message = "Error deleting question: " . $db->error;
$message_type = "error";
}
}

// Get all questions from database


$questions = [];
$result = $db->query("SELECT * FROM questions ORDER BY id");
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$questions[] = $row;
}
}
} catch (Exception $e) {
6
die("Database error: " . $e->getMessage());
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Online Test System</title>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap
" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/6.4.0/css/all.min.css">
</head>
<body>
<div class="floating-shapes">
<div class="shape shape-1"></div>
<div class="shape shape-2"></div>
<div class="shape shape-3"></div>
</div>

<div class="container">
<div class="header">
<div class="header-bg"></div>
<div class="header-bg"></div>
<h1>Online Examination System</h1>
<p>Test your knowledge and track your progress with our comprehensive assessment
platform</p>
</div>

<div class="tabs">
<div class="tab active" onclick="openTab('take-test')">
<i class="fas fa-pencil-alt"></i> Take Test
</div>
<div class="tab" onclick="openTab('manage-questions')">
<i class="fas fa-cog"></i> Manage Questions
</div>
</div>
6
<!-- Take Test Tab -->
<div id="take-test" class="tab-content active">
<form id="test-form" action="process.php" method="post" onsubmit="return
validateTestForm()">
<div class="form-group">
<label for="name"><i class="fas fa-user"></i> Full Name</label>
<input type="text" id="name" name="name" class="form-control" placeholder="Enter
your full name" required>
</div>

<div class="form-group">
<label for="enrollment"><i class="fas fa-id-card"></i> Enrollment Number</label>
<input type="text" id="enrollment" name="enrollment" class="form-control"
placeholder="Enter your enrollment number" required>
</div>

<h3 style="margin: 35px 0 25px; color: var(--primary); font-weight: 600; display: flex;
align-items: center;">
<i class="fas fa-question-circle" style="margin-right: 12px;"></i> Test Questions
</h3>

<?php if (empty($questions)): ?>


<div class="empty-state">
<i class="fas fa-book-open"></i>
<h3>No Questions Available</h3>
<p>There are currently no questions in the test. Please check back later or contact your
instructor.</p>
</div>
<?php else: ?>
<?php foreach ($questions as $index => $question): ?>
<div class="question">
<h3 data-number="<?php echo $index + 1; ?>"><?php echo
htmlspecialchars($question['question_text']); ?></h3>
<div class="answer">
<input type="radio" name="answers[<?php echo $question['id']; ?>]" value="A"
id="q<?php echo $question['id']; ?>_a" required>
<label for="q<?php echo $question['id']; ?>_a">A. <?php echo
htmlspecialchars($question['option_a']); ?></label>
</div>
<div class="answer">
6
<input type="radio" name="answers[<?php echo $question['id']; ?>]" value="B"
id="q<?php echo $question['id']; ?>_b">
<label for="q<?php echo $question['id']; ?>_b">B. <?php echo
htmlspecialchars($question['option_b']); ?></label>
</div>
<div class="answer">
<input type="radio" name="answers[<?php echo $question['id']; ?>]" value="C"
id="q<?php echo $question['id']; ?>_c">
<label for="q<?php echo $question['id']; ?>_c">C. <?php echo
htmlspecialchars($question['option_c']); ?></label>
</div>
<div class="answer">
<input type="radio" name="answers[<?php echo $question['id']; ?>]" value="D"
id="q<?php echo $question['id']; ?>_d">
<label for="q<?php echo $question['id']; ?>_d">D. <?php echo
htmlspecialchars($question['option_d']); ?></label>
</div>
</div>
<?php endforeach; ?>

<button type="submit" class="btn btn-block" style="margin-top: 35px;">


<i class="fas fa-paper-plane"></i> Submit Test
</button>
<?php endif; ?>
</form>
</div>

<!-- Manage Questions Tab -->


<div id="manage-questions" class="tab-content">
<?php if (!$admin_logged_in): ?>
<div class="login-form">
<h2><i class="fas fa-lock"></i> Admin Login</h2>
<?php if (isset($login_error)): ?>
<div class="message error">
<i class="fas fa-exclamation-circle"></i> <?php echo $login_error; ?>
</div>
<?php endif; ?>
<form method="post">
<input type="hidden" name="admin_login" value="1">
<div class="form-group">
<label for="username"><i class="fas fa-user-tie"></i> Username</label>
6
<input type="text" id="username" name="username" class="form-control"
required>
</div>
<div class="form-group">
<label for="password"><i class="fas fa-key"></i> Password</label>
<input type="password" id="password" name="password" class="form-control"
required>
</div>
<button type="submit" class="btn btn-block">
<i class="fas fa-sign-in-alt"></i> Login
</button>
</form>
</div>
<?php else: ?>
<div class="admin-bar">
<div class="admin-info">
<i class="fas fa-user-shield"></i> Welcome, Admin
</div>
<a href="#" onclick="confirmLogout()" class="btn">
<i class="fas fa-sign-out-alt"></i> Logout
</a>
</div>

<h2 style="color: var(--primary); margin-bottom: 30px; display: flex; align-items: center;">


<i class="fas fa-plus-circle" style="margin-right: 12px;"></i> Add New Question
</h2>
<?php if (isset($message)): ?>
<div class="message <?php echo $message_type; ?>">
<i class="fas <?php echo $message_type == 'error' ? 'fa-exclamation-circle' : 'fa-check-
circle'; ?>"></i>
<?php echo $message; ?>
</div>
<?php endif; ?>

<form id="question-form" method="post">


<input type="hidden" name="add_question" value="1">
<div class="form-group">
<label for="question"><i class="fas fa-question"></i> Question Text</label>
<textarea id="question" name="question" class="form-control" rows="4"
required></textarea>
6
</div>

<div class="form-group">
<label for="option_a"><i class="fas fa-list-ol"></i> Option A</label>
<input type="text" id="option_a" name="option_a" class="form-control" required>
</div>

<div class="form-group">
<label for="option_b"><i class="fas fa-list-ol"></i> Option B</label>
<input type="text" id="option_b" name="option_b" class="form-control" required>
</div>

<div class="form-group">
<label for="option_c"><i class="fas fa-list-ol"></i> Option C</label>
<input type="text" id="option_c" name="option_c" class="form-control" required>
</div>

<div class="form-group">
<label for="option_d"><i class="fas fa-list-ol"></i> Option D</label>
<input type="text" id="option_d" name="option_d" class="form-control" required>
</div>

<div class="form-group">
<label><i class="fas fa-check-circle"></i> Correct Answer</label>
<div class="radio-group">
<div class="radio-option">
<input type="radio" name="correct_answer" value="A" id="correct_a" required>
<label for="correct_a">Option A</label>
</div>
<div class="radio-option">
<input type="radio" name="correct_answer" value="B" id="correct_b">
<label for="correct_b">Option B</label>
</div>
<div class="radio-option">
<input type="radio" name="correct_answer" value="C" id="correct_c">
<label for="correct_c">Option C</label>
</div>
<div class="radio-option">
<input type="radio" name="correct_answer" value="D" id="correct_d">
<label for="correct_d">Option D</label>
6
</div>
</div>
</div>

<button type="submit" class="btn btn-block">


<i class="fas fa-save"></i> Add Question
</button>
</form>

<h2 style="color: var(--primary); margin: 45px 0 25px; display: flex; align-items: center;">
<i class="fas fa-list" style="margin-right: 12px;"></i> Existing Questions
</h2>

<?php if (empty($questions)): ?>


<div class="empty-state">
<i class="fas fa-inbox"></i>
<h3>No Questions Found</h3>
<p>You haven't added any questions yet. Use the form above to add your first
question.</p>
</div>
<?php else: ?>
<div class="questions-grid">
<?php foreach ($questions as $question): ?>
<div class="question-card">
<button onclick="confirmDelete(<?php echo $question['id']; ?>)">
<i class="fas fa-trash-alt"></i>
</button>
<h3><?php echo htmlspecialchars($question['question_text']); ?></h3>
<p><strong>A:</strong> <?php echo htmlspecialchars($question['option_a']);
?></p>
<p><strong>B:</strong> <?php echo htmlspecialchars($question['option_b']);
?></p>
<p><strong>C:</strong> <?php echo htmlspecialchars($question['option_c']);
?></p>
<p><strong>D:</strong> <?php echo htmlspecialchars($question['option_d']);
?></p>
<div class="correct">
<i class="fas fa-check"></i> Correct: <?php echo $question['correct_answer'];
?>
</div>
</div>
6
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>

<!-- Logout Confirmation Dialog -->


<div id="logout-confirmation" class="confirmation-dialog">
<div class="dialog-content">
<h3><i class="fas fa-sign-out-alt" style="color: var(--primary); margin-right: 10px;"></i>
Confirm Logout</h3>
<p>Are you sure you want to logout from the admin panel?</p>
<div class="dialog-buttons">
<a href="?logout=1" class="btn">Yes, Logout</a>
<button onclick="closeDialog('logout-confirmation')" class="btn btn-
secondary">Cancel</button>
</div>
</div>
</div>

<!-- Delete Confirmation Dialog -->


<div id="delete-confirmation" class="confirmation-dialog">
<div class="dialog-content">
<h3><i class="fas fa-exclamation-triangle" style="color: var(--danger); margin-right:
10px;"></i> Confirm Deletion</h3>
<p>Are you sure you want to delete this question? This action cannot be undone.</p>
<div class="dialog-buttons">
<a href="#" id="confirm-delete-btn" class="btn btn-danger">Yes, Delete</a>
<button onclick="closeDialog('delete-confirmation')" class="btn btn-
secondary">Cancel</button>
</div>
</div>
</div>

<script>
function openTab(tabName) {
// Hide all tab contents
const tabContents = document.getElementsByClassName('tab-content');
for (let i = 0; i < tabContents.length; i++) {
6
tabContents[i].classList.remove('active');
}

// Remove active class from all tabs


const tabs = document.getElementsByClassName('tab');
for (let i = 0; i < tabs.length; i++) {
tabs[i].classList.remove('active');
}

// Show the selected tab content and mark tab as active


document.getElementById(tabName).classList.add('active');
event.currentTarget.classList.add('active');
}

function confirmLogout() {
document.getElementById('logout-confirmation').style.display = 'flex';
}

function confirmDelete(questionId) {
document.getElementById('delete-confirmation').style.display = 'flex';
document.getElementById('confirm-delete-btn').href = `?delete_question=${questionId}`;
}

function closeDialog(dialogId) {
document.getElementById(dialogId).style.display = 'none';
}

function validateTestForm() {
const form = document.getElementById('test-form');
const questions = document.querySelectorAll('.question');
let allAnswered = true;

questions.forEach(question => {
const inputs = question.querySelectorAll('input[type="radio"]');
let answered = false;

inputs.forEach(input => {
if (input.checked) answered = true;
});

6
if (!answered) {
question.style.borderLeftColor = 'var(--danger)';
question.style.animation = 'shake 0.5s';
allAnswered = false;

// Remove animation after it completes


setTimeout(() => {
question.style.animation = '';
}, 500);
} else {
question.style.borderLeftColor = 'var(--light-gray)';
}
});

if (!allAnswered) {
alert('Please answer all questions before submitting.');
return false;
}

// Show loading indicator


const submitBtn = form.querySelector('button[type="submit"]');
submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Submitting...';
submitBtn.disabled = true;

return true;
}

// Add shake animation for unanswered questions


const style = document.createElement('style');
style.textContent = `
@keyframes shake {
0%, 100% { transform: translateX(0); }
10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
20%, 40%, 60%, 80% { transform: translateX(5px); }
}
`;
document.head.appendChild(style);

// Add hover effect to radio options


document.addEventListener('DOMContentLoaded', function() {
6
const answers = document.querySelectorAll('.answer');
answers.forEach(answer => {
answer.addEventListener('click', function() {
const radio = this.querySelector('input[type="radio"]');
if (radio) {
radio.checked = true;
this.closest('.question').style.borderLeftColor = 'var(--success)';
}
});
});
});
</script>
</body>
</html>

b.process.php:

<?php
$db = new mysqli('localhost', 'root', 'root', 'online_test');
if ($db->connect_error) {
die("Connection failed: " . $db->connect_error);
}

if ($_SERVER["REQUEST_METHOD"] == "POST") {
$name = htmlspecialchars($_POST["name"]);
$enrollment = htmlspecialchars($_POST["enrollment"]);
$answers = $_POST["answers"];
$questions = [];
$result = $db->query("SELECT * FROM questions ORDER BY id");
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$questions[$row['id']] = $row;
}
}

$score = 0;
$total_questions = count($questions);
foreach ($questions as $question_id => $question_data) {
if (isset($answers[$question_id]) && $answers[$question_id] == $question_data["correct_answer"])
{
$score++;
}
}
$stmt = $db->prepare("INSERT INTO test_results (student_name, enrollment_number, score,
total_questions) VALUES (?, ?, ?, ?)");
6
$stmt->bind_param("ssii", $name, $enrollment, $score, $total_questions);
$stmt->execute();
$stmt->close();
$db->close();
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Results</title>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-
awesome/6.4.0/css/all.min.css">
</head>
<body>
<div class="floating-shapes">
<div class="shape shape-1"></div>
<div class="shape shape-2"></div>
<div class="shape shape-3"></div>
</div>

<div class="container">
<div class="header">
<h1>Test Results</h1>
<p>Your detailed performance analysis and test results</p>
</div>

<div class="score-display">
<h2>Your Final Score</h2>

<div class="performance-meter">
<svg class="performance-circle" viewBox="0 0 200 200">
<circle class="performance-circle-bg" cx="100" cy="100" r="90"></circle>
<circle class="performance-circle-fill" cx="100" cy="100" r="90"></circle>
</svg>
<div class="performance-text">
<div class="performance-percent"><?php echo round(($score / $total_questions) * 100);
?>%</div>
<div class="performance-label">Score</div>
</div>
</div>

<div class="score-value"><?php echo $score; ?>/<?php echo $total_questions; ?></div>


<div class="progress-container">
6
<div class="progress-bar"></div>
</div>
<p class="score-text">You answered <?php echo $score; ?> out of <?php echo
$total_questions; ?> questions correctly</p>

<div class="badge-container">
<div>
<div class="badge">
<i class="fas fa-medal"></i>
</div>
<div class="badge-label">Achievement</div>
</div>
<div>
<div class="badge">
<i class="fas fa-star"></i>
</div>
<div class="badge-label">Performance</div>
</div>
<div>
<div class="badge">
<i class="fas fa-trophy"></i>
</div>
<div class="badge-label">Rank</div>
</div>
</div>
</div>

<div class="user-info">
<div class="info-card">
<h3>Student Name</h3>
<p><?php echo $name; ?></p>
</div>
<div class="info-card">
<h3>Enrollment Number</h3>
<p><?php echo $enrollment; ?></p>
</div>
<div class="info-card">
<h3>Submission Date</h3>
<p><?php echo date('F j, Y, g:i a'); ?></p>
</div>
</div>

<div class="results-section">
<h2>Detailed Question Analysis</h2>

<?php foreach ($questions as $question_id => $question_data):


$user_answer = isset($answers[$question_id]) ? $answers[$question_id] : "No Answer";
$is_correct = ($user_answer == $question_data["correct_answer"]);
$options = [
6
'A' => $question_data['option_a'],
'B' => $question_data['option_b'],
'C' => $question_data['option_c'],
'D' => $question_data['option_d']
];
?>
<div class="question-result <?php echo $is_correct ? 'correct' : 'incorrect'; ?>">
<h3><span><?php echo array_search($question_id, array_keys($questions)) + 1;
?></span><?php echo htmlspecialchars($question_data['question_text']); ?></h3>

<?php foreach ($options as $option_key => $option_value): ?>


<div class="option">
<input type="radio"
name="answers[<?php echo $question_id; ?>]"
value="<?php echo $option_key; ?>"
disabled
<?php echo ($user_answer == $option_key) ? 'checked' : ''; ?>>
<label>
<?php echo $option_key . ". " . htmlspecialchars($option_value); ?>
<?php if ($user_answer == $option_key): ?>
<?php echo $is_correct ? '<span class="tick"><i class="fas fa-check-
circle"></i> Correct</span>' : '<span class="cross"><i class="fas fa-times-circle"></i>
Incorrect</span>'; ?>
<?php endif; ?>
</label>
</div>
<?php endforeach; ?>

<?php if (!$is_correct): ?>


<div class="correct-answer">
<i class="fas fa-lightbulb"></i>
<div>
<strong>Correct Answer:</strong> <?php echo $question_data["correct_answer"] .
". " . htmlspecialchars($options[$question_data["correct_answer"]]); ?>
<div style="margin-top: 8px; font-size: 0.95em; color: var(--danger);">Your
answer: <?php echo $user_answer; ?></div>
</div>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>

<a href="index.php" class="btn"><i class="fas fa-arrow-left"></i> Back to Test Portal</a>


</div>
</div>

<script>
// Animate progress bar on page load
document.addEventListener('DOMContentLoaded', function() {
6
const progressBar = document.querySelector('.progress-bar');
const computedWidth = progressBar.style.width;
progressBar.style.width = '0';

setTimeout(() => {
progressBar.style.width = computedWidth;
}, 100);

// Add animation to correct/incorrect indicators


const ticks = document.querySelectorAll('.tick, .cross');
ticks.forEach((tick, index) => {
setTimeout(() => {
tick.style.animation = 'bounce 0.5s';
setTimeout(() => {
tick.style.animation = '';
}, 500);
}, index * 100);
});
});

// Add bounce animation


const style = document.createElement('style');
style.textContent = `
@keyframes bounce {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.3); }
}
`;
document.head.appendChild(style);
</script>
</body>
</html>

6
6. Features :

1. User-Friendly Interface: Simple and intuitive design for easy navigation.


2. Instant Result Analysis: Displays correct and incorrect answers after submission.
3. Secure Authentication: Only authorized admins can manage test content.
4. Database Integration: Efficient storage and retrieval of questions, responses, and results.
5. Unlimited Attempts: Users can take the test multiple times without restrictions.
6. Real-Time Processing: Immediate evaluation and result display.

7. Technical Specifications:

1. Programming Language: PHP (Backend), HTML, CSS, JavaScript (Frontend)


2. Database: MySQL for storing questions, user responses, and results
3. Web Server: Apache (XAMPP for local development)
4. Authentication: Admin login for secure question management
5. Deployment Platform: Can be hosted on a local server or a web hosting service
6. Browser Compatibility: Supports Chrome, Firefox, Edge, and other modern browsers

8. How Railway Reservation App works?

The Online Examination System provides a simple and intuitive user interface, allowing users to
navigate between the test and results pages. On the first page, users are presented with multiple-
choice questions (MCQs) to answer. Once the test is submitted, the system automatically evaluates
the responses based on the correct answers stored in the database. The second page displays the
results in real-time, showing which questions were answered correctly or incorrectly along with the
correct answers for reference. A secure admin panel enables authorized administrators to log in and
manage test questions by adding, updating, or deleting them. All test data, including questions, user
responses, and results, is stored in a MySQL database for efficient retrieval and management. The
system ensures security through authentication, allowing only admins to modify questions while
keeping user responses and results protected. Users can attempt the test multiple times without
restrictions, and real-time processing provides instant feedback after submission.

23
9. Future developments:

1. Timer-based tests to add time restrictions for each exam.


2. User authentication and profiles to allow users to register, log in, and track their test history.
3. Multiple question formats, such as subjective, fill-in-the-blank, and coding-based questions.
4. AI-powered analysis to provide detailed performance insights and personalized feedback.
5. Question randomization to prevent cheating by displaying questions in different orders.
6. Exportable reports in PDF or Excel format to help admins review test results efficiently.

10. Advantages:

1. Instant Results: Automated evaluation for quick feedback.


2. Cost-Effective: Eliminates paper, printing, and manual grading costs.
3. Accessibility: Users can take exams from anywhere at any time.
4. Security: Admin authentication prevents unauthorized modifications.
5. Scalability: Supports multiple users taking tests simultaneously.
6. Flexibility: Allows unlimited test attempts and easy question updates.
7. Automated Analysis: Provides performance insights and correct answers.
8. Efficient Data Management: Database integration ensures secure storage and retrieval of
test records.

11. Disadvantages:

1. Internet Dependency: Requires a stable internet connection for smooth functioning.


2. Cheating Possibilities: Users may find ways to cheat without strict monitoring.
3. Limited Question Types: Mostly supports objective questions; subjective evaluation is
challenging.
4. Technical Issues: Server crashes, bugs, or system failures can disrupt exams.
5. Security Risks: Vulnerable to hacking or unauthorized access if not properly secured.
6. User Adaptability: Some users may struggle with the digital interface, especially those
unfamiliar with technology.
7. Lack of Human Supervision: No direct invigilation, making it harder to control dishonest
practices.

24
12. Actual Output:

25
26
13. Actual Resource Used:

Sr. No Name of Recourse Specification Qty Remark


Apache (80/8080),
1 XAMPP MySQL (3306),
8.2.12 (PHP 8.2.12)
Microsoft,
2. Visual Studio Code version 1.98.0.

14. Skill Developed/Learning outcome of Micro-Project:

This project helped us develop essential skills in web development using PHP, including
designing user-friendly interfaces, managing a MySQL database for storing questions, user
responses, and results, and handling data processing between pages. We improved our UI/UX
design, implemented an admin panel for secure question management, and developed features
for automated evaluation and instant result display. Throughout the project, we enhanced our
problem-solving abilities and learned the importance of writing clean, efficient, and well-
structured code to ensure a seamless user experience.

15. Application of this Micro-Project:

1. Educational institutions for exams and assessments.


2. Companies for employee skill evaluation and recruitment tests.
3. Government and private organizations for certification exams.
4. E-learning platforms for self-assessment tests.
5. Coaching centers for tracking student performance.

27
16. Conclusion:

The Online Examination System provides an efficient and automated platform for
conducting tests. It ensures instant result evaluation and simplifies exam management. A
secure admin panel allows authorized question management. Database integration ensures
efficient data storage and retrieval. Real-time processing enhances user experience with quick
feedback. The system is scalable and flexible for various applications. This project improved
our web development and problem-solving skills.

17. References:

1. https://www.geeksforgeeks.org/php-database-connection/
2. https://www.w3schools.com/php/php_mysql_connect.asp
3. https://mailtrap.io/blog/php-form-validation/
4. https://www.sitepoint.com/form-validation-with-php/

28
29
30
19
20
21
12. Actual Resource Used:

Sr. No Name of Recourse Specification Qty Remark


Ladybug Feature
1 Android Studio Drop 24.2.2
-

13. Skill Developed/Learning outcome of Micro-Project:

This micro-project helped us develop essential skills in Android app development, including
creating user-friendly interfaces using Java and XML, managing an SQLite database for storing
train details and bookings, and handling data transfer between activities. We improved our
UI/UX design, integrated libraries for better functionality, and implemented features for train
management and ticket booking. Along the way, we enhanced our problem-solving abilities and
learned the importance of writing clean, efficient, and well-structured code to ensure a smooth
user experience.

14. Application of this Micro-Project:

a. Real-Time Booking Updates


b. User-Friendly Travel Planning
c. Railway Staff Assistance
d. Improved Passenger Experience
e. Passenger Reservation System

22
15. The Railway Reservation Conclusion:
App provides a simple and efficient solution for managing train reservations. By integrating train
search, ticket booking, and reservation management, the app enhances user convenience and
streamlines the booking process. Using SQLite for data storage, it ensures offline accessibility
while maintaining a user-friendly interface for seamless navigation. Through this project, we
gained valuable insights into Android app development, database management, and UI/UX design.
This application can be further enhanced with features like real-time train tracking, payment
integration, and automated seat availability updates, making it even more functional and user-
centric.

16. References:

a. https://www.irctc.co.in

b. https://www.makemytrip.com

c. https://www.redbus.in

23

You might also like