You are on page 1of 52

CHAPTER 1

INTRODUCTION
Online MCQS preparation system is one stop blog to collect, compile and present
as many multiple-choice questions so that Users can practice and test their knowledge
on any given topic. We try to cover as much aspects of every topic making it a
complete platform for the users to prepare their competitive exams. The
multiple-choice questions are presented in a simple format. Most of the MCQS in
Online MCQS preparation System are collected from the recent Tests. Users are
welcome to contribute the multiple-choice questions to Online MCQS preparation
system and help us make the site more effective and useful.

As the name specifies Online MCQS preparation is a portal developed for


students to check their abilities and also prepare for their exams and multiple tests. We
offer various subjects according to demand of the user and with that users can also
contribute in the website by submitting their own MCQS and the admin can choose
which question to keep and which to deny, through this method website will grow
more and more and will be more beneficial to other users in future.

Identification of the drawbacks of the existing system leads to the designing of


computerized system that will be compatible to the existing system with the system
Which is more user friendly and more GUI oriented. We can improve the efficiency of
the system, thus overcome the drawbacks of the existing system.

• Less human error


• Improved satisfactory allotments
• Better management of testing system
• Data redundancy can be avoided to some extent
• Data consistency
• Easy to handle
• Easy data updating
• Easy record keeping

1
1.1 Problem Statement

The main problem is that there was manual system for record keeping of different
test and also users have to take admission in different academies and other institutes to
study and spend a lot of extra money instead of studying online and saving time and
money.

1.2 Objectives

The main objective of Website is to provide user with different tests and with the
correct answers of the tests so user can take the test and also prepare for the test while
staying offline, moreover user should also be able to contribute in the website if he/she
wants to by submitting MCQS which they found useful and the admin should be able
to choose what to keep and what to disapprove.

1.3 Existing System

In the existing system everything is manual including the tests and results and
users also have to bear the cost of different institutions to take those tests and wait for
the results.

1.4 Purpose

The purpose is to provide students with a facility by which they can register their
selves to website and also, they should be able to take online tests of different subjects
for their exams preparation and with that they should be able to contribute in the
website.

1.5 Proposed system

This project is aimed at developing a system for keeping records of different


subjects and their tests. This system will help the students to learn in a good manner.
Students can take the tests online through this system and also user can submit their
own MCQS and the admin can choose from them and with that user is able to make its
own test according to its need. This system will be developed based on Software
Development Life Cycle (SDLC) with PHP, JAVA and My SQL server.

2
1.6 Scope

The scope of this website is that it will be a best way for the users to learn by
taking the online tests and also contribute in the website by submitting their own
MCQS as a suggestion and admin can choose what to keep and what not to keep for the
website.

1.7 Modules

There are three sub modules in this phase that are different with respect to their
functionalities.

The functionality of each module is as follows:

1. Administrator Module
2. Visitor Module
3. Registered User Module

1.7.1 Administrator Module

The administrator will login with user name and password. After login he can do
the entire task given below, can manage the whole college website like,

• Can view the total Registered User through database.


• Can delete a User through database.
• Can add the MCQS.
• Can Edit and Delete the MCQS.
• Can View the total MCQS.
• Can add new subjects.
• Can also add or delete all the information about the system.

3
1.7.2 Visitors Module

The visitor will only get information given below,

• Can take the tests.


• Can submit MCQS.
• Can see test results.

1.7.3 Registered User Module

The User will firstly get registered if not registered then login with user name and
Password. After the login he can do these tasks given below,

• Can submit MCQS.


• Can view the approved and pending submitted MCQS.

1.8 Supplementary Requirements

• The users of the system should be provided user id and password along with the
well-defined access privileges.
• 24X7 internet connectivity should be provided for well-functioning of the
system.
• Systems should be provided with proper backup media and resources to handle
system crash scenarios.

1.9 Usability

In the designing of Website, it is taken care of that it can be easy to use no more
complex abilities.

1.10 Reliability

Software Reliability is the probability of failure-free software operation for a


specified period of time in a specified environment. So, it is also taken care while
making Website with Cost Estimation that it should be reliable that’s why it is
developed in most advanced language PHP.

4
1.11 Supportability

Supportability is also very important factor that a system which can design it can
be supportable in most of environment. Dress Artify with Cost Estimation is a website
which has not too much supportably issues because it can run on simple browser.

1.12 System Requirement

• Server Side
o Operating System: Windows 7, Windows XP, Windows 8.1 or
Windows 10
o Processor: Pentium 2.0 GHz or higher
o RAM: 1GB or more
• Client side
o Operating System: Windows 7, Windows XP, Windows 8.1 or
Windows 10
o Processor: Pentium 2.0 GHz or higher
o RAM 1GB or more
• Software Interfaces
o Client Side: HTML 5, Web Browser (Microsoft Edge, Firefox,
Chrome, Opera) Windows XP/2000/Windows 7, Windows 8,
Windows 10
o Web Server: Internet Information Services (IIS)

5
CHAPTER 2

LITERATURE REVIEW
Learning management systems and student information systems have been in use
for years in a number of universities across America. However, their use is not as
widespread in universities in India. The main reasons have been the lack of
high-speed Internet availability, reluctance from universities to try new software, and
the high cost of commercial products (which are not differently priced for the Indian
market). In recent years, Internet penetration has significantly improved and a
number of universities even have direct connections to the internet backbone. Social
media use has become very widespread, and students and teachers are familiar and
comfortable with a number of web-based applications. The goal of this project is to
develop a prototype for a low-cost web-based application that provides features of
both learning management systems and student information systems, and is
customized to the needs of universities in India (Kannan & Bansal., 2013)

Introductory accounting classes are predominately composed of freshman and


sophomore nonaccounting majors, who may not be as motivated as upper-level
accounting majors. As a result, instructors of introductory accounting courses are
challenged in finding effective strategies to motivate these students to: (1) prepare for
class, (2) arrive to class on time, and (3) participate in meaningful class discussions
and activities. To address these issues, we give a short daily quiz at the beginning of
each class. The quiz consists of three easy-to-grade conceptual questions that
students should be able to answer, provided that they have read the assigned textbook
pages. Empirical evidence suggests that the daily quiz has the desired motivational
effect on student behavior with respect to preparation, punctual attendance, and
participation. In addition, lower failure rates occurred in semesters that incorporated a
daily quiz. Finally, use of the daily quiz had no adverse effect on course and
instructor evaluations (Barun., et al 2012)

6
This article deals with the integrated use of online quizzes as a teaching and
assessment tool in the general program of the subject Proyectos in the third course of
Ingeniero Técnico en Informática de Gestión over five consecutive years. The research
undertaken aimed to test quizzes effectiveness on student performance when used, not
only as an isolated assessment tool, but also when integrated into a combined strategy,
which support the overall programming of the subject. The results obtained during the
five years of experimentation using online quizzes shows that such quizzes have a
proven positive influence on students' academic performance. Furthermore, surveys
conducted at the end of each course revealed the high value students accord to use of
online quizzes in course instruction (Salas-Morera., et al 2012)

Review quizzes can provide students with feedback and assist in the preparation
for in-class tests, but students often do not voluntarily use self-testing resources. The
purpose of the present study was to evaluate if taking a mandatory online review quiz
alters performance on subsequent in-class tests. During two semesters of a
single-semester introductory anatomy and physiology course, students were required
to complete brief online quizzes after each textbook chapter had been covered during
lecture as well as the day before an in-class test. During the next two semesters,
students were not required to take the online review quizzes. Overall scores on chapter
specific in-class tests were higher (P < 0.05) during the semesters in which students
took online review quizzes (82.9 ± 14.3%) compared with when they did not (78.7 ±
15.5%), but all in-class tests were not improved. Scores on comprehensive midterm
examinations were higher (83.0 ± 12.9% vs. 78.9 ± 13.7%, P < 0.05) but not on final
examinations (72.4 ± 13.8% vs. 71.8 ± 14.0%) between those with online review
quizzes and those without, respectively. Overall scores on in-class tests and
comprehensive examinations were higher (P < 0.05) during the semesters in which
students took online review quizzes (83.4 ± 16.8%) compared with when they did not
(80.3 ± 17.6%). These data suggest that an online review quiz taken the day before an
in-class test increases performance on some in-class tests. However, online review
quizzes taken after completion of each chapter do not consistently enhance
performance on comprehensive examinations (Brown., et al 2015)

7
CHAPTER 3

METHODOLOGY
3.1 Introduction

The term methodology implies the strategies and systems received by leading an
exploration think about. It diagrams how the information will be gathered, and the
apparatuses for gathering information, framework technique, the proposed
framework info and yield, clients and framework advancement instruments.

3.2 Fact finding techniques

It shows how data will be collected from the users of the system. The data
collection techniques to be used include:

3.2.1 Research

A useful fact-finding technique is to research the application or the problem that


you are dealing with and want to put within a database. Computer trade journals,
reference books, and the Internet are good sources of information which can make
available of huge quantity of information on how others have solved similar
problems/issues plus whether or not any software packages exist to resolve or even
partially solve your current problem.

3.2.2 Questionnaires

Another fabulous fact-finding method is to conduct surveys through


questionnaires. Questionnaires are special-purpose documents that allow facts to be
gathered from a large number of people while upholding some control over their
responses. When dealing with a large number of listeners or audience, no other
8
fact-finding technique can tabulate the same facts so efficiently. There are two types
of questions that can be asked in a questionnaire namely free-format and fixed-format.
Free-format questions offer the respondent greater freedom inputting answers.
Fixed-format questions require specific responses from individuals, and for the given
question, the respondent must choose from the available answers.

3.2.3 Examining documentation

Can be helpful when you try to gain some insight as to how the requirement for a
database arose. You may also find that documentation can help to acquire
information on the part of the enterprise associated with the problem. If the problem
relates to the current system, there should have to be documents associated with that
system. By examining documents, forms, reports, and files associated with the
current system, you can quickly gain some thoughtful concepts out of the system.

3.3 Observation

I will utilize this procedure to gather data about how the present framework
works and its procedures. This includes efficiently watching and recording the
practices and attributes of activities and procedures. It gives progressively point by
point and setting related data and can adjust to occasions as they happen, in any case,
the strategy might be tedious.

3.4 Interviews

I will lead an oral meeting whereby I will talk with entrepreneurs, providers and
purchasers to get a more profound knowledge of how the framework is getting down
to business. I incline toward this technique since it gives more data from different
interviewees and offers more noteworthy adaptability as the chance to rebuild
questions is there, particularly if there should arise an occurrence of unstructured
meeting. It's favored in light of the fact that it will give a closer contact between the
clients and the designer thus dispersing the likelihood of the finished framework
being rejected by clients.

This method too:

9
• Permits explanation of inquiries.

• Has high reaction rate than composed surveys.

• It is appropriate for use with both educated and unskilled people.

• Get full range and profundity of data.

3.5 Data Collection

This is data I will collect from existing sources e.g. from the books, internet,
journals and magazines that where collected by other researchers and analysis was
done. It is from this data that I will then compare with the primary data and make a
final decision and conclusion.

3.6 Software Development Life Cycle (SDLC)

Software development life cycle is a technique that is used to show how the
proposed system will developed. In this case, the methodology used will be a
waterfall model.

Figure 3.1: Software Development Life Cycle

3.6.1 Waterfall Model

The Waterfall Model was the first Process Model to be introduced. It is very
simple to understand and use. In a Waterfall model, each phase must be completed
before the next phase can begin and there is no overlapping in the phases. Waterfall
model is the earliest SDLC approach that was used for software development.

10
In “The Waterfall” approach, the whole process of software development is
divided into separate phases. The outcome of one phase acts as the input for the next
phase sequentially. This means that any phase in the development process begins
only if the previous phase is complete. The waterfall model is a sequential design
process in which progress is seen as flowing steadily downwards (like a waterfall)
through the phases of Conception, Initiation, Analysis, Design, Construction, Testing,
Production/Implementation and Maintenance.

As the Waterfall Model illustrates the software development process in a linear


sequential flow, hence it is also referred to as a Linear-Sequential Life Cycle Model.

Figure 3.2: Steps of Water Fall

3.6.2 Sequential Phases in the Waterfall Model

• Requirements: The first phase involves understanding what needs to design


and what is its function, purpose, etc. Here, the specifications of the input and
output or the final product are studied and marked.

• System Design: The requirement specifications from the first phase are
studied in this phase and system design is prepared. System Design helps in
specifying hardware and system requirements and also helps in defining
overall system architecture. The software code to be written in the next stage
is created now.
11
• Implementation: With inputs from system design, the system is first
developed in small programs called units, which are integrated into the next
phase. Each unit is developed and tested for its functionality which is referred
to as Unit Testing.

• Integration and Testing: All the units developed in the implementation


phase are integrated into a system after testing of each unit. The software
designed, needs to go through constant software testing to find out if there are
any flaw or errors. Testing is done so that the client does not face any
problem during the installation of the software.

• Deployment of System: Once the functional and non-functional testing is


done, the product is deployed in the customer environment or released into
the market.

• Maintenance: This step occurs after installation, and involves making


modifications to the system or an individual component to alter attributes or
improve performance. These modifications arise either due to change requests
initiated by the customer, or defects uncovered during live use of the system.
The client is provided with regular maintenance and support for the developed
software.

All these phases are cascaded to each other in which progress is seen as flowing
steadily downwards (like a waterfall) through the phases. The next phase is started
only after the defined set of goals are achieved for the previous phase and it is signed
off, so the name “Waterfall Model”.

3.6.3 Advantages of the Waterfall Model

• The advantage of waterfall development is that it allows for


departmentalization and control. A schedule can be set with deadlines for
each stage of development and a product can proceed through the
development process model phases one by one.

• The waterfall model progresses through easily understandable and


explainable phases and thus it is easy to use.
12
• It is easy to manage due to the rigidity of the model – each phase has specific
deliverables and a review process.

• In this model, phases are processed and completed one at a time and they do
not overlap. Waterfall model works well for smaller projects where
requirements are very well understood.

3.6.4 Disadvantages of Waterfall Model

• It is difficult to estimate time and cost for each phase of the development
process.

• Once an application is in the testing stage, it is very difficult to go back and


change something that was not well-thought out in the concept stage.

• Not a good model for complex and object-oriented projects.

• Not suitable for the projects where requirements are at a moderate to high risk
of changing.

3.7 Use Case Diagram

A use case diagram shows the interaction between the system and its
environment. The components of a use case diagram are:

Actors: Represent external entities of the system i.e. People who interact with the
system that is being modeled. For example, customers and system administrator will
be the actors of the proposed system.

Use Cases: Use cases are functional parts of the system. Examples are recording and
submitting measurements.

Associations: Associations are shown between actors and use cases, by drawing a
solid line between them. This only represents that and actor uses the use case.

13
3.7.1 Use Case for Admin Login

Fig 3.3 Use Case for Admin Login

3.7.2 Use Case for student registration

Fig 3.4Use Case for Student Registration

14
3.7.3 Use Case for Submitting MCQS

Fig 3.5 Use Case for Submitting MCQS

3.7.4 Use Case for Editing and deleting MCQS

Fig 3.6 Use Case for creating new offer

15
3.7.5 Use Case for adding new Subject

Fig 3.7 Use Case for adding new Subject

3.7.6 Use Case for reading and deleting message

Fig 3.8 Use Case for checking approved and pending MCQS
16
3.8 Database tables

All the database tables are listed below

3.8.1 Users

Fig 3.9 Screenshot of User Table

3.8.2 Subjects

Fig 3.10 Screenshot of Subjects Table

3.8.3 MCQS

Fig 3.11 Screenshot of MCQS Table

17
CHAPTER 4

EXPERIMENTAL WORK
4.1 User Guide

Through visuals of the project I have added some images of the website. These
images will represent the front end of Web Application.

4.1.1 Home Page

Below images are showing the look and feel of frontend. There are Some
Screenshots of home page.

Fig 4.1.1) Screenshot of Home page

18
4.1.2 Registration

Fig 4.1.2 Screenshot of Registration page

19
4.1.3 Login page

Fig 4.1.3 Screenshot of Login page

20
4.1.4 Study

Fig 4.1.4 Screenshot of Study page

21
4.1.5 Adding MCQS page

Fig 4.1.5 Screenshot of Adding MCQS Page

22
4.1.6 User Dashboard

Fig 4.1.5 Screenshot of Adding MCQS Page

23
4.2 Admin Controls

Below is the complete admin control to manage the frontend and backend of the
website. Here we can manage gallery, offers, messages admin file.

4.2.1 Admin Dashboard

Fig 4.2.1 Screenshot of Admin dashboard page

24
4.2.2 MCQS Approval Page

Fig 4.2.2 Screenshot of MCQS Approval page

25
4.3 Testing the System

Testing is a process of executing an implementation of a system with test data and


examining the output of the system and its operational behavior to check whether it is
performing as required. There are three types of testing techniques like Black Box
testing, White Box testing and Gray Box testing. I have used White Box testing
technique to test my project.

One of the main objectives of testing is to establish the presence of defect in a


program. Testing can only establish the existence of defects whereas debugging
locates and corrects these defects.

Testing can also judge whether or not this particular application is usable in
practice. Therefore, a suitable approach must be chosen to reduce the possibility of
errors. Among the rules that serve well as program testing objectives are:

• Testing is a process of program execution with explicit intents to find errors and
run-time program bugs.
• A successful test is not one that uncovers only few expected errors, but it is also
one that constantly provides new challenges to its programmer over time.

4.4 Integration Testing

This testing approach was conducted once individual program units had been
tested. After combination of all the modules contained in this web-based application,
check for the complete system for functionality, with emphasis on the modular
interfaces (input/output parameters).

26
4.5 Interface Testing

Interface testing was conducted to detect faults, which may have been introduced
into application interface or invalid assumptions about the interfaces. The buttons were
checked to ensure that they pointed to the exact source. For example, the developer
ensured that if the user were to click on the sign in menu, a signing in process will start.
In addition, the user interface testing was also conducted to ensure that all the error
messages were concise and opened at the correct time, without much delay. In
language the interface testing was also conducted to ensure that about particular error
particular error message is displayed, so that user can easily remove his error.

4.6 System Testing

System testing is a series of tests whose primary purpose is to fully exercise the
completed system. In other words, it ensures that the application program written and
tested in isolation, works properly when it is integrated into a total system. A series of
tests were carried out to see if System of ticket reservation fully exercises its functions.
This is to ensure that System performs its specified functions smoothly without any
glitches. Some structural tests were carried out in order to satisfy the requirements of
Website and Online Library Management System of NCBA&E.

27
CHAPTER 5

RESULT & DISCUSSION, CONCLUSION & FUTURE


WORK
5.1 Result & Discussion

The system is built in order to replace the manual system and compete with the
domain of online test preparation system websites. Through this testing system user
can easily practice for their exams and tests and also user is able to contribute in the
website by submitting their MCQS and the admin of the website can choose which
question to approve and which to deny. Admin is also able to submit MCQS by itself
and if we see at the user end, during the testing user can make its own test and after
or before the test user is able to see all the correct answers and also able to hide the
answers for better preparation and better experience. The website is completely
designed according to demands of the user.

5.2 Conclusion

The core reason for the establishment of Online MCQS preparation system,
website is to enable the users and administrators in a convenient, fair and timely
manner of interaction. We have finally developed the website for tests and exams
preparation for students with contribution features, Because of this website user do
not have to waste time and money on different institutions and instead of that user
can take advantages online according to its requirement

5.3 Future Work

• Android application

• IOS application

• Certifications offering

28
REFERENCES
Braun, K. W., & Sellers, R. D. (2012). Using a “daily motivational quiz” to increase
student preparation, attendance, and participation. Issues in Accounting
Education, 27(1), 267-279.

Brown, G. A., Bice, M. R., Shaw, B. S., & Shaw, I. (2015). Online quizzes promote
inconsistent improvements on in-class test performance in introductory anatomy and
physiology. Advances in physiology education, 39(2), 63-66.

Kannan, P. T., & Bansal, S. K. (2013). Unimate: A student information system.


In 2013 International Conference on Advances in Computing, Communications and
Informatics (ICACCI) (pp. 1251-1256). IEEE.

Salas-Morera, L., Arauzo-Azofra, A., & García-Hernández, L. (2012). Analysis of


online quizzes as a teaching and assessment tool. Journal of Technology and Science
Education, 2(1), 39-45.

29
APPENDIX

SOURCE CODE
FRONT PAGE

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width,


initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<link
href="https://fonts.googleapis.com/css?family=Satisfy&display=swap"
rel="stylesheet">

<link
href="https://fonts.googleapis.com/css?family=Fira+Code&display=swa
p" rel="stylesheet">

<title>Pace Up</title>

<link rel="stylesheet" href="style/style.css">

</head>

<body>

<div class="main">

<div class="left">

<img src="images/artlogo.png" class="logo">

<div class="title">

Pace Up
30
</div>

<div class="subtitle">

MCQs And Quiz Preparation

</div>

</div>

<div class="right">

<div class="gridholder">

<a href="subjects.php">

<div class="box"
style="background:url(images/b4.jpg) no-repeat ; background-size:
200px 160px ; " >

<div class="title"> <div class="txt"> STUDY


</div> </div>

</div>

</a>

<a href="quizsubjects.php">

<div class="box"
style="background:url(images/b5.jpg) no-repeat ; background-size:
200px 160px ; " >

<div class="title"> <div class="txt"> QUIZ </div>


</div>

</div>

</a>

<a href="mcqs.php">

31
<div class="box"
style="background:url(images/b3.jpg) no-repeat ; background-size:
200px 160px ; " >

<div class="title"> <div class="txt"> SUBMIT


</div> </div>

</div>

</a>

<a href="login/index.php">

<div class="box"
style="background:url(images/b2.jpg) no-repeat ; background-size:
200px 160px ; " >

<div class="title"> <div class="txt"> LOGIN


</div> </div>

</div>

</a>

<div class="clearfix"></div>

<div class="title"></div>

</div>

</div>

</div>

</body>

</html>

32
DASHBOARD

<?php

session_start();

include "db/link.php";

if(isset($_GET['subid'])){

$subid = $_GET['subid'];

$sqlid = "SELECT * FROM subjects WHERE sub_id =$subid ";

$rid = mysqli_query($link , $sqlid);

$rowid = mysqli_fetch_array($rid);

$subname = $rowid['sub_name'];

if(!isset($_SESSION['email'])){

header("location: login/?msg=Access Denied");

$uid = $_SESSION['u_id'];

?>

33
<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width,


initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<link
href="https://fonts.googleapis.com/css?family=Satisfy&display=swap"
rel="stylesheet">

<link
href="https://fonts.googleapis.com/css?family=Fira+Code&display=swa
p" rel="stylesheet">

<link
href="https://fonts.googleapis.com/css?family=Big+Shoulders+Display
&display=swap" rel="stylesheet">

<link rel="stylesheet"
href="https://unpkg.com/simplebar@latest/dist/simplebar.css" />

<!-- <base href="../"> -->

<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.mi
n.css">

<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></
script>

<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js
"></script>

34
<title>Subjects</title>

<link rel="stylesheet" href="style/main.css">

<script>

function showans(id){

document.getElementById(id).style.height = "auto";

function hideans(id){

document.getElementById(id).style.height = "0px";

function change(id){

if(id == 1){

window.location = "dashboard.php?type=1";

if(id == 2){

window.location = "dashboard.php?type=2";

</script>

</head>

<body>

35
<script
src="https://unpkg.com/simplebar@latest/dist/simplebar.js"></script>

<div class="main">

<?php include "sidebar.php"; ?>

<div class="cover">

<div class="overlay">

<!-- <div class="heading">

Once you Stop Learning , You Start Dying.

</div> -->

<div class="ptitle">

<?php

if(isset($subname)){

echo $subname;

else {

echo "ALL MCQS";

?>

</div>

<div class="searchbox">

36
<input type="text" class="searchbar"
placeholder="Search" id="myInput" >

<span>

<select name="type"
onchange="change(this.value)" class="change" id="">

<option <?php if(isset($_GET['type']) &&


$_GET['type'] == 1 ){ echo "selected"; } ?>
value="1">Submitted</option>

<option <?php if(isset($_GET['type']) &&


$_GET['type'] == 2 ){ echo "selected"; } ?>
value="2">Pending</option>

</select>

</span>

</div>

<div class="mcqs" data-simplebar >

<table id="myTable" style="width:100%;">

<?php

if(isset($_GET['type'])){

$type = $_GET['type'];

if($type == 1){

$sql = "SELECT * FROM mcqs m

LEFT JOIN subjects s on m.sub_id =


s.sub_id WHERE u_id = $uid AND q_status = 1 ";

37
}

if($type == 2){

$sql = "SELECT * FROM mcqs m

LEFT JOIN subjects s on m.sub_id =


s.sub_id WHERE u_id = $uid AND q_status = 0 ";

else{

$sql = "SELECT * FROM mcqs m

LEFT JOIN subjects s on m.sub_id = s.sub_id


WHERE u_id = $uid AND q_status = 1 ";

$r = mysqli_query($link , $sql);

while($row = mysqli_fetch_array($r)){

?>
38
<tr style="width:100%;"><td>

<div class="mcqs-bars">

<div class="actions">

<a href="mcqs.php?qid=<?php echo


$row['q_id']; ?>">

<div class="icon">

<img src="images/icon-edit.png"
title="Edit" style="width: 90%;" class="img" alt="">

</div>

</a>

<a href="userdb/deletemcqs.php?qid=<?php
echo $row['q_id']; ?>&uid=<?php echo $row['u_id']; ?> ">

<div class="icon">

<img src="images/icon-delete.png"
title="Delete" class="img" alt="">

</div>

</a>

</div>

<div class="questions"> <?php echo


$row['q_question']; ?></div>

<button class="btn" onclick="showans('ans<?php


echo $row['q_id']; ?>')" >Explain</button>

<div class="menu" id="ans<?php echo


$row['q_id']; ?>">

<div class="head">

39
Correct Answers <span
onclick="hideans('ans<?php echo $row['q_id']; ?>')"> &times;</span>

</div>

<div class="body">

<?php echo $row['q_explain']; ?>

</div>

</div>

<ul class="answer">

<?php

$options = explode("," ,
$row['q_options'] );

$coption = $row['q_ans'];

$ans = $options[$coption - 1 ];

foreach($options as $o ){

if($o === $ans){

echo "<li class='selected'>". $o ."


</li>";

else{

echo "<li>". $o ." </li>";

?>

40
</ul>

<div class="subname">

<?php echo $row['sub_name']; ?>

</div>

</div>

</td></tr>

<?php } ?>

</table>

</div>

</div>

<div class="clearfix"></div>

</div>

</div>

<script>

$(document).ready(function(){
41
$("#myInput").on("keyup", function() {

var value = $(this).val().toLowerCase();

$("#myTable tr").filter(function() {

$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)

});

});

});

</script>

</body>

</html>

MCQS PAGE CODE

<?php

session_start();

include "db/link.php";

if(!isset($_SESSION['email'])){

header("location: login/?msg=Access Denied");

?>

42
<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width,


initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<link
href="https://fonts.googleapis.com/css?family=Satisfy&display=swap"
rel="stylesheet">

<link
href="https://fonts.googleapis.com/css?family=Fira+Code&display=swa
p" rel="stylesheet">

<link
href="https://fonts.googleapis.com/css?family=Big+Shoulders+Display
&display=swap" rel="stylesheet">

<link rel="stylesheet"
href="https://unpkg.com/simplebar@latest/dist/simplebar.css" />

<!-- <base href="../"> -->

<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.mi
n.css">

<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></
script>

<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js
"></script>
43
<title>Subjects</title>

<link rel="stylesheet" href="style/main.css">

<script>

function showans(id){

document.getElementById(id).style.height = "auto";

function hideans(id){

document.getElementById(id).style.height = "0px";

</script>

</head>

<body>

<script
src="https://unpkg.com/simplebar@latest/dist/simplebar.js"></script>

<div class="main">

<?php include "sidebar.php" ?>

<div class="cover">

44
<div class="overlay">

<!-- <div class="heading">

Once you Stop Learning , You Start Dying.

</div> -->

<div class="ptitle">

<?php

if(isset($_GET['qid'])){

echo "Edit Question";

else{

echo "Add new Question";

?>

</div>

<?php

if(isset($_GET['qid'])){

$qid = $_GET['qid'];

$sqle = "SELECT * FROM mcqs WHERE q_id


=$qid ";

45
$re = mysqli_query($link, $sqle);

$rowe = mysqli_fetch_array($re);

?>

<!-- Edit Question -->

<form action="userdb/editmcqs.php" method="POST" >

<div class="searchbox">

<input type="hidden" name="qid" value="<?php


echo $qid; ?>" >

<input type="hidden" name="createrid"


value="<?php echo $rowe['u_id']; ?>" >

<select name="subid" class="searchbar" required


id="">

<option value="">Select Subject</option>

<?php

$sqlnop= "SELECT * FROM subjects";

$rnop = mysqli_query($link , $sqlnop);

while($rownop =
mysqli_fetch_array($rnop)){

46
?>

<option <?php if($rownop['sub_id'] ==


$rowe['sub_id'] ) { echo "selected"; } ?> value="<?php echo
$rownop['sub_id']; ?>"> <?php echo $rownop['sub_name']; ?>
</option>

<?php } ?>

</select>

</div>

<div class="form" >

<div class="left">

<label for="">Question</label>

<input type="text" name="q" class="txt big"


placeholder="Question" value="<?php echo $rowe['q_question']; ?>"
required >

<?php

$opt = $rowe['q_options'];

$options = explode("," , $opt );

?>
47
<input type="text" name="options[]" class="txt"
placeholder="Option a" value="<?php echo $options[0] ; ?>" required >

<input type="text" name="options[]" class="txt"


placeholder="Option b" value="<?php echo $options[1] ; ?>" required >

<input type="text" name="options[]" class="txt"


placeholder="Option c" value="<?php echo $options[2] ; ?>" required >

<input type="text" name="options[]" class="txt"


placeholder="Option d" value="<?php echo $options[3] ; ?>" required >

</div>

<div class="right">

<label for="">Correct Option</label>

<select name="coption" class="txt" id="" >

<option <?php if($rowe['q_ans'] == 1 ){ echo


"selected"; } ?> value="1">1</option>

<option <?php if($rowe['q_ans'] == 2 ){ echo


"selected"; } ?> value="2">2</option>

<option <?php if($rowe['q_ans'] == 3 ){ echo


"selected"; } ?> value="3">3</option>

<option <?php if($rowe['q_ans'] == 4 ){ echo


"selected"; } ?> value="4">4</option>

</select>

<label for="">Explain</label>

<textarea name="explain" class="txt"


style="height: auto; text-align: left; " value="<?php echo
$rowe['q_explain'] ; ?>" id="" cols="30" rows="10">

48
<?php echo $rowe['q_explain'] ; ?>

</textarea>

</div>

<div class="clearfix"></div>

<button class="btn btn-success"


type="submit" >Save</button>

</div>

</form>

<?php

else{

?>

<!-- New Questions -->

<form action="userdb/addmcqs.php" method="POST" >

<div class="searchbox">

<select name="subid" class="searchbar" required


id="">

<option value="">Select Subject</option>

<?php
49
$sqlnop= "SELECT * FROM subjects";

$rnop = mysqli_query($link , $sqlnop);

while($rownop =
mysqli_fetch_array($rnop)){

?>

<option value="<?php echo


$rownop['sub_id']; ?>"> <?php echo $rownop['sub_name']; ?>
</option>

<?php } ?>

</select>

</div>

<div class="form" >

<div class="left">

<label for="">Question</label>

<input type="text" name="q" class="txt big"


placeholder="Question" required >

<input type="text" name="options[]" class="txt"


placeholder="Option a" required >

50
<input type="text" name="options[]" class="txt"
placeholder="Option b" required >

<input type="text" name="options[]" class="txt"


placeholder="Option c" required >

<input type="text" name="options[]" class="txt"


placeholder="Option d" required >

</div>

<div class="right">

<label for="">Correct Option</label>

<select name="coption" class="txt" id="" >

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

</select>

<label for="">Explain</label>

<textarea name="explain" class="txt"


style="height: auto; text-align: left; " id="" cols="30" rows="10">

</textarea>

</div>

51
<div class="clearfix"></div>

<button class="btn btn-success"


type="submit" >Save</button>

</div>

</form>

<?php } ?>

</div>

<div class="clearfix"></div>

</div>

</div>

<script>

$(document).ready(function(){

$("#myInput").on("keyup", function() {

var value = $(this).val().toLowerCase();

$("#myTable tr").filter(function() {

$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)

});

});

});

</script>

</body>

</html>

52

You might also like