You are on page 1of 102

QUESTRA

in
partial fulfillment for the award
of
Degree
in
Computer Science
by
NAVANEETH KRISHNAN P
Reg. No.
CCASSCS016
under the guidance of
Mr.Linto George
Assistant Professor

BSc COMPUTER SCIENCE


DEPARTMENT OF COMPUTER SCIENCE
CHRIST COLLEGE(Autonomous)
IRINJALAKUDA, KERALA
INDIA
March 2021
DEPARTMENT OF COMPUTER SCIENCE

Christ College(Autonomous)

Irinjalakuda

CERTIFICATE

Certified that this project entitled “Questra” submitted by “ Navaneeth


Krishnan P(Reg. No.CCASSCS016))” in partial fulfillment for the
award of the degree of Bachelor of Computer Science under University of
Calicut during the year 2019-2020, is the bonafide work carried out by them
under my guidance and supervision.
Mr.Linto George Ms. Viji Viswanathan.
Assistant Professor, CS Head of the Department
Internal Guide Computer Science

EXTERNAL EXAMINER INTERNAL EXAMINER

1
ACKNOWLEDGMENT
First and foremost we like to thank lord almighty for his providence and
for being the guiding light throughout the project. We express our sincere
gratitude to our beloved Department head for giving me all the facilities for
our project

We are using this opportunity to express our gratitude to the class teacher
Ms.SINI THOMAS and head of the department Ms.VIJI VISWANATHAN
who has been supported us throughout the course of this project. We are
thankful for her aspiring guidance and valuable advice during the project
work. We extend our sincere thanks to our project guide Mr.LINTO
GEORGE, for supporting and guiding us throughout the project.

We would take this opportunity to specially thank all other faculty mem-
bers for their constant and continuous motivation. Finally we would like to
thank our family and friends for giving us valuable advice and moral support
throughout our project.
DECLARATION
We hereby declare that this project work ”QUESTRA” submitted to christ
college (Autonomous) Irinjalakuda, Affiliated to Calicut University in par-
tial fulfillment of the requirement for the award of the Bachelor of Com-
puter Science, is a record of original work done by us, under the guidance of
Mr.LINTO GEORGE, Department of computer Science.

Place: NAVANEETH KRISHNAN P


Date :
ABSTRACT
QUESTRA is a ‘Quiz app’ where you can create a quiz being the quiz
master or participate in quizzes as a contestant..This web application is cre-
ating using Android and PHP programming language.
Contents

1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 System Analysis 2
2.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.1 Existing System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.2 Proposed System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Problem definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Feasibility study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3.1 Technical Feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3.2 Economical Feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3.3 Operational Feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Module Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4.1 Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4.2 User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 Software Requirement Specification 5


3.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 Overall Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3.1 Product Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3.2 Product Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3.3 Users and Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4 Specific Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.5 Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.6 Non Functional Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.7 Security Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.8 Platform and Technologies Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.8.1 About Front End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4 Design Document 9
4.1 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3.1 Logical Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3.2 Physical Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3.3 Database Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3.4 Primary key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3.5 Foreign key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4 Normalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 ER Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.6 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.7 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

5 System Testing 15
5.1 Unit Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2 Integration Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Validation Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.4 Output Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.5 White Box Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.6 Black Box Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

6 System Maintenance and Security 17


6.1 Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.1.1 Corrective Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.1.2 Adaptive Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.1.3 Perfective Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6.2 System Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

7 Conclusion and Future Scope 19


7.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.2 Future Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Appendix 20
A ER Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
B Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
C Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
D User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Christ College(Autonomous) Questra

Chapter 1

Introduction

Questra is used to administer a quiz for school or college pupils, or this software can also be
used by the organization in the recruiting process. At first, the student must register his/her name
along with all the information required and choose the username and password for the login process.
Using this username and password to log in to the ”QUESTRA” application. The next procedure
is to answer the quiz. As soon as the student chooses the quiz menu strip, the questions with four
choices will be shown. The student must type any of the options and click on the Next button. On
this click, the next series of questions and answers will be shown. This is going to go until the end
of the issue. The admin has the right to add or change some question or alternative. The answers
to each query would be stored in the database. The resulting choice displays the marks of all the
students who replied in descending order so that the admin cab obtains the top students who can
proceed to the next round. The Admin includes the username and password for others, so that
they can verify the results in the absence of Admin, but not for pupils. The ability to check the
student’s data using the student’s login name will also be offered.

1.1 Overview
The objective of the Quiz app is to design a simple and adaptable website and mobile application
for conducting online quiz.The host can create the quiz and the user can play quiz. It provides a
unique page of mobile application for user and host.The application includes many functions such
as user registration,host registration,host login,user login and some other features.

Department of Computer Science 1


Christ College(Autonomous) Questra

Chapter 2

System Analysis

2.1 Purpose
This Quiz app is to help the users to prepare for necessary educational purposes regarding Computer
Science and IT field with an easy access to our app directly on their Android phones. Through our
app, users can learn and prepare themselves for interviews, tests and exams on Android phones,
and can also use this app for increasing their general knowledge about Computer Science, Verbal
and Analytical, everywhere and anytime.

2.1.1 Existing System


There are various MCQ quiz applications exist in the internet with different criteria. Each of the
existing applications has their own goodness and problems.The existing systems have the below
disadvantages.
ˆ Most existing systems are web sites

ˆ Available mobile applications are very few and most of them are in dead state

2.1.2 Proposed System


The proposed system is a mobile application which helps the host to conduct quiz easily.Our main
objective is to create a method that would allow us to make our computers do the whole assessment
work and award score to the answers accordingly.

ˆ User friendly interfaces: the system provides friendly graphical user interfaces with effi-
cient help and tips, which makes easier for the hosts and the user to conduct and play.
ˆ Easier access of services: the users can access the services easily by simply login to the
site..

ˆ Security: it provides security by means of passwords.

Department of Computer Science 2


Christ College(Autonomous) Questra

2.2 Problem definition


A website and mobile application is used to ensure greater profitabilty for farmers and customers.

2.3 Feasibility study


Feasibility study is a process that identifies, describes and evaluates proposed system and selects
the best system. During the study, the problem definition is solved and all aspects of problem to
be included in the system are determined. Size of project, cost of benefits is also estimated with
greater accuracy. A good feasibility study will show the strength and defects before the project is
planned or budgeted.

2.3.1 Technical Feasibility


It determines whether the technology is needed for the proposed system is available and how it
can be integrated with the government. Technical evaluation must assess whether the user have
technical expert to understand and use the new system. This assessment is based on an outline
design of system requirements, to determine whether proposal is technically and legally feasible. It
is the evaluation of the hardware and software and how it meets the need of the proposed system.The
technology used can be developed with the current equipment’s and has the technical capacity to
hold data required by the old system.

2.3.2 Economical Feasibility


The purpose of the economic feasibility assessment is to determine the positive economic benefits to
the organization that the proposed system will provide. It includes quantification and identification.
It identifies the financial benefits and cost associated with the development of the system. Economic
feasibility is often known as the cost benefit analysis. To carry out an economic feasibility study it
is necessary to estimate actual money value against activities needed for implementing the system.
While implementing our system we can ensure that the cost of prospective new venture will
ultimately be profitable to the people. So we can say it is financially feasible.

2.3.3 Operational Feasibility


Operational feasibility is the measure of how well a proposed system solves the problems, and takes
advantage of the opportunities identified during scope definition and how it satisfies the require-
ments identified in the requirement analysis phase of system development. It focuses on the degree
to which the proposed development project fits in with the existing environment and objectives
it regards to development schedule. Operational feasibility focuses on human, organizational and
political.

2.4 Module Description


The system comprises of 3 major modules with their sub-modules as follows:

Department of Computer Science 3


Christ College(Autonomous) Questra

2.4.1 Host
Host can use the system after registration.On registration,the farmer have to supply a username
and password using this username and password combination,the host can login to the system.The
host can use the system for the following puposes:

ˆ Can create quiz

ˆ Can manage the enrolled participants

ˆ Can edit profile

2.4.2 User
User have to install the mobile application using apk file.User fills a simple registration form in his
mobile.After registration,user can do the following activities:
ˆ Can find out available quizzes

ˆ Can enroll in available quizzes

ˆ Can edit Profile

ˆ Can download the result as pdf

Department of Computer Science 4


Christ College(Autonomous) Questra

Chapter 3

Software Requirement
Specification

3.1 Purpose
The purpose of this document is to give a detailed description of the requirements for the QUES-
TRA. It will illustrate the purpose and complete declaration for the development of the system.
It will also explain system constraints, interface and interactions with other external applications.
This document is primarily intended to be proposed to a host to conduct quiz

3.2 Scope
This is an Android based mobile application that is developed to help conducting a quiz. The
mobile application with Android Java at the front end Php-mysql at the backend, will record
product related activities in a secure manner. The concept of this quiz app system is to administer
a quiz.

3.3 Overall Description


This section will give an overview of our system,QUESTRA. This project is designed for host
and users for conducting quiz which helps them to access the website, register and retrieve useful
information regarding the same. It provides a unique page of mobile application for customers.The
website includes many functions such as host registration, user registration, host login,user login
and some other features.

3.3.1 Product Perspective


QUESTRA is mainly used for making quiz.

Department of Computer Science 5


Christ College(Autonomous) Questra

3.3.2 Product Functionality


Through this system host can control the quiz.Users are able to play the quiz.

3.3.3 Users and Characteristics


Users can login through app. Each of these have different tasks which is performed. Host is able
to remove users.

3.4 Specific Requirements


3.4.1 Hardware Requirements
Processor:Intel dual core or above
Processor speed :1.0GHZ or above
RAM :1 GB RAM or above
Hard Disk :20 GB hard disk or above

3.4.2 Software Requirements


Operating System :Any OS
Programming Language :PHP,Android
IDE:Android Studio
Database Server: SQL

3.5 Functional Requirements


Implementation is the stages of project when the theoretical design is turned into a working system.
If the implementation stage is not properly planned and controlled, it can cause chaos. Thus it
can be consider to be most crucial stage in achieving successful new system and in giving the users
confidence that the new system will work and be effective. Normally this stage involves setting up
a co-ordination committee, which will act as a sounding board of ideas, complaints and problems.
The first task is implementation planning ie; of the methods and time scale to be adopted. Apart
from planning, the two major task of repairing for implementation are education and training of
administrator and testing of the system. After the implementation phase is completed and the
user staff adjusted to the changes created by the candidate system, evaluation and maintenance is
continue to bring the new system standards. The activities of the implementation phase can be
summarized as;

ˆ Implementation planning.

ˆ Eduction and training

ˆ System training

Department of Computer Science 6


Christ College(Autonomous) Questra

3.6 Non Functional Requirements


ˆ Performance requirements:The response time should not vary with the increasing the size
of the data storage.
ˆ Security requirements: Modules are authenticated. The username and password should
be a unique token id
ˆ Training requirements: Training has to be provided by the supervisor

ˆ Validation and verification:Checks whether all the fields are filled and valid.The password
is invisible by applying dots

3.7 Security Requirements


The system is implemented after through checking is done and if it is found working according to
the specification. It involves careful planning investigation of the current system and constraints
on implementation, design of methods to achieve. Two checking is done and if it is found working
according to the major task of preparing the implementation are educating, training the admin-
istrator. The implementation process begins with preparing a plan for the implementation of the
system. According to this plan, the activities are to be carried out, discussions made regarding the
equipment, recourses and the additional equipment that has to be acquired to implement the new
system. The most important thing in the implementation stage is, gaining the users confidence that
the system will work effectively. The system can be implemented only after the testing is done.
This method also offers the greatest security since the existing system can take over if the errors
are found or inability to handle certain type of transaction while using the new system. Security
involves both policies and mechanisms to protect the data and ensures that it is not accessed,
altered or deleted without proper authorization. There are two dimensions for the protection of
data in the data base. The logged user can only perform the operations. This ensures that the
confidentiality of the data is maintained, second, the data must be protected from accidental or
intentional corruption or destruction. The security features are considered while developing the
system, so as to avoid the errors and omissions that may lead to serious problems. The system may
have to face the unwanted events called threats. A threat to a computer system is any events that
adversely affect the one or more assets or resources, which make up the system. An event can be
any of the following:
ˆ Interruption of communication

ˆ Destruction of hardware

ˆ Modification of software

ˆ Removal of programs.

ˆ Disclosure of information.

There are many methods for handling a threat.


ˆ Avoid it by altering the design.

Department of Computer Science 7


Christ College(Autonomous) Questra

ˆ Threat retention.

ˆ Threat reduction that is the frequency of occurrence of a threat is reduced.

The security measures of a computer system should be specified at an early stage in the design of
the system. During the system operation each user should understand the procedures required to
keep the system secure.
There are many possible threats to the security and integrity of any system where more than
one user is associated with the system. Software integrity has become increasingly important.
The attribute measures a system’s ability to withstand attacks, both accidental and intentional
on its security. Attacks can be made on all the three components of software: programs date and
documents.
In this project the data security, data validation checking methods are applied using a password
authentication. All the data, which is entered by the administrator, will be validated.

3.8 Platform and Technologies Used


3.8.1 About Front End
Android Studio is the official Integrated Development Environment (IDE) for Google’s Android
operating system, built on JetBrains’ IntelliJ IDEA software and designed specifically for Android
development. It is available for download on Windows, macOS and Linux based operating systems.
It is a replacement for the Eclipse Android Development Tools (ADT) as primary IDE for native
Android application development.Each project in Android Studio contains one or more modules
with source code files and resource files. Types of modules include:

ˆ Android app modules

ˆ Library modules

ˆ Google App Engine modules

By default, Android Studio displays your project files in the Android project view. This view is
organized by modules to provide quick access to your project’s key source files. All the build files
are visible at the top level under Gradle Scripts and each app module contains the following folders:
ˆ manifests: Contains the AndroidManifest.xml file.

ˆ java: Contains the Java source code files, including JUnit test code.

ˆ res: Contains all non-code resources, such as XML layouts, UI strings, and bitmap images.

Department of Computer Science 8


Christ College(Autonomous) Questra

Chapter 4

Design Document

4.1 Purpose
The purpose of this document is to give a design overview for the QUESTRA

4.2 Scope
To develop a description of the design of a system.

4.3 Overview
System design transforms a logical representation what the system is required to do into the physical
specification. The specifications are converted into a physical reality during the development.
Design forms a blueprint of the system and adds how the components relates to each other. The
design phase proceeds accordingly to an ordinary sequence of steps, beginning with review and
assigning of task and ending with package design. Design phase is the lifecycle phase in which the
detailed design of the system selected in the study phase is accomplished. A smooth transition
form the study phase to design is necessary because the design phase continues the activities in
the earlier phase. Simplicity is the most important criteria of design phase. The most creative
and challenging phase of the system life cycle is system design . The term design describes the
final system and the process by which it is developed. The first step in design is to determine how
the output is to be produced and in what format . Second the formats of input screens are to be
determined. The input data and the master files have to be designed to meet the requirements of
the proposed output.

4.3.1 Logical Design


The part of the design process that is independent of any specific hardware or software platform is
referred to as logical design. During the logical design, all functional features of the system chosen
for development in analysis phase are described independently of any computer platform.

Department of Computer Science 9


Christ College(Autonomous) Questra

4.3.2 Physical Design


Physical design is the part of the design in which the logical specification of the system from logical
design are transferred into technology-specific details from which all programming and system
construction can be accomplished. The system perform information output

4.3.3 Database Design


The objective of database design is to provide auxiliary storage and to contribute to be overall
efficiency of the program component one auxiliary storage medium must provide efficient access to
the data . The concept behind a database is an integrated collection of data and provides centralized
access to the data from program. A database is an collection of logically related data stored with
minimum redundancy to serve many users quickly and efficiently.

4.3.4 Primary key


A primary key is a special relational database table column (or combination of columns) designated
to uniquely identify all table records. A primary key’s main features are: It must contain a unique
value for each row of data. It cannot contain null values.

4.3.5 Foreign key


A foreign key is a key used to link two tables together. This is sometimes also called as a referencing
key. A Foreign Key is a column or a combination of columns whose values match a Primary Key
in a different table.

4.4 Normalization
Normalization is a systematic approach of decomposing tables to eliminate data redundancy(repetition)
and undesirable characteristics like Insertion, Update and Deletion Anomalies. It is a multi-step
process that puts data into tabular form, removing duplicated data from the relation tables.

Department of Computer Science 10


Christ College(Autonomous) Questra

4.5 ER Diagram
Entity relational model is a high-level conceptual data model diagram. The Entity-Relation model
represents real-world entities and the relationship between them. Entity Relation Diagram (ERD)
displays the relationships of entity set stored in a database.

4.6 Data Flow Diagram


Data flow is the one of the best ways of documenting the entire functionality of the system.For
the system, which will have some data flows in and have some processing inside and then some
data flow out from the system can be documented or represented effectively by means of data flow
diagrams.The data flow diagrams are a diagrammatic representation of the system which has inputs,
process and outputs.Once any system is represented using a data flow diagrams we can identify the
following things easily.
ˆ Various entities interacting with system are identified.

ˆ Flow of data from one entity to another is identified.

ˆ The various process involved in between the interaction of two or more entities in the system
are clearly pointed out.
ˆ The various data stores, which hold the data in between the processes are clearly identified.

Department of Computer Science 11


Christ College(Autonomous) Questra

4.7 Tables

online exam table


Name DataType Constraints
online exam id int(11) Primarykey
admin id int(11) Notnull
online exam title varchar(250) Notnull
online exam datetime datetime Notnull
online exam duration varchar(30) Notnull
total question int(5) Notnull
marks per right answer varchar(30) Notnull
marks per wrong answer varchar(30) Notnull
online exam created on datetime Notnull
online exam status enum Notnull
online exam code varchar(100) Notnull

Table 4.1: online exam table

user exam enroll table


Name DataType Constraints
user exam enroll id int(11) Primarykey
user id int(11) Notnull
exam id int(11) Notnul
attendance status enum Notnull

Table 4.2: user exam enroll table

user exam question answer


Name DataType Constraints
user exam question answer id int(11) primarykey
user id int(11) Notnull
exam id int(11) Notnull
question id int(11) Notnull
user answer option enum Notnull
marks varchar(20) Notnull

Table 4.3: user exam question answer

Department of Computer Science 12


Christ College(Autonomous) Questra

user table
Name DataType Constraints
user id int(11) Primarykey
user email address varchar(250) Notnull
user password varchar(150) Notnul
user verificatioon code varchar(100) Notnull
user name varchar(150) Notnull
user gender enum Notnull
user address text Notnull
user mobile no varchar(30) Notnull
user image varchar(150) Notnul
user created on datetime Notnull
user email verified enum Notnull

Table 4.4: user table

host table
Name DataType Constraints
user id int(11) Primarykey
user email address varchar(250) Notnull
user password varchar(150) Notnul
user verification code varchar(100) Notnull
user name varchar(150) Notnull
user gender enum Notnull
user address text Notnull
user mobile no varchar(30) Notnull
user image varchar(150) Notnull
user created on datetime Notnull
user email verified enum Notnull

Table 4.5: host table

question table
Name DataType Constraints
qno mediumint(9) Notnull
question text Notnull
choice1 text Notnull
choice2 text Notnull
choice3 text Notnull
choice4 text Notnull
answer text Notnull
programme varchar(50) Notnull
batch int(20) Notnull

Table 4.6: question table

Department of Computer Science 13


Christ College(Autonomous) Questra

scores
Name DataType Constraints
id int(10) Primarykey
username varchar(40) Notnull
regno varchar(30) Notnul
programme varchar(30) Notnull
total varchar(30) Notnull

Table 4.7: scores

Department of Computer Science 14


Christ College(Autonomous) Questra

Chapter 5

System Testing

Software testing is a critical element of software quality assurance and represents the ultimate
review of specification ,design and coding. Testing represents an interesting anomaly or the software.
Testing is vital to the success of the system. Errors can be injected at any state during development.
System testing makes a logical assumption that all the part of the system is correct,the goal will
be successfully achieved. During testing the program to be tested is executed with set of data and
the output of the program for the test data is evaluated to determine if the program is performing
as expected. A series of testing are performed for the proposed system before the system is ready
for user acceptance testing.

5.1 Unit Testing


Unit testing focuses verification effort on the smallest unit of the software design,the module this
s known as module testing. Since the proposed system has modules the testing is individually
performed on each module. Using the detailed design description as a guide, important control
paths are tested to uncover errors within the boundary of the module. This testing was carried
out during programming stage itself. In this testing step, each module is found to be working
satisfactorily as regards to the expected output from the module.

5.2 Integration Testing


Data can be test across an interface,one module can have effect on another, sub function when
combined may not produce the desired function. Integration testing is a systematic technique
for constructing the program structure while at the same time conducting test to uncover errors
associated within the interface.

5.3 Validation Testing


Validation testing can be defined in many ways, but a simple definition is that validation succeeds
the software functions in manner that is reasonably expected by the customer. Software validation
is achieved through a series of black box tests that demonstrates conformity with requirements.

Department of Computer Science 15


Christ College(Autonomous) Questra

5.4 Output Testing


After performing the validation testing, the next step is output testing of the proposed system.
Since no system could be useful if it does not produce the required output in the specific format.
The output generator is displayed by the system under consideration is tested by asking the users
about the format required by them. Here the output is considered in two ways; One is on screen
and the other is printed format. The output format on the screen is found to be correct as the
format was designed in the system design phase according to the user needs. As far as hardcopies
are considered, it goes in terms with the user requirement. Hence output testing does not results
any correction in the system.

5.5 White Box Testing


White Box testing is the test case design method that uses the control structure of the procedural
design to derive test cases. White Box testing of software is predicted on close examination of
procedural details.

5.6 Black Box Testing


Black Box testing focuses on the functional requirements of the software. It helps to find out errors
in incorrect or missing functions, interface errors, errors in data structures, performance errors and
initialization and termination errors. The Black Box testing is applied during the later stages for
the functional requirement evaluation.

Department of Computer Science 16


Christ College(Autonomous) Questra

Chapter 6

System Maintenance and Security

6.1 Maintenance
The maintenance phase of the software cycle is the time in which a software product forms useful
work. After a system is successfully implemented, it should be maintained in a proper manner.
System maintenance is an important aspect in the software development life cycle. The need for
maintenance is to make it adaptable to the changes in the environment. There may be social,
technical, and other environmental changes, which effects a system to be implemented. Software
produce enhancement that may provide new functional capabilities, improving administrator dis-
plays and mode of interaction, upgrading the performance characteristics of the system. So only
through proper system maintenance procedures, the system can be adapted to cop up with these
changes. Software maintenance is of course far more than “Finding mistakes”. We may define
maintenance by describing four activities. Those are undertaken after a program is released for use.
The first maintenance activity occurs because it is unreasonable to assume that software testing will
uncover all latent errors in a large software system. During the use of any large program, errors will
occur and be reported to the developer. The process that include that the diagnosis and correction
of one or more errors is called corrective maintenance. The second activity that contributes to a
definition of maintenance occurs because of the rapid change that is encountered in every aspects
of computing. Therefore adaptive maintenance is an activity that modifies software interface with
a changing environment is so common. After a system is successfully implemented, it should be
maintained in a proper manner. System maintenance is performing to make the system adaptable
to the changing environment.

6.1.1 Corrective Maintenance


In software testing user will not uncover the errors in the system. During the use of any large
program errors will occur and reported to the developer.

6.1.2 Adaptive Maintenance


It is an activity that modifies the entire system to properly interact with the changing environment.

Department of Computer Science 17


Christ College(Autonomous) Questra

6.1.3 Perfective Maintenance


It is performed to enhance the system by making modifications in the program to meet the users
changing needs.

6.2 System Security


Security involves both policies and mechanisms to protect the data and ensures that it is not ac-
cessed, altered or deleted without proper authorization. There are two dimensions for the protection
of data in the data base. The logged user can only perform the operations. This ensures that the
confidentiality of the data is maintained, second, the data must be protected from accidental or
intentional corruption or destruction. The security features are considered while developing the
system, so as to avoid the errors and omissions that may lead to serious problems. The system may
have to face the unwanted events called threats. A threat to a computer system is any events that
adversely affect the one or more assets or resources, which make up the system. An event can be
any of the following:

ˆ Interruption of communication

ˆ Destruction of hardware

ˆ Modification of software

ˆ Removal of programs.

ˆ Disclosure of information.

There are many methods for handling a threat.


ˆ Avoid it by altering the design.

ˆ Threat retention.

ˆ Threat reduction that is the frequency of occurrence of a threat is reduced.

The security measures of a computer system should be specified at an early stage in the design of
the system. During the system operation each user should understand the procedures required to
keep the system secure.
There are many possible threats to the security and integrity of any system where more than
one user is associated with the system. Software integrity has become increasingly important.
The attribute measures a system’s ability to withstand attacks, both accidental and intentional
on its security. Attacks can be made on all the three components of software: programs date and
documents.
In this project the data security, data validation checking methods are applied using a password
authentication. All the data, which is entered by the administrator, will be validated.

Department of Computer Science 18


Christ College(Autonomous) Questra

Chapter 7

Conclusion and Future Scope

7.1 Conclusion
A large number of participants, with instant results of your online quiz (for the creator as well as
the participants), a better overview, you’re able to randomize your questions and set a timer. That
all without the need of an instructor. What’s holding you back to not use online quizzes?

7.2 Future Scope


Following features can be upadated in Future
ˆ To increase the number of participants.

ˆ To add extra rounds.

ˆ Online verification of users can be included.

Department of Computer Science 19


Christ College(Autonomous) Questra

Appendix
A ER Diagram

Figure 1: ER diagram

Department of Computer Science 20


Christ College(Autonomous) Questra

B Data Flow Diagram

Figure 2: Level 0

Figure 3: Level 1 Host

Department of Computer Science 21


Christ College(Autonomous) Questra

Figure 4: Level 1 Participant

C Code
Index
<?php

//index.php

include(’master/Examination.php’);

$exam = new Examination;

include(’header.php’);

?>

<div class="containter">
<br />
<br />
<br />
<br />
<br />
<br />
<?php
if(isset($_SESSION["user_id"]))
{

Department of Computer Science 22


Christ College(Autonomous) Questra

?>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<select name="exam_list" id="exam_list" class="form-control input-lg">
<option value="">Select Exam</option>
<?php

echo $exam->Fill_exam_list();

?>
</select>
<br />
<span id="exam_details"></span>
</div>
<div class="col-md-3"></div>
</div>
<script>
$(document).ready(function(){

$(’#exam_list’).parsley();

var exam_id = ’’;

$(’#exam_list’).change(function(){

$(’#exam_list’).attr(’required’, ’required’);

if($(’#exam_list’).parsley().validate())
{
exam_id = $(’#exam_list’).val();
$.ajax({
url:"user_ajax_action.php",
method:"POST",
data:{action:’fetch_exam’, page:’index’, exam_id:exam_id},
success:function(data)
{
$(’#exam_details’).html(data);
}
});
}
});

$(document).on(’click’, ’#enroll_button’, function(){


exam_id = $(’#enroll_button’).data(’exam_id’);
$.ajax({

Department of Computer Science 23


Christ College(Autonomous) Questra

url:"user_ajax_action.php",
method:"POST",
data:{action:’enroll_exam’, page:’index’, exam_id:exam_id},
beforeSend:function()
{
$(’#enroll_button’).attr(’disabled’, ’disabled’);
$(’#enroll_button’).text(’please wait’);
},
success:function()
{
$(’#enroll_button’).attr(’disabled’, false);
$(’#enroll_button’).removeClass(’btn-warning’);
$(’#enroll_button’).addClass(’btn-success’);
$(’#enroll_button’).text(’Enroll success’);
}
});
});

});
</script>
<?php
}
else
{
?>
<div align="center">
<p><a href="register.php" class="btn btn-warning btn-lg">Register</a></p>
<p><a href="login.php" class="btn btn-dark btn-lg">Login</a></p>
<p><a href="hostregister.php" class="btn btn-dark btn-lg">Host Access</a></p>
</div>
<?php
}
?>
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</div>
</body>

</html>

Android

Department of Computer Science 24


Christ College(Autonomous) Questra

"mainactivity.xml"

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/grey"
android:layout_height="match_parent"
tools:context=".MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="110dp"
android:layout_centerInParent="true"
android:orientation="vertical">

<android.widget.Button
android:layout_width="match_parent"
android:layout_height="55dp"
android:text="Host"
android:gravity="center"
android:background="@drawable/buttonshape"
android:textColor="@color/orange"

android:textSize="20dp"
android:id="@+id/hostselection"
/>
<android.widget.Button
android:layout_width="match_parent"
android:layout_height="55dp"
android:text="Participant"
android:layout_marginTop="30dp"
android:gravity="center"
android:textColor="@color/orange"
android:background="@drawable/buttonshape"

android:textSize="20dp"
android:id="@+id/participantselection"
/>

Department of Computer Science 25


Christ College(Autonomous) Questra

</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:layout_height="50dp"
android:src="@drawable/logo"
android:layout_marginBottom="35dp"
></ImageView>
</RelativeLayout>

"MAINACTIVITY.JAVA"

package com.example.questra;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;

import java.util.Random;

public class MainActivity extends AppCompatActivity {

Button host,participant;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

host=findViewById(R.id.hostselection);
participant=findViewById(R.id.participantselection);

host.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this, Webview.class);
startActivity(intent);
}
});
participant.setOnClickListener(new View.OnClickListener() {

Department of Computer Science 26


Christ College(Autonomous) Questra

@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this, Webview.class);
startActivity(intent);
}
});
}

"WEBVIEW.XML"

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Webview">

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>

"WEBVIEW.JAVA"

package com.example.questra;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class Webview extends AppCompatActivity {

Department of Computer Science 27


Christ College(Autonomous) Questra

WebView w;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);

w = findViewById(R.id.webview);

WebSettings webSettings = w.getSettings();


webSettings.setJavaScriptEnabled(true);
w.loadUrl("http://grapestechs.com/christ_exam/exam/");
w.setWebViewClient(new WebViewClient());
}

@Override
public void onBackPressed() {
if (w.canGoBack()){
w.goBack();
} else {
super.onBackPressed();
}
}
}

Admin Login
<?php

//login.php

include(’master/Examination.php’);

$exam = new Examination;

$exam->user_session_public();

include(’header.php’);

?>

Department of Computer Science 28


Christ College(Autonomous) Questra

<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">
Verified The Details
</div>
’;
}
?>
</span>
<div class="card">
<div class="card-header"> 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="adminlogin" />
<input type="hidden" name="action" value="adminlogin" />
<input type="submit" name="user_login" id="user_login"
class="btn btn-info" value="Login" />
</div>
</form>
<div align="center">

</div>
</div>

Department of Computer Science 29


Christ College(Autonomous) Questra

</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_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=’adminindex.php’;
}
else
{

Department of Computer Science 30


Christ College(Autonomous) Questra

$(’#message’).html(’<div class="alert alert-danger">’+data.error+’


</div>’);
}

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

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

});

});

</script>

Admin Index
<?php

//index.php

include(’header1.php’);

?>

Register
<?php

//register.php

include(’master/Examination.php’);

$exam = new Examination;

$exam->user_session_public();

include(’header.php’);

Department of Computer Science 31


Christ College(Autonomous) Questra

?>

<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">

Department of Computer Science 32


Christ College(Autonomous) Questra

<label>Enter Mobile Number</label>


<input type="text" name="user_mobile_no"
id="user_mobile_no" class="form-control" />
</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;
}
});
}
});

Department of Computer Science 33


Christ College(Autonomous) Questra

$(’#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]+$’);

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)

Department of Computer Science 34


Christ College(Autonomous) Questra

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

$(’#user_register’).attr(’disabled’, false);

$(’#user_register’).val(’Register’);
}
})
}

});

});

</script>

Host Register
<?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>Host Registration</h4></div>
<div class="card-body">
<span id="message"></span>

Department of Computer Science 35


Christ College(Autonomous) Questra

<form method="post" id="host_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>

<br />
<div class="form-group" align="center">
<input type="hidden" name=’page’ value=’hostregister’ />
<input type="hidden" name="action" value="hostregister" />

Department of Computer Science 36


Christ College(Autonomous) Questra

<input type="submit" name="host_register"


id="host_register" class="btn btn-info" value="hostregister" />
</div>
</form>
<div align="center">
<a href="adminlogin.php">Host Login</a>
</div>
</div>
</div>
<br /><br />
<br /><br />
</div>
</div>

</body>

</html>

<script>

$(document).ready(function(){

$(’#host_register_form’).parsley();

$(’#host_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’);

Department of Computer Science 37


Christ College(Autonomous) Questra

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

if($(’#host_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()
{
$(’#host_register’).attr(’disabled’, ’disabled’);
$(’#host_register’).val(’please wait...’);
},
success:function(data)
{
if(data.success)
{
$(’#message’).html(’<div class="alert alert-success">Success</div>’);
$(’#host_register_form’)[0].reset();
$(’#host_register_form’).parsley().reset();
}

$(’#host_register’).attr(’disabled’, false);

$(’#host_register’).val(’Register’);
}
})
}

});

});

</script>

Department of Computer Science 38


Christ College(Autonomous) Questra

DB Connection
<?php
$objConnect = mysqli_connect("localhost","grapeste_root",
"gopi1234","grapeste_mydatabase") or die("connection error".mysqli_error());
//$objDB = mysql_select_db("grapeste_mydatabase") or
die("error in selection".mysql_error());
?>

Login
<?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>

Department of Computer Science 39


Christ College(Autonomous) Questra

<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’);

Department of Computer Science 40


Christ College(Autonomous) Questra

$(’#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>

Profile
<?php

//profile.php

Department of Computer Science 41


Christ College(Autonomous) Questra

include(’master/Examination.php’);

$exam = new Examination;

$exam->user_session_private();

include(’header.php’);

$exam->query = "
SELECT * FROM user_table
WHERE user_id = ’".$_SESSION[’user_id’]."’
";

$result = $exam->query_result();

?>

<div class="containter">
<div class="d-flex justify-content-center">
<br /><br />
<span id="message"></span>
<div class="card" style="margin-top:50px;margin-bottom: 100px;">
<div class="card-header"><h4>Profile</h4></div>
<div class="card-body">
<form method="post" id="profile_form">
<?php
foreach($result as $row)
{
?>
<script>
$(document).ready(function(){
$(’#user_gender’).val("<?php echo $row["user_gender"]; ?>");
});
</script>
<div class="form-group">
<label>Enter Name</label>
<input type="text" name="user_name" id="user_name" class="form-control"
value="<?php echo $row["user_name"]; ?>" />
</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>

Department of Computer Science 42


Christ College(Autonomous) Questra

</div>
<div class="form-group">
<label>Enter Address</label>
<textarea name="user_address" id="user_address" class="form-control">
<?php echo $row["user_address"]; ?></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" value="<?php echo $row["user_mobile_no"]; ?>" />
</div>
<div class="form-group">
<label>Select Profile Image - </label>
<input type="file" name="user_image" id="user_image"
accept="image/*" /><br />
<img src="upload/<?php echo $row["user_image"]; ?>"
class="img-thumbnail" width="250" />
<input type="hidden" name="hidden_user_image"
value="<?php echo $row["user_image"]; ?>" />
</div>
<br />
<div class="form-group" align="center">
<input type="hidden" name="page" value="profile" />
<input type="hidden" name="action" value="profile" />
<input type="submit" name="user_profile" id="user_profile"
class="btn btn-info" value="Save" />
</div>
<?php
}
?>
</form>
</div>
</div>
<br /><br />
<br /><br />
</div>
</div>

</body>

</html>

<script>

$(document).ready(function(){

Department of Computer Science 43


Christ College(Autonomous) Questra

$(’#profile_form’).parsley();

$(’#profile_form’).on(’submit’, function(event){

event.preventDefault();

$(’#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($(’#profile_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_profile’).attr(’disabled’, ’disabled’);
$(’#user_profile’).val(’please wait...’);
},
success:function(data)
{
if(data.success)
{
location.reload(true);
}
else
{
$(’#message’).html(’<div class="alert alert-danger">’+data.error+’</div>’);
}
$(’#user_profile’).attr(’disabled’, false);

Department of Computer Science 44


Christ College(Autonomous) Questra

$(’#user_profile’).val(’Save’);
}
});
}
});
});

</script>

Logout
<?php

//logout.php

session_start();

session_destroy();

header(’location:login.php’);

?>

Header
<!DOCTYPE html>
<html lang="en">
<head>
<title></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>

Department of Computer Science 45


Christ College(Autonomous) Questra

<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="view_exam0.php">Start 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 Password</a>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">Logout</a>
</li>
</ul>

Department of Computer Science 46


Christ College(Autonomous) Questra

</div>
</nav>

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

Header1
<?php
session_start();
?>
<html lang="en">
<head>
<title></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>

Department of Computer Science 47


Christ College(Autonomous) Questra

<?php
if(isset($_SESSION[’user_id’]))
{
?>
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
<a class="navbar-brand" href="index.php">Scheduler 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="scheduleexam.php">Schedule Exam</a>
</li>
<li class="nav-item">
<a class="nav-link" href="schedulequestions.php">Add Questions</a>
</li>
<li class="nav-item">
<a class="nav-link" href="listquestions.php">List All</a>
</li>
<li class="nav-item">
<a class="nav-link" href="setstatus.php">Manage Exam</a>
</li>
<li class="nav-item">
<a class="nav-link" href="listenrolled.php">Enrolled List</a>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">Logout</a>
</li>
</ul>
</div>
</nav>

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

Change Password
<?php

//change_password.php

include(’master/Examination.php’);

Department of Computer Science 48


Christ College(Autonomous) Questra

$exam = new Examination;

$exam->user_session_private();

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>Change Password</h4></div>
<div class="card-body">
<form method="post" id="change_password_form">
<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>
<br />
<div class="form-group" align="center">
<input type="hidden" name="page" value="change_password" />
<input type="hidden" name="action" value="change_password" />
<input type="submit" name="user_password" id="user_password"
class="btn btn-info" value="Change" />
</div>
</form>
</div>
</div>
<br /><br />
<br /><br />
</div>
</div>

</body>

</html>

Department of Computer Science 49


Christ College(Autonomous) Questra

<script>

$(document).ready(function(){

$(’#change_password_form’).parsley();

$(’#change_password_form’).on(’submit’, function(event){
event.preventDefault();

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

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

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

if($(’#change_password_form’).parsley().validate())
{
$.ajax({
url:"user_ajax_action.php",
method:"POST",
data:$(this).serialize(),
dataType:"json",
beforeSend:function()
{
$(’#change_password’).attr(’disabled’, ’disabled’);
$(’#change_password’).val(’please wait...’);
},
success:function(data)
{
if(data.success)
{
alert(data.success);
location.reload(true);
}
$(’#change_password’).attr(’disabled’, false);
$(’#change_password’).val(’Change’);
}
})
}
});

});

</script>

Department of Computer Science 50


Christ College(Autonomous) Questra

Schedule Exam
"mainactivity.xml"

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/grey"
android:layout_height="match_parent"
tools:context=".MainActivity">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="110dp"
android:layout_centerInParent="true"
android:orientation="vertical">

<android.widget.Button
android:layout_width="match_parent"
android:layout_height="55dp"
android:text="Host"
android:gravity="center"
android:background="@drawable/buttonshape"
android:textColor="@color/orange"

android:textSize="20dp"
android:id="@+id/hostselection"
/>
<android.widget.Button
android:layout_width="match_parent"
android:layout_height="55dp"
android:text="Participant"
android:layout_marginTop="30dp"
android:gravity="center"
android:textColor="@color/orange"
android:background="@drawable/buttonshape"

android:textSize="20dp"
android:id="@+id/participantselection"
/>

Department of Computer Science 51


Christ College(Autonomous) Questra

</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_alignParentBottom="true"
android:layout_height="50dp"
android:src="@drawable/logo"
android:layout_marginBottom="35dp"
></ImageView>
</RelativeLayout>

"MAINACTIVITY.JAVA"

package com.example.questra;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;

import java.util.Random;

public class MainActivity extends AppCompatActivity {

Button host,participant;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

host=findViewById(R.id.hostselection);
participant=findViewById(R.id.participantselection);

host.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this, Webview.class);
startActivity(intent);
}
});

Department of Computer Science 52


Christ College(Autonomous) Questra

participant.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MainActivity.this, Webview.class);
startActivity(intent);
}
});
}

"WEBVIEW.XML"

<?xml version="1.0" encoding="utf-8"?>


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Webview">

<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>

"WEBVIEW.JAVA"

package com.example.questra;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

Department of Computer Science 53


Christ College(Autonomous) Questra

public class Webview extends AppCompatActivity {

WebView w;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);

w = findViewById(R.id.webview);

WebSettings webSettings = w.getSettings();


webSettings.setJavaScriptEnabled(true);
w.loadUrl("http://grapestechs.com/christ_exam/exam/");
w.setWebViewClient(new WebViewClient());
}

@Override
public void onBackPressed() {
if (w.canGoBack()){
w.goBack();
} else {
super.onBackPressed();
}
}
}

Schedule Questions

<?php

//register.php
$objConnect = mysqli_connect("localhost","grapeste_root",
"gopi1234","grapeste_mydatabase") or die("connection error".mysql_error());
// $objDB = mysql_select_db("grapeste_mydatabase") or
die("error in selection".mysql_error());

include(’header1.php’);
$logged=$_SESSION[’user_id’];

Department of Computer Science 54


Christ College(Autonomous) Questra

?>

<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>Exam Schedule Addition</h4></div>
<div class="card-body">
<span id="message"></span>
<form method="post" id="user_register_form"
action="addchoiceprocess.php">
<div class="form-group">
<label>Enter Exam ID</label>

<select name="examtitle">;
<?php

$fetch_nurse_name = mysqli_query($objConnect,"SELECT DISTINCT online_exam_title


FROM online_exam_table where online_exam_code=’$logged’");

while($throw_nurse_name = mysqli_fetch_array($fetch_nurse_name)) {
echo ’<option value=’.$throw_nurse_name[0].’>’.$throw_nurse_name[0].’</option>’;
}
echo "</select>";
?>
</div>

<div class="form-group">
<label>Enter Level</label>
<select name="level">
<option value="1">1</option>
<option value="4">2</option>
<!--<option value="3">3</option>-->
<!--<option value="4">4</option>-->
</select>
</div>

<div class="form-group">
<label>Enter Question Title</label>

Department of Computer Science 55


Christ College(Autonomous) Questra

<input type="text" name="qtitle" id="qtitle"


class="form-control" />
</div>
<div class="form-group">
<label>Enter Option 1</label>
<input type="text" name="o1" id="o1" class="form-control" />
</div>
<div class="form-group">
<label>Enter Option 2</label>
<input type="text" name="o2" id="o2" class="form-control" />
</div>
<div class="form-group">
<label>Enter Option 3</label>
<input type="text" name="o3" id="o3" class="form-control" />
</div>
<div class="form-group">
<label>Enter Option 4</label>
<input type="text" name="o4" id="o4" class="form-control" />
</div>
<div class="form-group">
<label>Enter Correct Option</label>
<input type="text" name="c" id="c" class="form-control" />
</div>

</div>
<br />
<div class="form-group" align="center">
<input type="hidden" name=’page’ value=’examregister’ />
<input type="hidden" name="action" value="examregister" />
<input type="submit" name="user_register" id="user_register"
class="btn btn-info" value="Add Choices" />
</div>
</form>
<div align="center">

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

</body>

Department of Computer Science 56


Christ College(Autonomous) Questra

</html>

Add Choice Process


<?php

$b=$_POST[’examtitle’];

$d=$_POST[’qtitle’];
$e=$_POST[’o1’];
$f=$_POST[’o2’];
$g=$_POST[’o3’];
$h=$_POST[’o4’];
$i=$_POST[’c’];
$title1=1;
$title2=2;
$title3=3;
$title4=4;
$level=$_POST[’level’];
$status="created";

echo "examtitle: ".$b;


echo "<br>level: ".$level;

$objConnect = mysqli_connect("localhost","grapeste_root","gopi1234",
"grapeste_mydatabase") or die("connection error".mysql_error());
// $objDB = mysql_select_db("grapeste_mydatabase") or
die("error in selection".mysql_error());
// if($b=="4")
if($level=="4")
{
$q1="insert into level4(question,option1,option2,answer,programme,level)
values(’$d’,’$e’,’$f’,’$i’,’$b’,’$level’)";
}
else
{
$q1="insert into m1(question,choice1,choice2,choice3,choice4,answer,programme,batch)
values(’$d’,’$e’,’$f’,’$g’,’$h’,’$i’,’$b’,’$level’)";
}

$rr=mysqli_query($objConnect,$q1) or
die("query error: ".mysqli_error($objConnect));

Department of Computer Science 57


Christ College(Autonomous) Questra

if($rr) {

?>
<script language="javascript">alert(’Question added’);
window.location.replace(’adminindex.php’);</script>
<?php

}
else {
?>
<script language="javascript">alert(’Question adding failed’);
window.location.replace(’adminindex.php’);</script>
<?php
}

?>

List Questions
<?php
session_start();
include(’header1.php’);
$logged=$_SESSION[’logged’];
$examid=$_GET[’examtitle’];
//echo "title".$examid;
$objConnect = mysqli_connect("localhost","grapeste_root",
"gopi1234","grapeste_mydatabase") or die("connection error".mysql_error());
// $objDB = mysql_select_db("grapeste_mydatabase") or
die("error in selection".mysql_error());

?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Simple Responsive Admin</title>
<!-- BOOTSTRAP STYLES-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
<!-- FONTAWESOME STYLES-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
<!-- CUSTOM STYLES-->
<link href="assets/css/custom.css" rel="stylesheet" />
<!-- GOOGLE FONTS-->
<link href=’http://fonts.googleapis.com/css?family=Open+Sans’

Department of Computer Science 58


Christ College(Autonomous) Questra

rel=’stylesheet’ type=’text/css’ />


</head>
<body>

<div id="wrapper">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="adjust-nav">
<div class="navbar-header">
<button type="button" class="navbar-toggle"
data-toggle="collapse" data-target=".sidebar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">

</a>
</div>

<span class="logout-spn" >


<a href="#" style="color:#fff;">Home</a>

</span>
</div>
</div>
<!-- /. NAV TOP -->
<nav class="navbar-default navbar-side" role="navigation">
<div class="sidebar-collapse">
<ul class="nav" id="main-menu">

<a href="adminindex.php">Home</a>

</ul>
</div>

</nav>
<!-- /. NAV SIDE -->

<br><br>

<div id="page-wrapper" >


<div id="page-inner">
<div class="row">

Department of Computer Science 59


Christ College(Autonomous) Questra

<div class="col-md-12">
<h2 class="text-center">QUESTIONS </h2>

<table border="1"align="center">

<tr>
<td>Question ID</td>

<td>Question Title</td>

<td>C1</td> <td>C2</td> <td>C3</td> <td>C4</td>


<td>Delete</td>
</tr>

<?php

$status1="t";
$query1="select * from m1 where programme=’$examid’ order by qno desc";
// echo $query1;
$res1=mysqli_query($objConnect,$query1) or die("error".mysqli_error());
while($row1=mysqli_fetch_array($res1))
{
$id=$row1[’qno’];
$img=$row1[’question’];
$imgname=$row1[’choice1’];
$a=$row1[’choice2’];
$b=$row1[’choice3’];
$c=$row1[’choice4’];
?>
<tr><td><?php echo $id;?></td><td><?php echo $img;?></td><td>
<?php echo $imgname;?></td><td><?php echo $a;?></td><td>
<?php echo $b;?></td><td><?php echo $c;?></td><td>
<a href="deletequestions.php?id=<?php echo $id;?>">Delete</a></td></tr>
<?php

Department of Computer Science 60


Christ College(Autonomous) Questra

?>

</table>

</div>
</div>
<!-- /. ROW -->
<hr />

<!-- /. ROW -->


</div>
<!-- /. PAGE INNER -->
</div>
<!-- /. PAGE WRAPPER -->

<div id="page-wrapper" >


<div id="page-inner">
<div class="row">
<div class="col-md-12">
<h2 class="text-center">CHOICE QUESTIONS</h2>

<table border="1"align="center">

<tr>
<td>Question ID</td>

<td>Question Title</td>
<td>C1</td>
<td>C2</td>
<td>Correct Answer</td>
<td>Delete</td>
</tr>

<?php

Department of Computer Science 61


Christ College(Autonomous) Questra

$status1="t";
$query1="select * from level4 where programme=’$examid’
order by qno desc";
// echo $query1;
$res1=mysqli_query($objConnect,$query1) or die("error".mysqli_error());
while($row1=mysqli_fetch_array($res1))
{
$id=$row1[’qno’];
$q=$row1[’question’];
$a=$row1[’option1’];
$b=$row1[’option2’];
$answer=$row1[’answer’];
?>
<tr>
<td><?php echo $id;?></td>
<td><?php echo $q;?></td>
<td><?php echo $a;?></td>
<td><?php echo $b;?></td>
<td><?php echo $answer;?></td>
<td><a href="deletechoicequestions.php?id=<?php echo $id;?>">Delete
</a></td></tr>
<?php

?>

</table>

</div>
</div>
<!-- /. ROW -->
<hr />

<!-- /. ROW -->


</div>
<!-- /. PAGE INNER -->
</div>

Department of Computer Science 62


Christ College(Autonomous) Questra

</div>
<div class="footer">

<div class="row">
<div class="col-lg-12" >
</div>
</div>
</div>

<!-- /. WRAPPER -->


<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<!-- JQUERY SCRIPTS -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- CUSTOM SCRIPTS -->
<script src="assets/js/custom.js"></script>

</body>
</html>

Delete Questions
<?php
$objConnect = mysql_connect("localhost",
"grapeste_root","gopi1234") or die("connection error".mysql_error());
$objDB = mysql_select_db("grapeste_mydatabase") or
die("error in selection".mysql_error());
$id=$_GET[’id’];
$q0="delete from m1 where qno=’$id’";
mysql_query($q0);

?>
<script language="javascript">alert(’Deleted’);
window.location.replace(’adminindex.php’)</script>

Department of Computer Science 63


Christ College(Autonomous) Questra

Enroll Exam
<?php

//enroll_exam.php

include(’master/Examination.php’);

$exam = new Examination;

$exam->user_session_private();

$exam->Change_exam_status($_SESSION[’user_id’]);

include(’header.php’);
$logged=$_SESSION[’user_id’];
$objConnect = mysql_connect("localhost","grapeste_root","gopi1234")
or die("connection error".mysql_error());
$objDB = mysql_select_db("grapeste_mydatabase")
or die("error in selection".mysql_error());

?>

<br />
<div class="card">
<div class="card-header">Online Exam List</div>
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover"
id="exam_data_table">
<thead>
<tr>
<th>Exam Title</th>
<th>Date & Time</th>
<th>Duration</th>

<th>Status</th>
<th>Action</th>
</tr>
</thead>

<?php

Department of Computer Science 64


Christ College(Autonomous) Questra

$status1="t";
$query1="select * from user_exam_enroll_table where user_id=’$logged’";
echo "inside".$query1;
$res1=mysql_query($query1) or die("error".mysql_error());
while($row=mysql_fetch_array($res1))
{

$examid=$row[’exam_id’];
$q0="select * from online_exam_table where online_exam_id=’$examid’";
$res2=mysql_query($q0) or die("error".mysql_error());
echo "inside".$q0;
while($row1=mysql_fetch_array($res2))
{
$id=$row1[’online_exam_title’];
$img=$row1[’online_exam_datetime’];
$imgname=$row1[’online_exam_duration’];
$a=$row1[’online_exam_status’];
$b=$row1[’choice3’];
$c=$row1[’choice4’];
?>
<tr><td><?php echo $id;?></td><td><?php echo $img;?></td><td>
<?php echo $imgname;?></td><td><?php echo $a;?></td><td>
<a href="view_exam0.php?id=<?php echo $id;?>">Start</a></td></tr>
<?php

?>

</table>
</div>
</div>
</div>
</div>
</body>
</html>

Department of Computer Science 65


Christ College(Autonomous) Questra

Delete Enrolled
<?php
$objConnect = mysql_connect("localhost","grapeste_root","gopi1234")
or die("connection error".mysql_error());
$objDB = mysql_select_db("grapeste_mydatabase")
or die("error in selection".mysql_error());
$id=$_GET[’id’];
$q0="delete from user_exam_enroll_table where user_id=’$id’";
mysql_query($q0);

?>
<script language="javascript">alert(’Deleted’);
window.location.replace(’adminindex.php’)</script>

View Exam
<?php
$objConnect = mysqli_connect("localhost","grapeste_root","gopi1234",
"grapeste_mydatabase") or
die("connection error".mysqli_error());
// $objDB = mysql_select_db("grapeste_mydatabase") or
die("error in selection".mysql_error());

//error_reporting(E_ALL ^ E_NOTICE);
session_start();
$username=$_SESSION[’user_id’];
//$username=$_GET[’user_id’];
$bat=1;
$_SESSION[’username’]=$username;
echo $username;
//$batch=$_SESSION[’batch’];
$pro=$_GET[’programme’];
$_SESSION[’pro1’]=$pro;
$pro1=$_SESSION[’pro1’];
//$batch=$_SESSION[’batch’];
//rogramme=$_SESSION[’programme’];
//echo "logged".$username;
//echo "session".$SESSION[’’]

Department of Computer Science 66


Christ College(Autonomous) Questra

$stati="started";
$sqll="select * from online_exam_table where online_exam_status!=’$stati’ and
online_exam_title=’$pro’";
$resultl=mysqli_query($objConnect,$sqll)
or die(’error in selection’.mysqli_error());
if($ll=mysqli_fetch_array($resultl))
{

?>
<script>window.location.replace(’errorpage.html’);</script>

<?php
}
//$objConnect = mysqli_connect("localhost","root","","satdb") or
die("connection error".mysql_error());
//$objDB = mysql_select_db("satdb") or die("error in selection".mysql_error());
$q0="delete from answers where user=’$username’";
mysqli_query($objConnect,$q0);
//error_reporting(0);

$page=$_GET[’page’];
//echo "page is".$page;
if($page==""||$page==NULL||$page=="0")
{
$page=0;
}
$_SESSION["page_" . $page][’usr’]=$_SESSION[’username’];
$_SESSION["page_" . $page][’sb’]="l";
$tablename=$_SESSION["page_" . $page][’sb’];
$_SESSION["page_" . $page][’usr’];
$_SESSION["page_" . $page][’sb’];
//echo "ff".$table;

$totalscore=10;

$sql = "select * from m1 where programme=’$pro’ order by qno LIMIT $page,1";


$r=mysqli_query($objConnect,$sql) or die(’errorr in’.mysqli_error());
$row=mysqli_fetch_array($r);
$qid=$row[’qno’];
$qn= $row[’question’];
$_SESSION["page_" . $page][’opta’]=$row[’choice1’];
$_SESSION["page_" . $page][’optb’]=$row[’choice2’];
$_SESSION["page_" . $page][’optc’]=$row[’choice3’];
$_SESSION["page_" . $page][’optd’]=$row[’choice4’];
if(isset($_POST[’answer’])){

Department of Computer Science 67


Christ College(Autonomous) Questra

$_SESSION["page_" . $page][’useranswer’]=$_POST[’answer’];
echo "answer".$_POST[’answer’];

}
$answer=$row[’answer’];
?>
<html>
<head>
<meta charset="utf-8">
<title>Exam</title>
<meta name="author" content="webzclub" />
<meta name="audience" content="all" />
<link href="style/css.css" rel="stylesheet" type="text/css">
<script>
var myVar;

function myFunction() {
myVar = setTimeout(alertFunc,1200000);
}

function alertFunc() {
alert("Your time has finished!!!!!");
window.location.replace(’examindex.php’);
}
</script>
</head>
<body class="header_style" onload="myFunction()">
<form name="attendexam" action="" method="post"><b>

<div class="questions" style="margin-top: 20px;height: 533px;width: 600px">


<div class="question fl" style="height: 133px;width: 600px"><span>
<br><br><center>Q
<?php
echo $page+1; ?>)<?php echo $qn ;?></center></span></div>
<div class="options fl">
<div class="optionset fl">
<div class="optionItem fl">
<span> <input type="radio" name="answer"
value="<?php echo $_SESSION["page_" . $page][’opta’] ;?>"

Department of Computer Science 68


Christ College(Autonomous) Questra

<?php if($_SESSION["page_" . $page]


[’useranswer’]==$_SESSION["page_" . $page][’opta’]) echo "checked=checked"; ?>>
<?php echo $_SESSION["page_" . $page][’opta’] ;?></span>
</div>
<div class="optionItem fl">
<span><input type="radio" name="answer"
value="<?php echo $_SESSION["page_" . $page][’optb’] ;?>"
<?php if($_SESSION["page_" . $page]
[’useranswer’]==$_SESSION["page_" . $page][’optb’]) echo "checked=checked"; ?>>
<?php echo $_SESSION["page_" . $page][’optb’] ;?></span>
</div>
</div>
<div class="optionset fl">
<div class="optionItem fl">
<span> <input type="radio" name="answer"
value="<?php echo $_SESSION["page_" . $page][’optc’] ;?>"
<?php if($_SESSION["page_" . $page]
[’useranswer’]==$_SESSION["page_" . $page][’optc’]) echo "checked=checked"; ?> >
<?php echo $_SESSION["page_" . $page][’optc’] ;?></span>
</div>
<div class="optionItem fl">
<span><input type="radio" name="answer"
value="<?php echo $_SESSION["page_" . $page][’optd’] ;?>"
<?php if($_SESSION["page_" . $page]
[’useranswer’]==$_SESSION["page_" . $page][’optd’]) echo "checked=checked"; ?> >
<?php echo $_SESSION["page_" . $page][’optd’] ;?></span>
</div>
<CENTER><input type="submit" name="attend" value="save"
style="height:50px; width:150px "></CENTER>

<br><br><br>
<?php
$prevpage=$npage=$page;
if($prevpage!=0)
{
--$prevpage;
?>

<?php
}
?>
<a href="view_exam0.php?page=<?php echo $prevpage;?>
&tab=&username=<?php echo $username;?>
&batch=<?php echo $bat;?>&programme=<?php echo $pro1;?>">
<img src="previous.jpg" width="150"></a>

Department of Computer Science 69


Christ College(Autonomous) Questra

<?php
if($npage<=$totalscore)
{
$npage++;
?>

<?php
}
?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
<a href="view_exam0.php?page=<?php echo $npage ;?>&tab=&username=<?php
echo $username;?>
&batch=<?php echo $bat;?>&programme=<?php echo $pro1;?>">
<img src="next.jpg" width="150"></a>
<input type="hidden" value="<?php echo $page;?>" name="hpage">

</div>

</div>

</b>
</form>
</body>
</html>

<?php
if($page==$totalscore)
{
echo "page:".$page;
echo "score:".$totalscore;
?>

<?php

Department of Computer Science 70


Christ College(Autonomous) Questra

}
if($page==$totalscore)
{

$page=0;
?>
<!--<center><a href="examindex.php?username=<?php echo $_SESSION[’username’];?>">
<b>logout</b></a></center>-->
<?php
for($i=0;$i<$totalscore;$i++)
{
$sql2 = "select * from m1 where programme=’$pro’ order by qno LIMIT $page,1";
//echo "query".$sql2;
$r2=mysqli_query($objConnect,$sql2)or die(’errorr in’.mysqli_error());
if($row=mysqli_fetch_array($r2))
{
$ca=$row[’answer’];
// echo "correct answer".$ca;
$question=$row[’alt3’];
$ua= $_SESSION["page_" . $page][’useranswer’];
//echo "user answer".$ua;
$page++;
$a= $_SESSION["page_" . 0][’usr’];
$b=$_SESSION["page_" . 0][’sb’];
$batch=$_SESSION[’batch’];
$programme=$_SESSION[’programme’];
$regno=$_SESSION[’regno’];
$sql = "INSERT INTO ‘answers‘(questionid,user,subject,userans,realans,batch,
programme,regno)
VALUES (’$i’,’$username’,’$b’,’$ua’,’$ca’,’$batch’,’$programme’,’$regno’)";
//echo "query".$sql;
$r=mysqli_query($objConnect,$sql) or die(mysqli_error());

}
}
$total=0;

// $username=$_GET[’register’];
// echo $username;
$sqll="select * from answers where user=’$username’ and regno=’$regno’";
$resultl=mysqli_query($objConnect,$sqll)
or die(’error in selection’.mysqli_error());
while($ll=mysqli_fetch_array($resultl))
{

Department of Computer Science 71


Christ College(Autonomous) Questra

if($ll[’userans’]==$ll[’realans’])
{$total++;
}
}
$sqll = "INSERT INTO ‘scores‘(username,regno,programme,total)
VALUES (’$username’,’$regno’,’$programme’,’$total’)";
//echo "query".$sql;
$rl=mysqli_query($objConnect,$sqll) or die(mysqli_error());
echo "ds";
?>

<script language="javascript">
window.location.replace(’viewresult.php?id=<?php echo $username;?>
&&program=<?php echo $pro;?>’)</script>
<?php
// header(’location:viewresult.php?username=’.$_SESSION[’username’].’’);
}
?>

Result
<?php
session_start();
$objConnect = mysqli_connect("localhost","grapeste_root","gopi1234",
"grapeste_mydatabase") or die("connection error".mysqli_error());
// $objDB = mysql_select_db("grapeste_mydatabase")
or die("error in selection".mysql_error());

$username=$_GET[’username’];
$batch=$_GET[’batch’];
echo $username;
echo "<table border=’2’>
<tr>
<td>Question Number</td>
<td>User Answer</td>
<td>Correct Answer</td>
<td>Status</td>
</tr>";
$sqls = "select totalscore from admin";
$rs=mysqli_query($objConnect,$sqls)
or die(’errorr in’.mysqli_error());
$rows=mysqli_fetch_array($rs);
$totalscore=$rows[’totalscore’];
$sql="select * from answers where user=’$username’ order by batch asc";
$result=mysqli_query($objConnect,$sql) or die(’error in selection’.mysqli_error());
$score=0;
while($line=mysqli_fetch_array($result))

Department of Computer Science 72


Christ College(Autonomous) Questra

{
echo "<tr>";
echo "<td>";
echo $line[’questionid’];
echo "</td>";
echo "<td>";
echo $line[’userans’];
echo "</td>";
echo "<td>";
echo $line[’realans’];
echo "</td>";
if($line[’userans’]==$line[’realans’])
{$status="Correct";
$score++;
}
else
{$status="wrong";
}
echo "<td>";
echo $status;
echo "</td>";

}
echo "<tr><td><b>Score</td><td>$score;</b></td></tr></table>";

?>

PDF Exam Result


<?php

//pdf_exam_result.php

include(’master/Examination.php’);

require_once(’class/pdf.php’);

$exam = new Examination;

if(isset($_GET["code"]))
{
$exam_id = $exam->Get_exam_id($_GET["code"]);

Department of Computer Science 73


Christ College(Autonomous) Questra

$exam->query = "
SELECT * FROM question_table
INNER JOIN user_exam_question_answer
ON user_exam_question_answer.question_id = question_table.question_id
WHERE question_table.online_exam_id = ’$exam_id’
AND user_exam_question_answer.user_id = ’".$_SESSION["user_id"]."’
";

$result = $exam->query_result();

$output = ’
<h3 align="center">Exam Result</h3>
<table width="100%" border="1" cellpadding="5" cellspacing="0">
<tr>
<th>Question</th>
<th>Your Answer</th>
<th>Answer</th>
<th>Result</th>
<th>Marks</th>
</tr>
’;

$total_mark = 0;

foreach($result as $row)
{
$exam->query = "
SELECT * FROM option_table
WHERE question_id = ’".$row["question_id"]."’
";

$sub_result = $exam->query_result();

$user_answer = ’’;
$orignal_answer = ’’;
$question_result = ’’;

if($row["marks"] == ’0’)
{
$question_result = ’Not Attend’;
}

if($row["marks"] > ’0’)


{
$question_result = ’Right’;
}

Department of Computer Science 74


Christ College(Autonomous) Questra

if($row[’marks’] < ’0’)


{
$question_result = ’Wrong’;
}

$output .= ’
<tr>
<td>’.$row["question_title"].’</td>
’;

foreach($sub_result as $sub_row)
{
if($sub_row["option_number"] == $row["user_answer_option"])
{
$user_answer = $sub_row["option_title"];
}

if($sub_row["option_number"] == $row["answer_option"])
{
$orignal_answer = $sub_row["option_title"];
}
}
$output .= ’
<td>’.$user_answer.’</td>
<td>’.$orignal_answer.’</td>
<td>’.$question_result.’</td>
<td>’.$row["marks"].’</td>
</tr>
’;
}

$exam->query = "
SELECT SUM(marks) as total_mark FROM user_exam_question_answer
WHERE user_id = ’".$_SESSION[’user_id’]."’
AND exam_id = ’".$exam_id."’
";

$marks_result = $exam->query_result();

foreach($marks_result as $row)
{
$output .= ’
<tr>
<td colspan="4" align="right">Total Marks</td>
<td align="right">’.$row["total_mark"].’</td>

Department of Computer Science 75


Christ College(Autonomous) Questra

</tr>
’;
}
$output .= ’</table>’;

$pdf = new Pdf();

$pdf->set_paper(’letter’,’landscape’);

$file_name = ’Exam Result.pdf’;

$pdf->loadHtml($output);

$pdf->render();

$pdf->stream($file_name, array("Attachment" => false));


exit(0);
}

?>

Department of Computer Science 76


Christ College(Autonomous) Questra

D User Interfaces

Figure 5: Home Page

Department of Computer Science 77


Christ College(Autonomous) Questra

Figure 6: User/Host Home Page

Department of Computer Science 78


Christ College(Autonomous) Questra

Figure 7: Host Registration

Department of Computer Science 79


Christ College(Autonomous) Questra

Figure 8: Host Login

Department of Computer Science 80


Christ College(Autonomous) Questra

Figure 9: Host Menu

Department of Computer Science 81


Christ College(Autonomous) Questra

Figure 10: Exam Schedule

Department of Computer Science 82


Christ College(Autonomous) Questra

Figure 11: Exam Schedule

Department of Computer Science 83


Christ College(Autonomous) Questra

Figure 12: Exam Status

Department of Computer Science 84


Christ College(Autonomous) Questra

Figure 13: Exam Status

Department of Computer Science 85


Christ College(Autonomous) Questra

Figure 14: Participant Registration

Department of Computer Science 86


Christ College(Autonomous) Questra

Figure 15: Participant Login

Department of Computer Science 87


Christ College(Autonomous) Questra

Figure 16: Exam Selection

Department of Computer Science 88


Christ College(Autonomous) Questra

Figure 17: Participant Menu

Department of Computer Science 89


Christ College(Autonomous) Questra

Figure 18: Home Page

Department of Computer Science 90


Christ College(Autonomous) Questra

Figure 19: Host Registration

Department of Computer Science 91


Christ College(Autonomous) Questra

Figure 20: Host Login

Department of Computer Science 92


Christ College(Autonomous) Questra

Figure 21: Participant Registration

Department of Computer Science 93


Christ College(Autonomous) Questra

Figure 22: Participant login

Department of Computer Science 94

You might also like