Friday, 29 November 2019

PHP MySql Based Online Exam System Project



This tutorial will help you to make Online Examination System using PHP script with Mysql Database. So, Are looking for any educational project or build small system in PHP using Mysql database, then you have come on the right place. Because in this post, you can find the solution of your needs. Here we will build Online Examination application in PHP with Mysql database, which will help you to build your education final year project. And if you are beginner level of PHP programmer and are you learn how to any Online dynamic system in PHP then this post will help you.

What is Online Exam System?


In the world of internet, all task has been done through internet, so we have decide why Exam has not conducted through internet. For convert current exam system into digital exam system, we have build this small Online Exam system project. If this system has build in professional level then it will automate our existing examination system into digitize exam system. In this system it will required less labor force for execute system and it will be more accurate and less time consuming and at the same time we can conduct more person exam at the same time and it will publish result in a very short time. Below you can find benefits of Online Examination System. If this system has been implemented then examination will not limited in to four wall of class room, but student can part into exam from any place.

Benefits of Online Examination System


  1. Online Exam System will Save Organisation and Student Money.
  2. Online Exam System will Securely Store Exam Question Papar and it will directly visible to Student who has take part in Exam.
  3. Online Exam System will Save the Cost of Paper, because Exam will be conduct online.
  4. Online Exam System will reduce the cost of logestic for deliver question paper on examination center.
  5. Online Exam System will save the time of both Institution who has conduct examination and student who has take part in Exam.
  6. Online Exam System will provide Remote Supervision by using security feature of this system.
  7. Online Exam System will reduce the time of publish exam result with Ranking, because in single click result will be generated.
  8. Online Exam System will give us history of old examination in a single click.
  9. Online Exam System has provide all student information in single plateform.
  10. Online Exam System has provide facility to use to take part by using any electronic device in which internet access facility available.



Features of Online Exam System


Admin Side


  1. Admin Can Create New Online Exam with Edit and Delete Feature
  2. Admin Can Add Question in Exam which has been define at the time of create exam
  3. Admin Can View All Exam Question with Edit and Delete Operation
  4. Admin Can view all user data who has register for online examination system
  5. Admin can view all user who has enroll for particular exam
  6. Admin can view individual user exam result on web page and in PDF format
  7. Admin can view combine result of exam with user rank on web page and in PDF format

User Side


  1. New User Registration for Online Examination with Confirmation Email Feature
  2. User can Login into System using Email ID and Password
  3. User can manage his or her profile details
  4. User can change his or her password
  5. User can view available examination list
  6. User can enroll into examination
  7. User can attend online examination at the define date and time
  8. User can view the history of exam which he or she had enroll
  9. User can view the exam result on Web page and in PDF format also.

Technology used in Online Exam System



Front end


  1. HTML 5 - For make HTML Web page
  2. jQuery - For easier to use Javascript on web page
  3. Ajax - For Perform Server operation at client side
  4. Bootstrap 4 - For make Responsive Online Exam System
  5. jQuery Datatable Plugin - For list data on web page in table format with different feature like searching sorting etc.
  6. Parsley.js - For Validate form data at client side
  7. Bootstrap Datetimepicker - User for Data and time field form data
  8. TimeCircles - For Display remaining exam time on web page

Back end


  1. PHP 5.6+ - For write system login
  2. Mysql - For store system data
  3. PHPMailer - For Send email after registration
  4. DomPdf - For generate exam result in PDf format

Database Structure of Online Exam System



Source code Online Exam System


master/register.php


In this file we will make registration form for set up Admin account for Online Examination system. Suppose we have to require multiple Admin account for different purpose, so here we have make registration form for create new Admin account for Web based exam application. By this feature this system will be fully dynamic system.

For validate unique email address for admin registration, here we have use Parsley.js custom validator. This validator will check particular email already register in our system or not. This validator will trigger before form submission, when this validator has been trigger then it will send Ajax request to sever script for check admin has already register with particular email in our database.

Here we have use Ajax for submit Admin Registration form data to server, when we have click on register button, then by using jQuery code, it will add parsley attribute for verify form data. If form data is proper, then it will send form data to server using Ajax request.

master/register.php

<?php

//register.php

include('Examination.php');

$exam = new Examination;

$exam->admin_session_public();

?>

<!DOCTYPE html>
<html lang="en">
<head>
   <title>Online Examination System in PHP</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
   <script src="https://cdn.jsdelivr.net/gh/guillaumepotier/Parsley.js@2.9.1/dist/parsley.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
   <link rel="stylesheet" href="../style/style.css" />
</head>
<body>
 <div class="jumbotron text-center" style="margin-bottom:0; padding: 1rem 1rem;">
     <img src="logo.png" class="img-fluid" width="300" alt="Online Examination System in PHP" />
 </div>

 <div class="container">
    <div class="row">
      <div class="col-md-3">

      </div>
      <div class="col-md-6" style="margin-top:20px;">
       <span id="message"></span>
         <div class="card">
           <div class="card-header">Admin Registration</div>
           <div class="card-body">
              <form method="post" id="admin_register_form">
                    <div class="form-group">
                        <label>Enter Email Address</label>
                        <input type="text" name="admin_email_address" id="admin_email_address" class="form-control" data-parsley-checkemail data-parsley-checkemail-message='Email Address already Exists' />
                    </div>
                    <div class="form-group">
                      <label>Enter Password</label>
                      <input type="password" name="admin_password" id="admin_password" class="form-control" />
                    </div>
                    <div class="form-group">
                      <label>Enter Confirm Password</label>
                      <input type="password" name="confirm_admin_password" id="confirm_admin_password" class="form-control" />
                    </div>
                    <div class="form-group">
                      <input type="hidden" name="page" value="register" />
                      <input type="hidden" name="action" value="register" />
                      <input type="submit" name="admin_register" id="admin_register" class="btn btn-info" value="Register" />
                    </div>
                  </form>
              <div align="center">
               <a href="login.php">Login</a>
              </div>
           </div>
         </div>
      </div>
      <div class="col-md-3">

      </div>
    </div>
 </div>

</body>
</html>

<script>

$(document).ready(function(){

 window.ParsleyValidator.addValidator('checkemail', {
    validateString: function(value)
    {
      return $.ajax({
        url:"ajax_action.php",
        method:"POST",
        data:{page:'register', action:'check_email', email:value},
        dataType:"json",
        async: false,
        success:function(data)
        {
          return true;
        }
      });
    }
  });

  $('#admin_register_form').parsley();

  $('#admin_register_form').on('submit', function(event){

    event.preventDefault();

    $('#admin_email_address').attr('required', 'required');

    $('#admin_email_address').attr('data-parsley-type', 'email');

    $('#admin_password').attr('required', 'required');

    $('#confirm_admin_password').attr('required', 'required');

    $('#confirm_admin_password').attr('data-parsley-equalto', '#admin_password');

    if($('#admin_register_form').parsley().isValid())
    {
      $.ajax({
        url:"ajax_action.php",
        method:"POST",
        data:$(this).serialize(),
        dataType:"json",
        beforeSend:function(){
          $('#admin_register').attr('disabled', 'disabled');
          $('#admin_register').val('please wait...');
        },
        success:function(data)
        {
          if(data.success)
          {
            $('#message').html('<div class="alert alert-success">Please check your email</div>');
            $('#admin_register_form')[0].reset();
            $('#admin_register_form').parsley().reset();
          }

          $('#admin_register').attr('disabled', false);
          $('#admin_register').val('Register');
        }
      });
    }

  });

});

</script>


master/Examination.php


This is main PHP class for this Online Exam Application. Here we will PHP PDO Object Oriented Programming for build logic of this Online Quiz system. In this class we have make following method, which we will used for different purpose to build Online Examination System in PHP.

  1. __construct() - This is the magic function code will be execute on every time whenever this class new object has been created, and on every new object creation it will make database connection with this Online Exam system using PHP PDO class object.
  2. execute_query() - This method will used for execute SQL query for database operation.
  3. total_row() - This method will return total number of rows has been affected after query execution. In this method we have used execute_query() method also.
  4. send_email($receiver_email, $subject, $body) - In this method, we have create object of PHPMailer class, and this method we will use for send email in this Online examination system.
  5. redirect($page) - This method we will used for redirect page.
  6. admin_session_private() - This method will check if admin has login into system, if admin not login into system and try to access web page, which has required login into system. Then it will redirect to admin login page.
  7. admin_session_public() - This another method, which has been check admin login. This method will check admin has login into system and try to access login or register page, then it will redirect to index.php page.
  8. query_result() - This method will use execute_query() method for execute SQL query and return query execution result in associative array format.
  9. clean_data() - This method will convert special character into HTML entity for prevent SQL injection.
  10. Is_exam_is_not_started($online_exam_id) - This method is used to check particular exam status like exam is pending, exam is started, exam is completed. This method will return true if exam is not started yet.
  11. Get_exam_question_limit($exam_id) - This method will return the allowed to add question limit in particular examination.
  12. Get_exam_total_question($exam_id) - This method will return how many question has been already added into particular examination.
  13. Is_allowed_add_question($exam_id) - This method will return true, if in particular examination, admin can allowed to add question. Otherwise this method will return false.
  14. execute_question_with_last_id() - This method will insert new question in Mysql database and return last inserted id of added question.
  15. Get_exam_id($exam_code) - This method will return exam id from the value of $exam_code variable value from exam table.
  16. Upload_file() - This method will upload selected image into upload folder.

master/Examination.php

<?php

class Examination
{
 var $host;
 var $username;
 var $password;
 var $database;
 var $connect;
 var $home_page;
 var $query;
 var $data;
 var $statement;
 var $filedata;

 function __construct()
 {
  $this->host = 'localhost';
  $this->username = 'root';
  $this->password = '';
  $this->database = 'online_examination';
  $this->home_page = 'http://localhost/tutorial/online_examination/';

  $this->connect = new PDO("mysql:host=$this->host; dbname=$this->database", "$this->username", "$this->password");

  session_start();
 }

 function execute_query()
 {
  $this->statement = $this->connect->prepare($this->query);
  $this->statement->execute($this->data);
 }

 function total_row()
 {
  $this->execute_query();
  return $this->statement->rowCount();
 }

 function send_email($receiver_email, $subject, $body)
 {
  $mail = new PHPMailer;

  $mail->IsSMTP();

  $mail->Host = 'smtp host';

  $mail->Port = '587';

  $mail->SMTPAuth = true;

  $mail->Username = '';

  $mail->Password = '';

  $mail->SMTPSecure = '';

  $mail->From = 'info@webslesson.info';

  $mail->FromName = 'info@webslesson.info';

  $mail->AddAddress($receiver_email, '');

  $mail->IsHTML(true);

  $mail->Subject = $subject;

  $mail->Body = $body;

  $mail->Send();  
 }

 function redirect($page)
 {
  header('location:'.$page.'');
  exit;
 }
 
 function admin_session_private()
 {
  if(!isset($_SESSION['admin_id']))
  {
   $this->redirect('login.php');
  }
 }

 function admin_session_public()
 {
  if(isset($_SESSION['admin_id']))
  {
   $this->redirect('index.php');
  }
 }

 function query_result()
 {
  $this->execute_query();
  return $this->statement->fetchAll();
 }
 
 function clean_data($data)
 {
   $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
 }
 
 function Is_exam_is_not_started($online_exam_id)
 {
  $current_datetime = date("Y-m-d") . ' ' . date("H:i:s", STRTOTIME(date('h:i:sa')));

  $exam_datetime = '';

  $this->query = "
  SELECT online_exam_datetime FROM online_exam_table 
  WHERE online_exam_id = '$online_exam_id'
  ";

  $result = $this->query_result();

  foreach($result as $row)
  {
   $exam_datetime = $row['online_exam_datetime'];
  }

  if($exam_datetime > $current_datetime)
  {
   return true;
  }
  return false;
 }
 
 function Get_exam_question_limit($exam_id)
 {
  $this->query = "
  SELECT total_question FROM online_exam_table 
  WHERE online_exam_id = '$exam_id'
  ";

  $result = $this->query_result();

  foreach($result as $row)
  {
   return $row['total_question'];
  }
 }

 function Get_exam_total_question($exam_id)
 {
  $this->query = "
  SELECT question_id FROM question_table 
  WHERE online_exam_id = '$exam_id'
  ";

  return $this->total_row();
 }

 function Is_allowed_add_question($exam_id)
 {
  $exam_question_limit = $this->Get_exam_question_limit($exam_id);

  $exam_total_question = $this->Get_exam_total_question($exam_id);

  if($exam_total_question >= $exam_question_limit)
  {
   return false;
  }
  return true;
 }

 function execute_question_with_last_id()
 {
  $this->statement = $this->connect->prepare($this->query);

  $this->statement->execute($this->data);

  return $this->connect->lastInsertId();
 }
 function Get_exam_id($exam_code)
 {
  $this->query = "
  SELECT online_exam_id FROM online_exam_table 
  WHERE online_exam_code = '$exam_code'
  ";

  $result = $this->query_result();

  foreach($result as $row)
  {
   return $row['online_exam_id'];
  }
 }
 
 function Upload_file()
 {
  if(!empty($this->filedata['name']))
  {
   $extension = pathinfo($this->filedata['name'], PATHINFO_EXTENSION);

   $new_name = uniqid() . '.' . $extension;

   $_source_path = $this->filedata['tmp_name'];

   $target_path = 'upload/' . $new_name;

   move_uploaded_file($_source_path, $target_path);

   return $new_name;
  }
 }
 
 function user_session_private()
 {
  if(!isset($_SESSION['user_id']))
  {
   $this->redirect('login.php');
  }
 }

 function user_session_public()
 {
  if(isset($_SESSION['user_id']))
  {
   $this->redirect('index.php');
  }
 }
}

 


?>




master/ajax_action.php


In this PHP file, you can find PHP script of all operation, which it had done at master side, you can find here. This file will received Ajax request for do different operation.

In this file, we have include Examination.php class and PHPMailer class library. Here you can find different database related operation will be perform here.

  • In this file, first it has received Ajax request from Admin Register page for check particular Admin Email already register or not in Mysql database.
  • After Check unique Admin email address, this page also received second Ajax request from Admin register page for complete Admin registration process, once registeration data has been inserted then it will make dynamic admin email verification email and send to admin email address for email verification process.
  • Once Registration has been completed and admin has try to login into system, then admin login details has been validated here by using Ajax request.
  • This php script will also received Ajax request from Exam.php file also. From this file, first it will received Ajax request for fetch data from Mysql table, and send back response in json format.
  • This page will received Ajax request for Insert new Online Exam Schedule data in Mysql table.
  • Once Exam details has been store under this system. Now admin want to alter the details of Online examination, so that single examination details will be fetch from this page by sending ajax request.
  • If Particular exam details has been display in Bootstrap modal and when admin has made required changes and click on edit button, then Ajax request for edit data will received and here exam data will be updated using Ajax with PHP script.
  • For delete or remove of Exam details will be done from this file also. So, Exam delete operation will be done here.
master/ajax_action.php

<?php

//ajax_action.php

include('Examination.php');

require_once('../class/class.phpmailer.php');

$exam = new Examination;

$current_datetime = date("Y-m-d") . ' ' . date("H:i:s", STRTOTIME(date('h:i:sa')));

if(isset($_POST['page']))
{
 if($_POST['page'] == 'register')
 {
  if($_POST['action'] == 'check_email')
  {
   $exam->query = "
   SELECT * FROM admin_table 
   WHERE admin_email_address = '".trim($_POST["email"])."'
   ";

   $total_row = $exam->total_row();

   if($total_row == 0)
   {
    $output = array(
     'success' => true
    );

    echo json_encode($output);
   }
  }

  if($_POST['action'] == 'register')
  {
   $admin_verification_code = md5(rand());

   $receiver_email = $_POST['admin_email_address'];

   $exam->data = array(
    ':admin_email_address'  => $receiver_email,
    ':admin_password'   => password_hash($_POST['admin_password'], PASSWORD_DEFAULT),
    ':admin_verfication_code' => $admin_verification_code,
    ':admin_type'    => 'sub_master', 
    ':admin_created_on'   => $current_datetime
   );

   $exam->query = "
   INSERT INTO admin_table 
   (admin_email_address, admin_password, admin_verfication_code, admin_type, admin_created_on) 
   VALUES 
   (:admin_email_address, :admin_password, :admin_verfication_code, :admin_type, :admin_created_on)
   ";

   $exam->execute_query();

   $subject = 'Online Examination Registration Verification';

   $body = '
   <p>Thank you for registering.</p>
   <p>This is a verification eMail, please click the link to verify your eMail address by clicking this <a href="'.$exam->home_page.'verify_email.php?type=master&code='.$admin_verification_code.'" target="_blank"><b>link</b></a>.</p>
   <p>In case if you have any difficulty please eMail us.</p>
   <p>Thank you,</p>
   <p>Online Examination System</p>
   ';

   $exam->send_email($receiver_email, $subject, $body);

   $output = array(
    'success' => true
   );

   echo json_encode($output);
  }
 }

 if($_POST['page'] == 'login')
 {
  if($_POST['action'] == 'login')
  {
   $exam->data = array(
    ':admin_email_address' => $_POST['admin_email_address']
   );

   $exam->query = "
   SELECT * FROM admin_table 
   WHERE admin_email_address = :admin_email_address
   ";

   $total_row = $exam->total_row();

   if($total_row > 0)
   {
    $result = $exam->query_result();

    foreach($result as $row)
    {
     if($row['email_verified'] == 'yes')
     {
      if(password_verify($_POST['admin_password'], $row['admin_password']))
      {
       $_SESSION['admin_id'] = $row['admin_id'];
       $output = array(
        'success' => true
       );
      }
      else
      {
       $output = array(
        'error' => 'Wrong Password'
       );
      }
     }
     else
     {
      $output = array(
       'error'  => 'Your Email is not verify'
      );
     }
    }
   }
   else
   {
    $output = array(
     'error'  => 'Wrong Email Address'
    );
   }
   echo json_encode($output);
  }
 }

 if($_POST['page'] == 'exam')
 {
  if($_POST['action'] == 'fetch')
  {
   $output = array();

   $exam->query = "
   SELECT * FROM online_exam_table 
   WHERE admin_id = '".$_SESSION["admin_id"]."' 
   AND (
   ";

   if(isset($_POST['search']['value']))
   {
    $exam->query .= 'online_exam_title LIKE "%'.$_POST["search"]["value"].'%" ';

    $exam->query .= 'OR online_exam_datetime LIKE "%'.$_POST["search"]["value"].'%" ';

    $exam->query .= 'OR online_exam_duration LIKE "%'.$_POST["search"]["value"].'%" ';

    $exam->query .= 'OR total_question LIKE "%'.$_POST["search"]["value"].'%" ';

    $exam->query .= 'OR marks_per_right_answer LIKE "%'.$_POST["search"]["value"].'%" ';

    $exam->query .= 'OR marks_per_wrong_answer LIKE "%'.$_POST["search"]["value"].'%" ';

    $exam->query .= 'OR online_exam_status LIKE "%'.$_POST["search"]["value"].'%" ';
   }

   $exam->query .= ')';

   if(isset($_POST['order']))
   {
    $exam->query .= 'ORDER BY '.$_POST['order']['0']['column'].' '.$_POST['order']['0']['dir'].' ';
   }
   else
   {
    $exam->query .= 'ORDER BY online_exam_id DESC ';
   }

   $extra_query = '';

   if($_POST['length'] != -1)
   {
    $extra_query .= 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length'];
   }

   $filtered_rows = $exam->total_row();

   $exam->query .= $extra_query;

   $result = $exam->query_result();

   $exam->query = "
   SELECT * FROM online_exam_table 
   WHERE admin_id = '".$_SESSION["admin_id"]."'
   ";

   $total_rows = $exam->total_row();

   $data = array();

   foreach($result as $row)
   {
    $sub_array = array();
    $sub_array[] = html_entity_decode($row['online_exam_title']);

    $sub_array[] = $row['online_exam_datetime'];

    $sub_array[] = $row['online_exam_duration'] . ' Minute';

    $sub_array[] = $row['total_question'] . ' Question';

    $sub_array[] = $row['marks_per_right_answer'] . ' Mark';


    $sub_array[] = '-' . $row['marks_per_wrong_answer'] . ' Mark';

    $status = '';

    $edit_button = '';
    $delete_button = '';
    $question_button = '';

    if($row['online_exam_status'] == 'Pending')
    {
     $status = '<span class="badge badge-warning">Pending</span>';
    }

    if($row['online_exam_status'] == 'Created')
    {
     $status = '<span class="badge badge-success">Created</span>';
    }

    if($row['online_exam_status'] == 'Started')
    {
     $status = '<span class="badge badge-primary">Started</span>';
    }

    if($row['online_exam_status'] == 'Completed')
    {
     $status = '<span class="badge badge-dark">Completed</span>';
    }

    if($exam->Is_exam_is_not_started($row["online_exam_id"]))
    {
     $edit_button = '
     <button type="button" name="edit" class="btn btn-primary btn-sm edit" id="'.$row['online_exam_id'].'">Edit</button>
     ';

     $delete_button = '<button type="button" name="delete" class="btn btn-danger btn-sm delete" id="'.$row['online_exam_id'].'">Delete</button>';

    }

    if($exam->Is_allowed_add_question($row['online_exam_id']))
    {
     $question_button = '
     <button type="button" name="add_question" class="btn btn-info btn-sm add_question" id="'.$row['online_exam_id'].'">Add Question</button>
     ';
    }
    else
    {
     $question_button = '
     <a href="question.php?code='.$row['online_exam_code'].'" class="btn btn-warning btn-sm">View Question</a>
     ';
    }

    $sub_array[] = $status;

    $sub_array[] = $question_button;

    $sub_array[] = $edit_button . ' ' . $delete_button;

    $data[] = $sub_array;
   }

   $output = array(
    "draw"    => intval($_POST["draw"]),
    "recordsTotal"  => $total_rows,
    "recordsFiltered" => $filtered_rows,
    "data"    => $data
   );

   echo json_encode($output);
  }

  if($_POST['action'] == 'Add')
  {
   $exam->data = array(
    ':admin_id'    => $_SESSION['admin_id'],
    ':online_exam_title' => $exam->clean_data($_POST['online_exam_title']),
    ':online_exam_datetime' => $_POST['online_exam_datetime'] . ':00',
    ':online_exam_duration' => $_POST['online_exam_duration'],
    ':total_question'  => $_POST['total_question'],
    ':marks_per_right_answer'=> $_POST['marks_per_right_answer'],
    ':marks_per_wrong_answer'=> $_POST['marks_per_wrong_answer'],
    ':online_exam_created_on'=> $current_datetime,
    ':online_exam_status' => 'Pending',
    ':online_exam_code'  => md5(rand())
   );

   $exam->query = "
   INSERT INTO online_exam_table 
   (admin_id, online_exam_title, online_exam_datetime, online_exam_duration, total_question, marks_per_right_answer, marks_per_wrong_answer, online_exam_created_on, online_exam_status, online_exam_code) 
   VALUES (:admin_id, :online_exam_title, :online_exam_datetime, :online_exam_duration, :total_question, :marks_per_right_answer, :marks_per_wrong_answer, :online_exam_created_on, :online_exam_status, :online_exam_code)
   ";

   $exam->execute_query();

   $output = array(
    'success' => 'New Exam Details Added'
   );

   echo json_encode($output);
  }

  if($_POST['action'] == 'edit_fetch')
  {
   $exam->query = "
   SELECT * FROM online_exam_table 
   WHERE online_exam_id = '".$_POST["exam_id"]."'
   ";

   $result = $exam->query_result();

   foreach($result as $row)
   {
    $output['online_exam_title'] = $row['online_exam_title'];

    $output['online_exam_datetime'] = $row['online_exam_datetime'];

    $output['online_exam_duration'] = $row['online_exam_duration'];

    $output['total_question'] = $row['total_question'];

    $output['marks_per_right_answer'] = $row['marks_per_right_answer'];

    $output['marks_per_wrong_answer'] = $row['marks_per_wrong_answer'];
   }

   echo json_encode($output);
  }

  if($_POST['action'] == 'Edit')
  {
   $exam->data = array(
    ':online_exam_title' => $_POST['online_exam_title'],
    ':online_exam_datetime' => $_POST['online_exam_datetime'] . ':00',
    ':online_exam_duration' => $_POST['online_exam_duration'],
    ':total_question'  => $_POST['total_question'],
    ':marks_per_right_answer'=> $_POST['marks_per_right_answer'],
    ':marks_per_wrong_answer'=> $_POST['marks_per_wrong_answer'],
    ':online_exam_id'  => $_POST['online_exam_id']
   );

   $exam->query = "
   UPDATE online_exam_table 
   SET online_exam_title = :online_exam_title, online_exam_datetime = :online_exam_datetime, online_exam_duration = :online_exam_duration, total_question = :total_question, marks_per_right_answer = :marks_per_right_answer, marks_per_wrong_answer = :marks_per_wrong_answer  
   WHERE online_exam_id = :online_exam_id
   ";

   $exam->execute_query($exam->data);

   $output = array(
    'success' => 'Exam Details has been changed'
   );

   echo json_encode($output);
  }
  if($_POST['action'] == 'delete')
  {
   $exam->data = array(
    ':online_exam_id' => $_POST['exam_id']
   );

   $exam->query = "
   DELETE FROM online_exam_table 
   WHERE online_exam_id = :online_exam_id
   ";

   $exam->execute_query();

   $output = array(
    'success' => 'Exam Details has been removed'
   );

   echo json_encode($output);
  }
 }

 if($_POST['page'] == 'question')
 {
  if($_POST['action'] == 'Add')
  {
   $exam->data = array(
    ':online_exam_id'  => $_POST['online_exam_id'],
    ':question_title'  => $exam->clean_data($_POST['question_title']),
    ':answer_option'  => $_POST['answer_option']
   );

   $exam->query = "
   INSERT INTO question_table 
   (online_exam_id, question_title, answer_option) 
   VALUES (:online_exam_id, :question_title, :answer_option)
   ";

   $question_id = $exam->execute_question_with_last_id($exam->data);

   for($count = 1; $count <= 4; $count++)
   {
    $exam->data = array(
     ':question_id'  => $question_id,
     ':option_number' => $count,
     ':option_title'  => $exam->clean_data($_POST['option_title_' . $count])
    );

    $exam->query = "
    INSERT INTO option_table 
    (question_id, option_number, option_title) 
    VALUES (:question_id, :option_number, :option_title)
    ";

    $exam->execute_query($exam->data);
   }

   $output = array(
    'success'  => 'Question Added'
   );

   echo json_encode($output);
  }

  if($_POST['action'] == 'fetch')
  {
   $output = array();
   $exam_id = '';
   if(isset($_POST['code']))
   {
    $exam_id = $exam->Get_exam_id($_POST['code']);
   }
   $exam->query = "
   SELECT * FROM question_table 
   WHERE online_exam_id = '".$exam_id."' 
   AND (
   ";

   if(isset($_POST['search']['value']))
   {
    $exam->query .= 'question_title LIKE "%'.$_POST["search"]["value"].'%" ';
   }

   $exam->query .= ')';

   if(isset($_POST["order"]))
   {
    $exam->query .= '
    ORDER BY '.$_POST['order']['0']['column'].' '.$_POST['order']['0']['dir'].' 
    ';
   }
   else
   {
    $exam->query .= 'ORDER BY question_id ASC ';
   }

   $extra_query = '';

   if($_POST['length'] != -1)
   {
    $extra_query .= 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length'];
   }

   $filtered_rows = $exam->total_row();

   $exam->query .= $extra_query;

   $result = $exam->query_result();

   $exam->query = "
   SELECT * FROM question_table 
   WHERE online_exam_id = '".$exam_id."'
   ";

   $total_rows = $exam->total_row();

   $data = array();

   foreach($result as $row)
   {
    $sub_array = array();

    $sub_array[] = $row['question_title'];

    $sub_array[] = 'Option ' . $row['answer_option'];

    $edit_button = '';
    $delete_button = '';

    if($exam->Is_exam_is_not_started($exam_id))
    {
     $edit_button = '<button type="button" name="edit" class="btn btn-primary btn-sm edit" id="'.$row['question_id'].'">Edit</button>';

     $delete_button = '<button type="button" name="delete" class="btn btn-danger btn-sm delete" id="'.$row['question_id'].'">Delete</button>';
    }

    $sub_array[] = $edit_button . ' ' . $delete_button;

    $data[] = $sub_array;
   }

   $output = array(
    "draw"  => intval($_POST["draw"]),
    "recordsTotal" => $total_rows,
    "recordsFiltered" => $filtered_rows,
    "data"  => $data
   );

   echo json_encode($output);
  }

  if($_POST['action'] == 'edit_fetch')
  {
   $exam->query = "
   SELECT * FROM question_table 
   WHERE question_id = '".$_POST["question_id"]."'
   ";

   $result = $exam->query_result();

   foreach($result as $row)
   {
    $output['question_title'] = html_entity_decode($row['question_title']);

    $output['answer_option'] = $row['answer_option'];

    for($count = 1; $count <= 4; $count++)
    {
     $exam->query = "
     SELECT option_title FROM option_table 
     WHERE question_id = '".$_POST["question_id"]."' 
     AND option_number = '".$count."'
     ";

     $sub_result = $exam->query_result();

     foreach($sub_result as $sub_row)
     {
      $output["option_title_" . $count] = html_entity_decode($sub_row["option_title"]);
     }
    }
   }

   echo json_encode($output);
  }

  if($_POST['action'] == 'Edit')
  {
   $exam->data = array(
    ':question_title'  => $_POST['question_title'],
    ':answer_option'  => $_POST['answer_option'],
    ':question_id'   => $_POST['question_id']
   );

   $exam->query = "
   UPDATE question_table 
   SET question_title = :question_title, answer_option = :answer_option 
   WHERE question_id = :question_id
   ";

   $exam->execute_query();

   for($count = 1; $count <= 4; $count++)
   {
    $exam->data = array(
     ':question_id'  => $_POST['question_id'],
     ':option_number' => $count,
     ':option_title'  => $_POST['option_title_' . $count]
    );

    $exam->query = "
    UPDATE option_table 
    SET option_title = :option_title 
    WHERE question_id = :question_id 
    AND option_number = :option_number
    ";
    $exam->execute_query();
   }

   $output = array(
    'success' => 'Question Edit'
   );

   echo json_encode($output);
  }
  
  if($_POST['action'] == 'delete')
  {
   $exam->data = array(
    ':question_id' => $_POST["question_id"]
   );

   $exam->query = "
   DELETE FROM question_table 
   WHERE question_id = :question_id
   ";

   $exam->execute_query();

   $exam->query = "
   DELETE FROM option_table 
   WHERE question_id = :question_id
   ";

   $exam->execute_query();

   $output = array(
    'success'  => 'Question Details has been removed'
   );

   echo json_encode($output);
  }
 }
}

?>


master/login.php


Once Admin has verified his or her email address, then after page will redirect to this Online Examination System login page with success message on web page.

This Online Examination Admin Login page, and for get access into system in the Admin area of Online Examination system. So by using this page Admin can get access into this system. Admin login details will be validate here by using Ajax request.

<?php

//login.php

include('Examination.php');

$exam = new Examination;

$exam->admin_session_public();

?>

<!DOCTYPE html>
<html lang="en">
<head>
   <title>Online Examination System in PHP</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
   <script src="https://cdn.jsdelivr.net/gh/guillaumepotier/Parsley.js@2.9.1/dist/parsley.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
   <link rel="stylesheet" href="../style/style.css" />
</head>
<body>
 <div class="jumbotron text-center" style="margin-bottom:0; padding: 1rem 1rem;">
     <img src="logo.png" class="img-fluid" width="300" alt="Online Examination System in PHP" />
 </div>

 <div class="container">
    <div class="row">
      <div class="col-md-3">

      </div>
      <div class="col-md-6" style="margin-top:20px;">
       
       <span id="message">
       <?php
       if(isset($_GET['verified']))
       {
        echo '
        <div class="alert alert-success">
         Your email has been verified, now you can login
        </div>
        ';
       }
       ?>
       </span>
          <div class="card">
            <div class="card-header">Admin Login</div>
            <div class="card-body">
              <form method="post" id="admin_login_form">
                <div class="form-group">
                  <label>Enter Email Address</label>
                  <input type="text" name="admin_email_address" id="admin_email_address" class="form-control" />
                </div>
                <div class="form-group">
                  <label>Enter Password</label>
                  <input type="password" name="admin_password" id="admin_password" class="form-control" />
                </div>
                <div class="form-group">
                  <input type="hidden" name="page" value="login" />
                  <input type="hidden" name="action" value="login" />
                  <input type="submit" name="admin_login" id="admin_login" class="btn btn-info" value="Login" />
                </div>
              </form>
              <div align="center">
                <a href="register.php">Register</a>
              </div>
            </div>
          </div>
         
      </div>
      <div class="col-md-3">

      </div>
    </div>
 </div>

</body>
</html>

<script>

$(document).ready(function(){

 $('#admin_login_form').parsley();

  $('#admin_login_form').on('submit', function(event){
    event.preventDefault();

    $('#admin_email_address').attr('required', 'required');

    $('#admin_email_address').attr('data-parsley-type', 'email');

    $('#admin_password').attr('required', 'required');

    if($('#admin_login_form').parsley().validate())
    {
      $.ajax({
        url:"ajax_action.php",
        method:"POST",
        data:$(this).serialize(),
        dataType:"json",
        beforeSend:function(){
          $('#admin_login').attr('disabled', 'disabled');
          $('#admin_login').val('please wait...');
        },
        success:function(data)
        {
          if(data.success)
          {
            location.href="index.php";
          }
          else
          {
            $('#message').html('<div class="alert alert-danger">'+data.error+'</div>');
          }
          $('#admin_login').attr('disabled', false);
          $('#admin_login').val('Login');
        }
      });
    }

  });

});

</script>


master/header.php


This is the header file of Online Examination System Admin area, and in this file first we have include Examination class file and then after for check Admin has login into system or not. We have called admin_session_private() method.

In this file we have make navbar by using Bootstrap 4 library. In navbar we have add link for go to Exam section, user section and logout page link.

master/header.php

<?php

//header.php

include('Examination.php');

$exam = new Examination;

$exam->admin_session_private();

?>

<!DOCTYPE html>
<html lang="en">
<head>
   <title>Online Examination System in PHP</title>
   <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>
    <script src="https://cdn.jsdelivr.net/gh/guillaumepotier/Parsley.js@2.9.1/dist/parsley.js"></script>
   <link rel="stylesheet" href="../style/style.css" />
    <link rel="stylesheet" href="../style/bootstrap-datetimepicker.css" />
    <script src="../style/bootstrap-datetimepicker.js"></script>
</head>
<body>
 <div class="jumbotron text-center" style="margin-bottom:0; padding: 1rem 1rem;">
    <img src="logo.png" class="img-fluid" width="300" alt="Online Examination System in PHP" />
 </div>

    <nav class="navbar navbar-expand-sm bg-dark navbar-dark">
        <a class="navbar-brand" href="index.php">Admin Side</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="collapsibleNavbar">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="exam.php">Exam</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="logout.php">Logout</a>
                </li>   
            </ul>
        </div>  
    </nav>

 <div class="container-fluid">


master/index.php



<?php

//index.php

include('header.php');

include('footer.php');

?>
    
 


master/logout.php


This is logout script for logout from Admin side of Online examination system. This script will destroy all active session variable by using session_destroy() function and after this it will redirect to admin login page.


<?php

//logout.php

session_start();

session_destroy();

header('location:login.php');

?>


master/exam.php


This is main file of Admin Side Exam Module. Admin will perform all operation related to Online Examination.

First in this file we want to load all examination details on web in jQuery Datatable plugin, so Admin can perform searching, sorting, pagining operation with Exam data using jQuery DataTable inbuilt feature. For load data into jQuery dataTable plugin here we have use Ajax request, which send request to PHP script for server-side processing.

For Add or Insert or Schedule new Online Exam, here we have use Bootstrap 4 modal for fill create new exam data into this Online Examination. So, Admin can feel like he has working on single page application, because Insert data operation will be done on web page without refresh of web page.
In this file we will also use Edit or Delete Exam data, we have use Bootstrap 4 Modal class with PHP script using Ajax.
Suppose Admin want to add question into Examination, then that process request will be done under this page by using Ajax.

master/exam.php

<?php

//exam.php

include('header.php');



?>
<br />
<div class="card">
 <div class="card-header">
  <div class="row">
   <div class="col-md-9">
    <h3 class="panel-title">Online Exam List</h3>
   </div>
   <div class="col-md-3" align="right">
    <button type="button" id="add_button" class="btn btn-info btn-sm">Add</button>
   </div>
  </div>
 </div>
 <div class="card-body">
  <span id="message_operation"></span>
  <div class="table-responsive">
   <table id="exam_data_table" class="table table-bordered table-striped table-hover">
    <thead>
     <tr>
      <th>Exam Title</th>
      <th>Date & Time</th>
      <th>Duration</th>
      <th>Total Question</th>
      <th>Right Answer Mark</th>
      <th>Wrong Answer Mark</th>
      <th>Status</th>
      <th>Question</th>
      <th>Action</th>
     </tr>
    </thead>
   </table>
  </div>
 </div>
</div>

<div class="modal" id="formModal">
   <div class="modal-dialog modal-lg">
     <form method="post" id="exam_form">
        <div class="modal-content">
         <!-- Modal Header -->
          <div class="modal-header">
             <h4 class="modal-title" id="modal_title"></h4>
             <button type="button" class="close" data-dismiss="modal">&times;</button>
          </div>

          <!-- Modal body -->
          <div class="modal-body">
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Exam Title <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="online_exam_title" id="online_exam_title" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Exam Date & Time <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="online_exam_datetime" id="online_exam_datetime" class="form-control" readonly />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Exam Duration <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <select name="online_exam_duration" id="online_exam_duration" class="form-control">
                     <option value="">Select</option>
                     <option value="5">5 Minute</option>
                     <option value="30">30 Minute</option>
                     <option value="60">1 Hour</option>
                     <option value="120">2 Hour</option>
                     <option value="180">3 Hour</option>
                    </select>
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Total Question <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <select name="total_question" id="total_question" class="form-control">
                     <option value="">Select</option>
                     <option value="5">5 Question</option>
                     <option value="10">10 Question</option>
                     <option value="25">25 Question</option>
                     <option value="50">50 Question</option>
                     <option value="100">100 Question</option>
                     <option value="200">200 Question</option>
                     <option value="300">300 Question</option>
                    </select>
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Marks for Right Answer <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <select name="marks_per_right_answer" id="marks_per_right_answer" class="form-control">
                     <option value="">Select</option>
                     <option value="1">+1 Mark</option>
                     <option value="2">+2 Mark</option>
                     <option value="3">+3 Mark</option>
                     <option value="4">+4 Mark</option>
                     <option value="5">+5 Mark</option>
                    </select>
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Marks for Wrong Answer <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <select name="marks_per_wrong_answer" id="marks_per_wrong_answer" class="form-control">
                     <option value="">Select</option>
                     <option value="1">-1 Mark</option>
                     <option value="1.25">-1.25 Mark</option>
                     <option value="1.50">-1.50 Mark</option>
                     <option value="2">-2 Mark</option>
                    </select>
                   </div>
               </div>
             </div>
          </div>

          <!-- Modal footer -->
          <div class="modal-footer">
           <input type="hidden" name="online_exam_id" id="online_exam_id" />

           <input type="hidden" name="page" value="exam" />

           <input type="hidden" name="action" id="action" value="Add" />

           <input type="submit" name="button_action" id="button_action" class="btn btn-success btn-sm" value="Add" />

             <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Close</button>
          </div>
         </div>
     </form>
   </div>
</div>

<div class="modal" id="deleteModal">
   <div class="modal-dialog">
     <div class="modal-content">

        <!-- Modal Header -->
        <div class="modal-header">
          <h4 class="modal-title">Delete Confirmation</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>

        <!-- Modal body -->
        <div class="modal-body">
          <h3 align="center">Are you sure you want to remove this?</h3>
        </div>

        <!-- Modal footer -->
        <div class="modal-footer">
         <button type="button" name="ok_button" id="ok_button" class="btn btn-primary btn-sm">OK</button>
          <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Close</button>
        </div>
     </div>
   </div>
</div>

<div class="modal" id="questionModal">
   <div class="modal-dialog modal-lg">
     <form method="post" id="question_form">
        <div class="modal-content">
         <!-- Modal Header -->
          <div class="modal-header">
             <h4 class="modal-title" id="question_modal_title"></h4>
             <button type="button" class="close" data-dismiss="modal">&times;</button>
          </div>

          <!-- Modal body -->
          <div class="modal-body">
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Question Title <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="question_title" id="question_title" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 1 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_1" id="option_title_1" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 2 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_2" id="option_title_2" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 3 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_3" id="option_title_3" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 4 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_4" id="option_title_4" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Answer <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <select name="answer_option" id="answer_option" class="form-control">
                     <option value="">Select</option>
                     <option value="1">1 Option</option>
                     <option value="2">2 Option</option>
                     <option value="3">3 Option</option>
                     <option value="4">4 Option</option>
                    </select>
                   </div>
               </div>
             </div>
          </div>

          <!-- Modal footer -->
          <div class="modal-footer">
           <input type="hidden" name="question_id" id="question_id" />

           <input type="hidden" name="online_exam_id" id="hidden_online_exam_id" />

           <input type="hidden" name="page" value="question" />

           <input type="hidden" name="action" id="hidden_action" value="Add" />

           <input type="submit" name="question_button_action" id="question_button_action" class="btn btn-success btn-sm" value="Add" />

             <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Close</button>
          </div>
         </div>
     </form>
   </div>
</div>

<script>

$(document).ready(function(){
 
 var dataTable = $('#exam_data_table').DataTable({
  "processing" : true,
  "serverSide" : true,
  "order" : [],
  "ajax" : {
   url: "ajax_action.php",
   method:"POST",
   data:{action:'fetch', page:'exam'}
  },
  "columnDefs":[
   {
    "targets":[7, 8],
    "orderable":false,
   },
  ],
 });

 function reset_form()
 {
  $('#modal_title').text('Add Exam Details');
  $('#button_action').val('Add');
  $('#action').val('Add');
  $('#exam_form')[0].reset();
  $('#exam_form').parsley().reset();
 }

 $('#add_button').click(function(){
  reset_form();
  $('#formModal').modal('show');
  $('#message_operation').html('');
 });

 var date = new Date();

 date.setDate(date.getDate());

 $('#online_exam_datetime').datetimepicker({
  startDate :date,
  format: 'yyyy-mm-dd hh:ii',
  autoclose:true
 });

 $('#exam_form').parsley();

 $('#exam_form').on('submit', function(event){
  event.preventDefault();

  $('#online_exam_title').attr('required', 'required');

  $('#online_exam_datetime').attr('required', 'required');

  $('#online_exam_duration').attr('required', 'required');

  $('#total_question').attr('required', 'required');

  $('#marks_per_right_answer').attr('required', 'required');

  $('#marks_per_wrong_answer').attr('required', 'required');

  if($('#exam_form').parsley().validate())
  {
   $.ajax({
    url:"ajax_action.php",
    method:"POST",
    data:$(this).serialize(),
    dataType:"json",
    beforeSend:function(){
     $('#button_action').attr('disabled', 'disabled');
     $('#button_action').val('Validate...');
    },
    success:function(data)
    {
     if(data.success)
     {
      $('#message_operation').html('<div class="alert alert-success">'+data.success+'</div>');

      reset_form();

      dataTable.ajax.reload();

      $('#formModal').modal('hide');
     }

     $('#button_action').attr('disabled', false);

     $('#button_action').val($('#action').val());
    }
   });
  }
 });

 var exam_id = '';

 $(document).on('click', '.edit', function(){
  exam_id = $(this).attr('id');

  reset_form();

  $.ajax({
   url:"ajax_action.php",
   method:"POST",
   data:{action:'edit_fetch', exam_id:exam_id, page:'exam'},
   dataType:"json",
   success:function(data)
   {
    $('#online_exam_title').val(data.online_exam_title);

    $('#online_exam_datetime').val(data.online_exam_datetime);

    $('#online_exam_duration').val(data.online_exam_duration);

    $('#total_question').val(data.total_question);

    $('#marks_per_right_answer').val(data.marks_per_right_answer);

    $('#marks_per_wrong_answer').val(data.marks_per_wrong_answer);

    $('#online_exam_id').val(exam_id);

    $('#modal_title').text('Edit Exam Details');

    $('#button_action').val('Edit');

    $('#action').val('Edit');

    $('#formModal').modal('show');
   }
  })
 });

 $(document).on('click', '.delete', function(){
  exam_id = $(this).attr('id');
  $('#deleteModal').modal('show');
 });

 $('#ok_button').click(function(){
  $.ajax({
   url:"ajax_action.php",
   method:"POST",
   data:{exam_id:exam_id, action:'delete', page:'exam'},
   dataType:"json",
   success:function(data)
   {
    $('#message_operation').html('<div class="alert alert-success">'+data.success+'</div>');
    $('#deleteModal').modal('hide');
    dataTable.ajax.reload();
   }
  })
 });

 function reset_question_form()
 {
  $('#question_modal_title').text('Add Question');
  $('#question_button_action').val('Add');
  $('#hidden_action').val('Add');
  $('#question_form')[0].reset();
  $('#question_form').parsley().reset();
 }

 $(document).on('click', '.add_question', function(){
  reset_question_form();
  $('#questionModal').modal('show');
  $('#message_operation').html('');
  exam_id = $(this).attr('id');
  $('#hidden_online_exam_id').val(exam_id);
 });

 $('#question_form').parsley();

 $('#question_form').on('submit', function(event){
  event.preventDefault();

  $('#question_title').attr('required', 'required');

  $('#option_title_1').attr('required', 'required');

  $('#option_title_2').attr('required', 'required');

  $('#option_title_3').attr('required', 'required');

  $('#option_title_4').attr('required', 'required');

  $('#answer_option').attr('required', 'required');

  if($('#question_form').parsley().validate())
  {
   $.ajax({
    url:"ajax_action.php",
    method:"POST",
    data:$(this).serialize(),
    dataType:"json",
    beforeSend:function(){
     $('#question_button_action').attr('disabled', 'disabled');

     $('#question_button_action').val('Validate...');
    },
    success:function(data)
    {
     if(data.success)
     {
      $('#message_operation').html('<div class="alert alert-success">'+data.success+'</div>');

      reset_question_form();
      dataTable.ajax.reload();
      $('#questionModal').modal('hide');
     }

     $('#question_button_action').attr('disabled', false);

     $('#question_button_action').val($('#hidden_action').val());
    }
   });
  }
 });

});

</script>

<?php

include('footer.php');

?>


master/question.php


This is main page of Admin side Question module of this Online Examination System. Here you can find Question related CRUD like Read Question Details, Edit question details and delete or remove question details.



<?php

//question.php

include('header.php');

?>
<br />
<nav aria-label="breadcrumb">
   <ol class="breadcrumb">
     <li class="breadcrumb-item"><a href="exam.php">Exam List</a></li>
     <li class="breadcrumb-item active" aria-current="page">Question List</li>
   </ol>
</nav>
<div class="card">
 <div class="card-header">
  <div class="row">
   <div class="col-md-9">
    <h3 class="panel-title">Question List</h3>
   </div>
   <div class="col-md-3" align="right">
    
   </div>
  </div>
 </div>
 <div class="card-body">
  <span id="message_operation"></span>
  <div class="table-responsive">
   <table class="table table-bordered table-striped table-hover" id="question_data_table">
    <thead>
     <tr>
      <th>Question Title</th>
      <th>Right Option</th>
      <th>Action</th>
     </tr>
    </thead>
   </table>
  </div>
 </div>
</div>

<div class="modal" id="deleteModal">
   <div class="modal-dialog">
     <div class="modal-content">

        <!-- Modal Header -->
        <div class="modal-header">
          <h4 class="modal-title">Delete Confirmation</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>

        <!-- Modal body -->
        <div class="modal-body">
          <h3 align="center">Are you sure you want to remove this?</h3>
        </div>

        <!-- Modal footer -->
        <div class="modal-footer">
          <button type="button" name="ok_button" id="ok_button" class="btn btn-primary btn-sm">OK</button>
          <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Close</button>
        </div>
     </div>
   </div>
</div>

<div class="modal" id="questionModal">
   <div class="modal-dialog modal-lg">
     <form method="post" id="question_form">
        <div class="modal-content">
         <!-- Modal Header -->
          <div class="modal-header">
             <h4 class="modal-title" id="question_modal_title"></h4>
             <button type="button" class="close" data-dismiss="modal">&times;</button>
          </div>

          <!-- Modal body -->
          <div class="modal-body">
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Question Title <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="question_title" id="question_title" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 1 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_1" id="option_title_1" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 2 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_2" id="option_title_2" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 3 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_3" id="option_title_3" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Option 4 <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <input type="text" name="option_title_4" id="option_title_4" autocomplete="off" class="form-control" />
                   </div>
               </div>
             </div>
             <div class="form-group">
               <div class="row">
                  <label class="col-md-4 text-right">Answer <span class="text-danger">*</span></label>
                  <div class="col-md-8">
                    <select name="answer_option" id="answer_option" class="form-control">
                     <option value="">Select</option>
                     <option value="1">1 Option</option>
                     <option value="2">2 Option</option>
                     <option value="3">3 Option</option>
                     <option value="4">4 Option</option>
                    </select>
                   </div>
               </div>
             </div>
          </div>

          <!-- Modal footer -->
          <div class="modal-footer">
           <input type="hidden" name="question_id" id="question_id" />
             <input type="hidden" name="page" value="question" />
             <input type="hidden" name="action" id="hidden_action" value="Edit" />
             <input type="submit" name="question_button_action" id="question_button_action" class="btn btn-success btn-sm" value="Edit" />
             <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Close</button>
          </div>
         </div>
     </form>
   </div>
</div>

<script>

$(document).ready(function(){
 var code = "<?php echo $_GET['code']; ?>";
 var dataTable = $('#question_data_table').DataTable({
  "processing" : true,
  "serverSide" : true,
  "order" : [],
  "ajax" : {
   url:"ajax_action.php",
   type:"POST",
   data:{action:'fetch', page:'question', code:code}
  },
  "columnDefs":[
   {
    "targets":[2],
    "orderable":false,
   },
  ],
 });

 

 $('#question_form').parsley();

 $('#question_form').on('submit', function(event){
  
  event.preventDefault();

  $('#question_title').attr('required', 'required');

  $('#option_title_1').attr('required', 'required');

  $('#option_title_2').attr('required', 'required');

  $('#option_title_3').attr('required', 'required');

  $('#option_title_4').attr('required', 'required');

  $('#answer_option').attr('required', 'required');

  if($('#question_form').parsley().validate())
  {
   
   $.ajax({
         url:"ajax_action.php",
         method:"POST",
         data:$(this).serialize(),
         dataType:"json",
         beforeSend:function()
         {
           $('#question_button_action').attr('disabled', 'disabled');
           $('#question_button_action').val('Validate...');
         },
         success:function(data){
           $('#question_button_action').attr('disabled', false);
           $('#question_button_action').val($('#action').val());
           if(data.success)
           {
              $('#message_operation').html('<div class="alert alert-success">'+data.success+'</div>');
              reset_question_form();
              dataTable.ajax.reload();
              $('#questionModal').modal('hide');
             }
          }
      });
  }
 });

 function reset_question_form()
 {     
  $('#question_button_action').val('Edit');
     $('#question_form')[0].reset();
     $('#question_form').parsley().reset();
 }

 var question_id = '';

 $(document).on('click', '.edit', function(){
  question_id = $(this).attr('id');
     reset_question_form();
     $.ajax({
        url:"ajax_action.php",
        method:"POST",
        data:{action:'edit_fetch', question_id:question_id, page:'question'},
        dataType:"json",
        success:function(data)
        {
          $('#question_title').val(data.question_title);
          $('#option_title_1').val(data.option_title_1);
          $('#option_title_2').val(data.option_title_2);
          $('#option_title_3').val(data.option_title_3);
          $('#option_title_4').val(data.option_title_4);
          $('#answer_option').val(data.answer_option);
          $('#question_id').val(question_id);
          $('#modal_title').text("Edit Question Details");
          $('#questionModal').modal('show');
        }
     });
 });

 $(document).on('click', '.delete', function(){
  question_id = $(this).attr('id');
     $('#deleteModal').modal('show');
 });

 $('#ok_button').click(function(){
     $.ajax({
       url:"ajax_action.php",
        method:"POST",
        data:{question_id:question_id, action:'delete', page:'question'},
        dataType:'json',
        success:function(data)
        {
          $('#message_operation').html('<div class="alert alert-success">'+data.success+'</div>');
          $('#deleteModal').modal('hide');
          dataTable.ajax.reload();
        }
     });
 });

});

</script>

<?php

include('footer.php');

?>


header.php


This is header file of User side of this Online Examination System. In this file, we have define required library into which we will used for build this system. In this file we have also make menu like for go to enroll exam page, profile page, change password page and logout from system link.



<!DOCTYPE html>
<html lang="en">
<head>
   <title>Online Examination System in PHP</title>
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap4.min.css">
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
   <script src="https://cdn.jsdelivr.net/gh/guillaumepotier/Parsley.js@2.9.1/dist/parsley.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>
   <link rel="stylesheet" href="style/style.css" />
    <link rel="stylesheet" href="style/TimeCircles.css" />
    <script src="style/TimeCircles.js"></script>
</head>
<body>
 <div class="jumbotron text-center" style="margin-bottom:0; padding: 1rem 1rem;">
    <img src="master/logo.png" class="img-fluid" width="300" alt="Online Examination System in PHP" />
  </div>

    <?php
    if(isset($_SESSION['user_id']))
    {
    ?>
    <nav class="navbar navbar-expand-sm bg-dark navbar-dark">
        <a class="navbar-brand" href="index.php">User Side</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="collapsibleNavbar">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="enroll_exam.php">Enroll Exam</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="profile.php">Profile</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="change_password.php">Change Pasword</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="logout.php">Logout</a>
                </li>    
            </ul>
        </div>  
    </nav>

    <div class="container-fluid">
    <?php
    }
    ?>


register.php


This is user registration file. In this file we have make user registration form. In this file first we have check user has register with unique email address or not by using parsley custom validator, and other form data has also been validate by parsley validation library. Registration form data has been send by using Ajax request.



<?php

//register.php

include('master/Examination.php');

$exam = new Examination;

$exam->user_session_public();

include('header.php');

?>

 <div class="containter">
  <div class="d-flex justify-content-center">
   <br /><br />
   <div class="card" style="margin-top:50px;margin-bottom: 100px;">
          <div class="card-header"><h4>User Registration</h4></div>
          <div class="card-body">
           <span id="message"></span>
           <form method="post" id="user_register_form">
               <div class="form-group">
                <label>Enter Email Address</label>
                  <input type="text" name="user_email_address" id="user_email_address" class="form-control" data-parsley-checkemail data-parsley-checkemail-message='Email Address already Exists' />
               </div>
         <div class="form-group">
             <label>Enter Password</label>
             <input type="password" name="user_password" id="user_password" class="form-control" />
         </div>
         <div class="form-group">
             <label>Enter Confirm Password</label>
             <input type="password" name="confirm_user_password" id="confirm_user_password" class="form-control" />
         </div>
         <div class="form-group">
             <label>Enter Name</label>
             <input type="text" name="user_name" id="user_name" class="form-control" />
         </div>
         <div class="form-group">
             <label>Select Gender</label>
             <select name="user_gender" id="user_gender" class="form-control">
                <option value="Male">Male</option>
                <option value="Female">Female</option>
             </select>
         </div>
         <div class="form-group">
             <label>Enter Address</label>
             <textarea name="user_address" id="user_address" class="form-control"></textarea>
         </div>
         <div class="form-group">
             <label>Enter Mobile Number</label>
             <input type="text" name="user_mobile_no" id="user_mobile_no" class="form-control" />
         </div>
         <div class="form-group">
             <label>Select Profile Image</label>
             <input type="file" name="user_image" id="user_image" />
         </div>
         <br />
         <div class="form-group" align="center">
             <input type="hidden" name="page" value="register" />
             <input type="hidden" name="action" value="register" />
             <input type="submit" name="user_register" id="user_register" class="btn btn-info" value="Register" />
         </div>
             </form>
             <div align="center">
              <a href="login.php">Login</a>
             </div>
          </div>
        </div>
        <br /><br />
        <br /><br />
  </div>
 </div>

</body>

</html>

<script>

$(document).ready(function(){

 window.ParsleyValidator.addValidator('checkemail', {
  validateString: function(value)
       {
         return $.ajax({
            url:'user_ajax_action.php',
            method:"POST",
            data:{page:'register', action:'check_email', email:value},
            dataType:"json",
            async: false,
            success:function(data)
            {
              return true;
            }
         });
       }
    });

 $('#user_register_form').parsley();
 
 $('#user_register_form').on('submit', function(event){
  event.preventDefault();

  $('#user_email_address').attr('required', 'required');

  $('#user_email_address').attr('data-parsley-type', 'email');

  $('#user_password').attr('required', 'required');

  $('#confirm_user_password').attr('required', 'required');

  $('#confirm_user_password').attr('data-parsley-equalto', '#user_password');

  $('#user_name').attr('required', 'required');

  $('#user_name').attr('data-parsley-pattern', '^[a-zA-Z ]+$');

  $('#user_address').attr('required', 'required');

  $('#user_mobile_no').attr('required', 'required');

  $('#user_mobile_no').attr('data-parsley-pattern', '^[0-9]+$');

  $('#user_image').attr('required', 'required');

  $('#user_image').attr('accept', 'image/*');

  if($('#user_register_form').parsley().validate())
  {
   $.ajax({
    url:"user_ajax_action.php",
    method:"POST",
    data: new FormData(this),
    dataType:"json",
    contentType: false,
    cache: false,
    processData:false,    
    beforeSend:function()
    {
     $('#user_register').attr('disabled', 'disabled');
     $('#user_register').val('please wait...');
    },
    success:function(data)
    {
     if(data.success)
     {
      $('#message').html('<div class="alert alert-success">Please check your email</div>');
      $('#user_register_form')[0].reset();
      $('#user_register_form').parsley().reset();
     }
     else
     {
      $('#message').html('<div class="alert alert-danger">'+data.error+'</div>');
     }
     $('#user_register').attr('disabled', false);
     $('#user_register').val('Register');
    }
   });
  }
 });
});

</script>


user_ajax_action.php


This file will received all ajax request at the user side of this Online Examination system. In this file we have include Examination class and php mailer class library for send registration email.



<?php

//user_ajax_action.php

include('master/Examination.php');

require_once('class/class.phpmailer.php');

$exam = new Examination;

$current_datetime = date("Y-m-d") . ' ' . date("H:i:s", STRTOTIME(date('h:i:sa')));

if(isset($_POST['page']))
{
 if($_POST['page'] == 'register')
 {
  if($_POST['action'] == 'check_email')
  {
   $exam->query = "
   SELECT * FROM user_table 
   WHERE user_email_address = '".trim($_POST["email"])."'
   ";

   $total_row = $exam->total_row();

   if($total_row == 0)
   {
    $output = array(
     'success'  => true
    );
    echo json_encode($output);
   }
  }

  if($_POST['action'] == 'register')
  {
   $user_verfication_code = md5(rand());

   $receiver_email = $_POST['user_email_address'];

   $exam->filedata = $_FILES['user_image'];

   $user_image = $exam->Upload_file();

   $exam->data = array(
    ':user_email_address' => $receiver_email,
    ':user_password'  => password_hash($_POST['user_password'], PASSWORD_DEFAULT),
    ':user_verfication_code'=> $user_verfication_code,
    ':user_name'   => $_POST['user_name'],
    ':user_gender'   => $_POST['user_gender'],
    ':user_address'   => $_POST['user_address'],
    ':user_mobile_no'  => $_POST['user_mobile_no'],
    ':user_image'   => $user_image,
    ':user_created_on'  => $current_datetime
   );

   $exam->query = "
   INSERT INTO user_table 
   (user_email_address, user_password, user_verfication_code, user_name, user_gender, user_address, user_mobile_no, user_image, user_created_on)
   VALUES 
   (:user_email_address, :user_password, :user_verfication_code, :user_name, :user_gender, :user_address, :user_mobile_no, :user_image, :user_created_on)
   ";

   $exam->execute_query();

   $subject= 'Online Examination Registration Verification';

   $body = '
   <p>Thank you for registering.</p>
   <p>This is a verification eMail, please click the link to verify your eMail address by clicking this <a href="'.$exam->home_page.'verify_email.php?type=user&code='.$user_verfication_code.'" target="_blank"><b>link</b></a>.</p>
   <p>In case if you have any difficulty please eMail us.</p>
   <p>Thank you,</p>
   <p>Online Examination System</p>
   ';

   $exam->send_email($receiver_email, $subject, $body);

   $output = array(
    'success'  => true
   );

   echo json_encode($output);
  }
 }

 if($_POST['page'] == 'login')
 {
  if($_POST['action'] == 'login')
  {
   $exam->data = array(
    ':user_email_address' => $_POST['user_email_address']
   );

   $exam->query = "
   SELECT * FROM user_table 
   WHERE user_email_address = :user_email_address
   ";

   $total_row = $exam->total_row();

   if($total_row > 0)
   {
    $result = $exam->query_result();

    foreach($result as $row)
    {
     if($row['user_email_verified'] == 'yes')
     {
      if(password_verify($_POST['user_password'], $row['user_password']))
      {
       $_SESSION['user_id'] = $row['user_id'];

       $output = array(
        'success' => true
       );
      }
      else
      {
       $output = array(
        'error'  => 'Wrong Password'
       );
      }
     }
     else
     {
      $output = array(
       'error'  => 'Your Email is not verify'
      );
     }
    }
   }
   else
   {
    $output = array(
     'error'  => 'Wrong Email Address'
    );
   }

   echo json_encode($output);
  }
 }
}

?>


verify_email.php


This PHP file mainly, we use for validate admin email address and user email address which they have enter at the time of registration. In this file we have include Examination class for perform different operation.

This file will received $_GET['type'] and $_GET['code'] veriable, in $_GET['type'] veriable we can define admin or user, and in $_GET['code'], it will password email verification code. Based on the value of this both variable, it will verify email address.

verify_email.php

<?php

//verify_email.php

include('master/Examination.php');

$exam = new Examination;

if(isset($_GET['type'], $_GET['code']))
{
 if($_GET['type'] == 'master')
 {
  $exam->data = array(
   ':email_verified'  => 'yes'
  );

  $exam->query = "
  UPDATE admin_table 
  SET email_verified = :email_verified 
  WHERE admin_verfication_code = '".$_GET['code']."'
  ";

  $exam->execute_query();

  $exam->redirect('master/login.php?verified=success');
 }

 if($_GET['type'] == 'user')
 {
  $exam->data = array(
   ':user_email_verified' => 'yes'
  );

  $exam->query = "
  UPDATE user_table 
  SET user_email_verified = :user_email_verified 
  WHERE user_verfication_code = '".$_GET['code']."'
  ";

  $exam->execute_query();

  $exam->redirect('login.php?verified=success');
 }
}


?>


login.php


This user login form, and here user can login into online exam system who want to take part in this online examination. Once User have been verified his or here email address then they can login into system by enter email address and password which they has set at the time on registeration.


login.php

<?php

//login.php

include('master/Examination.php');

$exam = new Examination;

$exam->user_session_public();

include('header.php');

?>
 <div class="container">

    <div class="row">
      <div class="col-md-3">

      </div>
      <div class="col-md-6" style="margin-top:100px;">
       

         <span id="message">
            <?php
            if(isset($_GET['verified']))
            {
              echo '
              <div class="alert alert-success">
                Your email has been verified, now you can login
              </div>
              ';
            }
            ?>   
            </span>
         <div class="card">
           <div class="card-header">User Login</div>
           <div class="card-body">
             <form method="post" id="user_login_form">
                  <div class="form-group">
                    <label>Enter Email Address</label>
                      <input type="text" name="user_email_address" id="user_email_address" class="form-control" />
                    </div>
                  <div class="form-group">
                    <label>Enter Password</label>
                    <input type="password" name="user_password" id="user_password" class="form-control" />
                  </div>
                  <div class="form-group">
                    <input type="hidden" name="page" value="login" />
                    <input type="hidden" name="action" value="login" />
                    <input type="submit" name="user_login" id="user_login" class="btn btn-info" value="Login" />
                  </div>
                </form>
                <div align="center">
                  <a href="register.php">Register</a>
                </div>
           </div>
         </div>
      </div>
      <div class="col-md-3">

      </div>
    </div>
 </div>

</body>
</html>

<script>

$(document).ready(function(){

 $('#user_login_form').parsley();

  $('#user_login_form').on('submit', function(event){
    event.preventDefault();

    $('#user_email_address').attr('required', 'required');

    $('#user_email_address').attr('data-parsley-type', 'email');

    $('#user_password').attr('required', 'required');

    if($('#user_login_form').parsley().validate())
    {
      $.ajax({
        url:"user_ajax_action.php",
        method:"POST",
        data:$(this).serialize(),
        dataType:"json",
        beforeSend:function()
        {
          $('#user_login').attr('disabled', 'disabled');
          $('#user_login').val('please wait...');
        },
        success:function(data)
        {
          if(data.success)
          {
            location.href='index.php';
          }
          else
          {
            $('#message').html('<div class="alert alert-danger">'+data.error+'</div>');
          }

          $('#user_login').attr('disabled', false);

          $('#user_login').val('Login');
        }
      })
    }

  });

});

</script>


logout.php


This script will destroy all session variable, and redirect user to login page.



<?php

//logout.php

session_start();

session_destroy();

header('location:login.php');

?>


Online Examination System has been build by using PHP script with Mysql database, jQuery, Ajax and Bootstrap 4 library. Source of Online Examination system in PHP will be added very soon.









Online Examination System in PHP Video Tutorial


Below you can find video tutorial of PHP Mysql Online Exam System which we have publish. So, If you have miss any tutorial, you can check here.

  1. Introduction - Online Examination System in PHP
  2. Check Unique Admin Email Address - Online Examination System in PHP
  3. Admin Registration - Online Examination System in PHP
  4. Verify Admin Email Address - Online Examination System in PHP
  5. Admin Login Form - Online Examination System in PHP
  6. Display all Exam - Online Examination System in PHP
  7. Schedule New Exam - Online Examination System in PHP
  8. Edit Schedule Exam Details - Online Examination System in PHP
  9. Remove Schedule Exam Details - Online Examination System in PHP
  10. Make Question Form - Online Examination System in PHP
  11. Add Question in Exam - Online Examination System in PHP
  12. Display All Question - Online Examination System in PHP
  13. Edit Question Details - Online Examination System in PHP
  14. Delete Question - Online Examination System in PHP
  15. Check User Unique Email ID - Online Examination System in PHP
  16. User Registration - Online Examination System in PHP
  17. User Email address Verification - Online Examination System in PHP
  18. User Login - Online Examination System in PHP
  19. User Profile - Online Examination System in PHP
  20. User Change Password - Online Examination System in PHP
  21. List User Enroll Exam - Online Examination System in PHP
  22. List User List at Master Side - Online Examination System in PHP
  23. View User Details in Modal - Online Examination System in PHP
  24. Admin Side Exam Enroll User list - Online Examination System in PHP
  25. List Question on Starting of Exam - Online Examination System in PHP
  26. Exam Result on Web Page User Side - Online Examination System in PHP
  27. Exam Result in PDF Format - User Side - Online Examination System in PHP
  28. Master Side - Generate Single User Exam Result - Online Examination System in PHP
  29. Admin Side - Generate All User Exam Result - Online Examination System in PHP
  30. Admin Side - Generate All User Exam Result in PDF Format - Online Examination System in PHP




0 comments:

Post a Comment