Online Examination
Online Examination
MANAGEMENT SYSTEM
BY
ELWIN JONATHAN
Acknowledgment
I am deeply grateful to all those who provided the possibility to complete this project.
First and foremost, I would like to thank my computer science teacher, Mrs. SUNANTHA
mam, whose guidance and encouragement were invaluable throughout the entire
process. Your expertise, patience, and willingness to share your knowledge have
significantly contributed to the success of this project.
I would also like to express my heartfelt thanks to my school’s computer lab staff for
their technical support and for providing a conducive environment to work on this
project. Their assistance in troubleshooting hardware and software issues was
immensely helpful.
A special mention goes to my classmates and friends, whose constructive feedback and
collaborative spirit have been crucial in refining my ideas and approaches. Their
camaraderie made the journey enjoyable and enlightening.
SIGN PAGE
DESCRIPTION
NO. NO.
1. ABSTRACT 4
2. REQUIREMENT ANALYSIS 5
3. APPLICATIONS 7
4. DESIGN 9
5. PROJECT FLOWCHART 10
6. ALGORITHM 11
7. SOURCE CODE 13
8. SAMPLE OUTPUT
9. FUTURE ENHANCEMENT
10. BIBLIOGRAPHY
ABSTRACT
The primary objective of this project is to create a reliable and user-friendly system
that supports the key functionalities required for online examinations.
The Online Examination System aims to enhance the efficiency and effectiveness of
the examination process by reducing administrative burdens, minimizing errors, and
providing real-time access to exam data. By offering a secure and scalable solution,
this system supports the evolving needs of educational institutions and organizations
in delivering high-quality online assessments.
REQUIREMENTS
Software Requirements
Server - Reliable server for hosting the application <br> - Sufficient CPU,
RAM, and storage capacity for handling user load and data
Client Devices - Computers or tablets with internet access for students and
teachers <br> - Web browser compatibility (e.g., Chrome, Firefox)
Network - Stable and high-speed internet connection for smooth access and
Infrastructure performance <br> - Secure network environment to protect data
Backup System - Backup solutions for data integrity and recovery <br> - Regular
backups of database and application data
Security - Firewalls and security appliances to safeguard against cyber
Hardware threats <br> - Secure authentication hardware (optional, for
enhanced security)
APPLICATIONS
1. Educational Institutions
• Schools: Conduct periodic tests, mid-term exams, and final exams for students
in a secure and efficient manner.
• Colleges and Universities: Facilitate semester exams, entrance exams, and
other assessments for undergraduate and postgraduate courses.
• Distance Learning Programs: Provide a platform for remote students to take
exams and assessments from anywhere in the world.
2. Corporate Training
• Employee Assessments: Evaluate employees' knowledge and skills after
training sessions, onboarding programs, or periodic performance reviews.
• Certification Programs: Offer internal certifications for specific skills or
knowledge areas relevant to the organization.
3. Certification Bodies
• Professional Certifications: Conduct certification exams for various
professional courses like PMP, Six Sigma, IT certifications, etc.
• Licensing Exams: Manage exams for licenses required in professions such as
accounting, law, medicine, and engineering.
4. Government Exams
• Public Sector Exams: Facilitate exams for government job recruitments, public
sector undertakings, and civil services.
• Competitive Exams: Conduct exams for competitive entrance tests such as
state and national level exams for various educational and professional
programs.
5. Recruitment Agencies
• Aptitude Tests: Evaluate candidates' aptitude and skills as part of the
recruitment process for various job roles.
• Technical Assessments: Conduct technical tests to assess candidates'
proficiency in specific domains such as IT, engineering, and finance.
6. Language Proficiency Tests
• Language Schools: Manage exams for language proficiency certifications such
as TOEFL, IELTS, and other language courses.
• Online Language Learning Platforms: Provide assessments to gauge learners'
progress and proficiency in new languages.
7. Training Institutes
• Skill Development Centers: Facilitate assessments for vocational and skill
development programs.
• Online Learning Platforms: Provide a platform for testing learners in various
online courses and MOOCs (Massive Open Online Courses).
EXPLANATION
• User Interface (UI): The main entry point for users to interact with the system.
• Login (LM): Handles user login and authentication.
• Exam (EM): Manages exams including creation, question management, and
attempts.
• Results (RM): Manages the retrieval and analysis of exam results.
ALGORITHM
# User Authentication
from flask import Flask, request, jsonify
import mysql.connector
import bcrypt
app = Flask(__name__)
@app.route('/login', methods=['POST'])
def login():
username = request.form['username']
password = request.form['password']
cursor = db.cursor(dictionary=True)
cursor.execute("SELECT * FROM users WHERE username = %s", (username,))
user = cursor.fetchone()
if user and bcrypt.checkpw(password.encode('utf-8'),
user['password_hash'].encode('utf-8')):
return jsonify({"message": "Login successful", "role": user['role']}), 200
else:
return jsonify({"message": "Invalid credentials"}), 401
if __name__ == '__main__':
app.run(debug=True)
# Exam Creation
from flask import Flask, request, jsonify
import mysql.connector
app = Flask(__name__)
@app.route('/create_exam', methods=['POST'])
def create_exam():
title = request.form['title']
date = request.form['date']
questions = request.form.getlist('questions')
cursor = db.cursor()
cursor.execute("INSERT INTO exams (title, date) VALUES (%s, %s)", (title, date))
exam_id = cursor.lastrowid
db.commit()
return jsonify({"message": "Exam created successfully"}), 200
if __name__ == '__main__':
app.run(debug=True)
# Automated Grading
from flask import Flask, request, jsonify
import mysql.connector
app = Flask(__name__)
cursor = db.cursor(dictionary=True)
cursor.execute("SELECT * FROM questions WHERE exam_id = %s", (exam_id,))
questions = cursor.fetchall()
score = 0
for i, question in enumerate(questions):
correct_answer = question['correct_answer']
student_answer = answers[i]
if student_answer == correct_answer:
score += 1
if __name__ == '__main__':
app.run(debug=True)
# Result Analysis
from flask import Flask, jsonify
import mysql.connector
app = Flask(__name__)
@app.route('/result_analysis/<exam_id>', methods=['GET'])
def result_analysis(exam_id):
cursor = db.cursor(dictionary=True)
cursor.execute("SELECT score FROM results WHERE exam_id = %s", (exam_id,))
scores = cursor.fetchall()
return jsonify({
"average_score": average_score,
"highest_score": highest_score,
"lowest_score": lowest_score
}), 200
if __name__ == '__main__':
app.run(debug=True)
# Question Randomization
import random
from flask import Flask, jsonify
import mysql.connector
app = Flask(__name__)
@app.route('/randomize_questions/<exam_id>', methods=['GET'])
def randomize_questions(exam_id):
cursor = db.cursor(dictionary=True)
cursor.execute("SELECT * FROM exam_questions WHERE exam_id = %s",
(exam_id,))
questions = cursor.fetchall()
random.shuffle(questions)
for question in questions:
# Assuming 'choices' is a list of possible answers for each question
question['choices'] = random.sample(question['choices'], len(question['choices']))
if __name__ == '__main__':
app.run(debug=True)
Future Enhancements
• Wikipedia - wikipedia.org
• Python Official Documentation - python.org
• MySQL Official Documentation - mysql.com
• Flask Official Documentation - flask.palletsprojects.com
• W3Schools - w3schools.com
• Stack Overflow - stackoverflow.com
• GitHub - github.com
• Geeks for Geeks - geeksforgeeks.org
• Real Python - realpython.com