Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
17 views96 pages

Campus Chat Bot

The project report on 'Campus Chatbot' outlines the development of a chatbot aimed at enhancing student learning experiences in Indian higher education. It details the project's objectives, system analysis, feasibility studies, and the advantages of implementing chatbot technology over existing systems. The report also discusses the Waterfall model as the chosen software development lifecycle approach for the project.

Uploaded by

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

Campus Chat Bot

The project report on 'Campus Chatbot' outlines the development of a chatbot aimed at enhancing student learning experiences in Indian higher education. It details the project's objectives, system analysis, feasibility studies, and the advantages of implementing chatbot technology over existing systems. The report also discusses the Waterfall model as the chosen software development lifecycle approach for the project.

Uploaded by

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

PROJECT REPORT ON

“Campus chat bot”

Master of Computer Applications/M.Sc Computer Science

Submitted by
VIDYA SHREE S 23MCAB36
MANNA AN CHERIYAN 23MCAB17

Under the guidance of


Mr. Mariyan Richard

1
CERTIFICATE

This is to certify that the project titled “Campus chat bot” has been
satisfactorily completed by Ms. VIDYA SHREE S with Reg No. 23MCAB36
in partial fulfillment of the requirements for ECP Project Lab with course
code MCC2P2B21, for the 3nd Semester MCA course during the academic
year 2023-2024 as prescribed by Bangalore North University.

Faculty In-charge Head of the Department

Valued by

Examiner 1:_______________________ Date :

Examiner 2:_______________________ Centre: Kristu Jayanti


College

2
ACKNOWLEDGEMENT

First of all, we would like to thank the God Almighty for all the blessings he has showered on
us. Our spiritual quotient gave us more strength and motivation that helped immensely.

We would like to thank Rev. Fr. Dr. Augustine George, our esteemed Principal, for providing
us their constant guidance and support. I would also like to thank Rev. Fr. Lijo P Thomas,
our Vice-Principal, for providing us with the best facilities.

We are extremely thankful to our Dr. Kumar R, Head, Department of Computer Science (PG)
for giving us the essential support in the form of allocating comfortable project hours and
necessary software resources.

We would like to extend our heartfelt thanks to Ms. Divya M O, our project guide for providing
us the necessary details related to project development and process identification enabling us to
finish the project within the stipulated time.

We thank all other faculty members who helped us a lot in completing this project.

We thank our class mates, who have pointed out errors and guided us a lot and we thank each
and every one who has helped us.

We express our sincere thanks to Ms. Sindu PM, Mr. Hebin Layola, Ms. Fincy Cyriac and Ms.
Sruthi N, lecturers of department of BCA, for their valuable suggestions during the course of
this project. Their critical suggestions helped me to improve the project work.

Acknowledging the efforts of everyone, their chivalrous help in the course of the project
preparation and their willingness to collaborate with the work, their magnanimity through
lucid technical details lead to the successful completion of my project.

We would like to express my sincere thanks to all my friends, colleagues, parents and all
those who have directly or indirectly assisted during this work

3
CONTENTS
chapters contents Page no:

1 Introduction 10

1.1 Model 12

2 System Analysis 16

2.1 Introduction to system analysis 17

2.2 Existing System 17

2.3 Proposed System 17

2.4 Feasibility studies 18

2.4.1 Economical feasibility 19

2.4.2 Technical feasibility 19

2.4.3 Behavioural feasibilty 20

2.5 System Specifications 20

2.5.1 Software Specifications 20

2.5.2 Hardware specifications 21

2.6 Identification of Actors 22

2.7 Identification of use cases 22

2.7.1 Use case for the actor Administrator 23

2.7.2 Use case for the actor Teacher 23

2.7.3 Use case for the actor Students 24

2.8 Use case Diagrams 25

3 System Design 28

3.1 System Design- Introduction 29

3.2 Database Design 30

3.3 Table Design 31

4
3.4 Data Flow Diagrams 38

3.5 ER Diagrams 46

4 Coding 48

4.1 Input Interface 49

4.2 Output Interface 49

4.3 Technical Specifications 49

4.3.1 HTML 49

4.3.2 CSS 52

4.3.3 JavaScript 55

4.3.4 Android 57

4.3.5 JAVA 61

4.3.6 Python 64

4.3.7 MySQL 64

4.3.8 Pycharm 65

4.3.9 Flask 66

5 Coding pages 67

6 System Testing 84

6.1 Testing and Evaluation 85

6.2 Testing Strategies 86

6.3 Testing Techniques 87

6.3.1 White box testing 87

6.3.2 Blackbox testing 87

6.3.3 Unit testing 88

6.3.4 Integration testing 88

6.3.5 Acceptance testing 89

6.3.6 Output testing 89


5
7 System implementation & deployment 90

8 Conclusion 91

8.1 Future Enhancement 92

9 Reference 93

10 Appendix 94

1.INTRODUCTION

6
Today, every organisation depends on Information and Communication Technology (ICT) for
the efficient service delivery and cost-effective application of technological resources. With
growing preference towards faster services and acceptance of Artificial Intelligence (AI) based
tools in business operations globally as well as in India, the global Chatbot market is going to
accelerate in the next decade. In the era of AI, the Chatbot market is witnessing extraordinary
growth with the increased demand for smartphones and increased use of messaging
applications. In the past few years, the food delivery business, finance and the Ecommerce
industry have embraced Chatbot technology. One of the industries which can really benefit
from using this technology is the educational sector. Education can benefit from Chatbot
development. It can improve productivity, communication, learning, efficient teaching
assistance, and minimize ambiguity from interaction. A new education platform can solve
nextlevel problems in education using this technology as the engagement tool. The aim of this
research paper is to find out the factors which affect the adoption of Chatbot technology in
order to enhance the student learning experience in the Indian higher education sector. In this
research, a Quantitative method is used through data collection from surveys of some of the
prominent higher education institutes using Chatbot technology in India. It is expected that the
research outcome will help Chatbot developers and higher education providers to better
understand

OBJECTIVES
➢ This Program is able to simulate a conversation with the user using natural language
through messaging platforms, phone applications and websites.

➢ Users interact with Chat bots that have a conversational user interface (CUI), which
allows users to interact with the bot.

1.1 MODEL:

Waterfall approach was first SDLC Model to be used widely in Software Engineering to
ensure success of the project. In "The Waterfall" approach, the whole process of software

7
development is divided into separate phases. In this Waterfall model, typically, the outcome
of one phase acts as the input for the next phase sequentially

Waterfall Model - Design:

In "The Waterfall" approach, the whole process of software development is divided into
separate phases. In this Waterfall model, typically, the outcome of one phase acts as the input
for the next phase sequentially. Following is the pictorial representation of Iterative and
Incremental model:

The sequential phases in Waterfall model are –

● Requirement Gathering and analysis − All possible requirements of the system to


be developed are captured in this phase and documented in a requirement
specification document.

● System Design − The requirement specifications from first phase are studied in this
phase and the system design is prepared. This system design helps in specifying

8
hardware and system requirements and helps in defining the overall system
architecture.

● Implementation − With inputs from the system design, the system is first developed
in small programs called units, which are integrated in the next phase. Each unit is
developed and tested for its functionality, which is referred to as Unit Testing.

● Integration and Testing − All the units developed in the implementation phase are
integrated into a system after testing of each unit. Post integration the entire system is
tested for any faults and failures.

● Deployment of system − Once the functional and non-functional testing is done; the
product is deployed in the customer environment or released into the market.

● Maintenance − There are some issues which come up in the client environment. To
fix those issues, patches are released. Also to enhance the product some better
versions are released. Maintenance is done to deliver these changes in the customer
environment.

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

Waterfall Model - Application:


Every software developed is different and requires a suitable SDLC approach to be followed
based on the internal and external factors. Some situations where the use of Waterfall model
is most appropriate are −

● Requirements are very well documented, clear and fixed.

● Product definition is stable.

● Technology is understood and is not dynamic.

9
● There are no ambiguous requirements.

● Ample resources with required expertise are available to support the product.

● The project is short.

The advantages of the waterfall model SDLC Model are as follows:

The advantages of waterfall development are that it allows for departmentalization and
control. A schedule can be set with deadlines for each stage of development and a product can
proceed through the development process model phases one by one.

Development moves from concept, through design, implementation, testing, installation,


troubleshooting, and ends up at operation and maintenance. Each phase of development
proceeds in strict order.

Some of the major advantages of the Waterfall Model are as follows −

● Simple and easy to understand and use

● Easy to manage due to the rigidity of the model. Each phase has specific deliverables
and a review process.

● Phases are processed and completed one at a time.

● Works well for smaller projects where requirements are very well understood.

● Clearly defined stages.


● Well understood milestones.

● Easy to arrange tasks.

● Process and results are well documented.

The disadvantages of the waterfall model SDLC Model are as follows:

The disadvantage of waterfall development is that it does not allow much reflection or
revision. Once an application is in the testing stage, it is very difficult to go back and change
something that was not well-documented or thought upon in the concept stage.
10
The major disadvantages of the Waterfall Model are as follows − ● No

working software is produced until late during the life cycle.

● High amounts of risk and uncertainty.

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

● Poor model for long and ongoing projects.

● Not suitable for the projects where requirements are at a moderate to high risk of
changing. So, risk and uncertainty is high with this process model.

● It is difficult to measure progress within stages.

● Cannot accommodate changing requirements.

● Adjusting scope during the life cycle can end a project.

● Integration is done as a "big-bang. at the very end, which doesn't allow identifying
any technological or business bottleneck or challenges early.

2. SYSTEM ANALYSIS

2.1 INTRODUCTION TO SYSTEM ANALYSIS

System analysis is the process of collecting and interpreting facts, understanding problems
and using the information to suggest improvement on the system. This will help to understand
the existing system and determine how computers make its operation more effective. The aim
of this analysis is to collect detailed information on the system and the feasibility study of the
proposed system.

2.2 EXISTING SYSTEM

11
At present the higher educational institutions of India are providing information via websites.
Most of the institutions have their own website with numerous data and information. But
disadvantage of having such websites is information overload. It is very hard to find out the
particular data we are looking for from the large websites. If we are looking at a website to
figure out facts, its take too much time when compared to the chatbots. Sometimes the user is
looking for a single line information ,but looking on website cause reading through
paragraphs to find out that data.

Following are the major disadvantages of existing systems:

• Hard to find quality contents.


• Customer dissatisfaction.
• Users are forced to watch Ads.

• Time consuming

2.3 PROPOSED SYSTEM


With chatbot technology, institutions can meet the needs and expectations of today’s students.
Chatbots are available 24*7 and can provide information quickly and in many languages,
making them useful at institutions across the globe. And advances in natural language
processing (NLP) have enabled computer-based applications to better interpret languages.
Technological advancement has enabled organizations to conduct their daily businesses in an
effective and efficient manner. The information and communication technology have been
adopted to facilitate effective and timely delivery of services in different public and private
sections in India including higher education. It has been established that Chatbot development
can improve learning, communication, and productivity, as well as provide efficient teaching

assistance and minimize ambiguity. Consequently, this study aims at establishing the factors
which affect the adoption of Chatbot technology to enhance the student experience in the

Indian higher education sector.

Advantages of proposed system over existing system:


• A truly personalised user experience.
• Re-engage with users in a relevant way
12
• A better and faster experience
• Balance automation with human touch
• Increase conversation rates
• Time saving to users when compared to websites

2.4 Feasibility Study


Feasibility study is made to see if the project on completion will serve the purpose of the
organization for the amount of work, effort and the time that spent on it. Feasibility study lets
the developer foresee the future of the project and the usefulness.

Feasibility study is a test of system proposed regarding its workability, impact on the
organization, ability to meet the needs and effective use of resources. Thus when a new
project is proposed, it normally goes through a feasibility study before it is approved for
development.

The document provide the feasibility of the project that is being designed and lists various
areas that were considered very carefully during the feasibility study of this project such as
technical, economical and behavioral feasibilities.
The proposed system is theoretically investigated to check the feasibility and found
that they are more reliable and efficient in the cases given below. There are three aspects in
the feasibility study portion of the preliminary investigation.

✓ Economic feasibility

✓ Technical feasibility

✓ Behavioural feasibility

The proposed system must be evaluated from a technical point of view first,

and if technical feasible their impact on the organization must be assessed. If compatible, the
operational system can be devised. Then they must be tested for economic feasibility.

13
2.4.1 Economic Feasibility

The developing system must be justified by cost and benefit. Criteria to ensure that effort is
concentrated on project, which will give best, return at the earliest. One of the factors which
affect the development of a new system is the cost it would require. Since the system
developed as part of project work, there is no manual cost to spend for the proposed system.
Also all the resources are already available, it give an indication of the system is
economically possible for development.

2.4.2 Technical Feasibility

The system must be evaluated from the technical point of view first. The assessment of this
feasibility must be based on an outline design of the system requirement in the terms of input,
output, programs, procedures, and staff. Having identified an outline system, the investigation
must go on suggest the type of equipment, required method developing the system, of running
the system once it has been designed. The project should be developed such that the
necessary functions and performance are achieved within the constraints. The project is
developed within latest technology.
Though the technology become obsolete after some period, due to the fact that newer
version of some software supports older versions, the system still be used. So there are only
minimal constraints involved with this project. The system has been developed using C#
and .NET, along with the database software SQL server, thus we could conclude that the
project is technically feasible for development.

2.4.3 Behavioural Feasibility

People are inherently resistant to change and computers have been known to facilitate change.
The System is designed in user friendly manner and we need to provide any special training
for the persons using this software. The operating system used is Windows 10, which is also
user friendly. Since the application is web biased and can easily accessed in a web browser,
which is quite familiar to the intended users, it does not have any operational barriers. So, no
need to provide any special training for using this application software and hence it is
behaviourally feasible.

14
2.5 System Specifications
System Specification deals with the technical aspects the project has to meet in minimum to
work successfully. This also includes the different aspects the software requirement is
determined from. The technical details typically include:

⮚ Software Specification
⮚ Hardware Specification

2.5.1 Software Specifications

The software required for the application depends on the following factors:

✔ The flexibility of the software


✔ Software contracts
✔ Limitation of the software

Software Requirement

This specifies the minimum software requirements for implementing the system. This
includes:

⮚ Front end: - HTML, CSS, Python 3.9


⮚ Back end: - SQL
⮚ Client side: - Java Script
⮚ Server-side scripting: - Python
⮚ Platform: -Flask
⮚ Operating System: -Microsoft windows 10/11

2.5.2 Hardware Specifications

The software required for the application depends on the following factors:

✔ Determining size and capacity requirements.


✔ Computer evaluation and measurement.

15
✔ Financial factors.
✔ Maintenance and support.

Hardware Requirement

⮚ Microprocessor: Any 64-bit processor.


⮚ Clock speed: - 2.13GHz
⮚ Ram: 1 GB and above
⮚ Hard disk: 40 GB and above

⮚ Keyboard: - standard keyboard


⮚ Mouse: Standard mouse
⮚ Connectivity: - LAN & Wi-Fi

2.6 Identification of Actors


A use cases represents the functionality of an actor. It is defined as a set of actions performed
by a system, which yields an observable result. An ellipse containing its name inside the
ellipse or below it represents. it. It is placed inside the system boundary and connected to an
actor with an association. This shoes how the use cases and the actor interact.

We can identify the actors through a list of questions. The answers to these questions bring
out the actors of the system is.

• Admin
• Teacher
• Student
Here we need to specify the use cases of each actor.

2.7 Identification of use cases


A use case represents the functionality of an actor. It is defined as a set of actions performed
by a system, which yield an observable result. An ellipse containing its name inside the
ellipse or below it represents it. It is placed inside the system boundary and connected to an
actor with an association. This shows how the use cases and the actor interact.

16
To find out the use cases, ask the following questions to each of the actors.

✓ Which functions does the actor require from the system? What does the actor need to
do?
✓ Does the actor need to read, create, destroy, modify or store some kind of
information in the system?
✓ Does the actor have to calculate something? And want to provide information for
others?
✓ Could the actor's daily work be simplified or made more efficient by adding new
functions to the system (typically functions which are currently not automated in the
system)?

2.7.1 Use cases for the actor Administrator

1) Login:
i) The first step involved
is login. The admin
can login to the
website using
username and
password.

2) Manage Teachers.
i) View teacher ii) Block
or unblock teacher
3) Manage students
i) View students ii)
Block or unblock
students
4) Manage events
i) View events ii) Add
new events
5) Manage notification
i) View notifications ii)
Send notifications
17
6) View feedback
7) Manage report
i) View report ii) Send
reply

2.7.2 Use cases for the actor Teacher

1) Login
2) signup
3) manage group
4) view and update profile
5) create and view event
6) share ideas
7) share articles
8) like & rate ideas and articles
9) discussion forum
10) send feedback
11) send report and view reply
12) send notification

2.7.3 Use cases for the actor student

1. Login
2. signup
3. manage group
4. view and update profile
5. view event
6. share ideas
7. share articles
8. like & rate ideas and articles
9. discussion forum
10. send feedback
11. send report and view reply
12. view notification
13. interaction with chatbot

18
2.8 USE CASE DIAGRAM

Usecase of Admin:

Usecase of Teacher:

19
Usecase of student:

20
21
3. SYSTEM DESIGN

3.1 SYSTEM DESIGN - INTRODUCTION


System Design involves translating system requirements and conceptual design into technical
specification and general flow of processing. After the system requirements have been
identified, information has been gathered to verify the problems and after evaluating the
existing system a new system is proposed. System Design is the process of planning of new
system or to replace or complement an existing system. It must be thoroughly understood
about the old system determine how computers can be used to make its operations more
effective.

System Design sits at technical the kernel of the system development. Once system
requirements have been analysed and specified system design is the first of the technical
activities – design, code generation and test that required to build and verify the software.
System Design is the most creative and challenging phases of the system life cycle. The term
design describes the final system and the process by which it is to be developed.

System Design is the high level strategy for solving the problem and building a solution.
System Design includes decisions about the organization of the system into subsystems, the
allocation of subsystems to hardware and software components and major conceptual and
policy decision that forms the framework for detailed design.

WEBPAGE DESIGN
In computer software development the web page design phase has an important part role. The
pages are used to gather user inputs and to display the information to the user. An excellent
design of pages will improve the quality of application. It will help to increase the probability
of user acceptance. Efficient page design can reduce the data entry time and it helps the user
22
to see the different controls placed in the pages. A good page design simplifies the data
access and entry.

ANDRIOD PAGE DESIGN


The pages are used to gather user inputs and to display the information to the user. An
excellent design of pages will improve the quality of application. It will help to increase the
probability of user acceptance. A good page design simplifies the data access and entry.
Efficient page design can reduce the data entry time and it helps the user to see the different
controls placed in the pages.

INPUT DESIGN
Input Design is the process of converting the user-oriented inputs to a computer based
format. The goal of designing input data is to make the automation is easy and free from
errors. The design of handling input specifies how data are accepted for computer processing.
Input design is art of overall system design that needs careful attention and if includes
specifying the means by which actions are taken. A system user interacting through a work
station must be able to tell the system whether to accept input produce a report or end
processing. The major objective of the input design is to make the data entry easier, logical
and error free. With this objective the screen for the system are developed. The input design
requirement such user friendliness, consistent format and interactive dialogue boxes for
giving the right message and help for the user at the right time are also considered for the
development of the project. The data entry operator need to know the space allocated for each
field, the field sequence, which must match with source document and the format in which
the data is entered.

OUTPUT DESIGN
A quality output is the one, which meets the requirement of the end user and presents the
information clearly. In any system, the results of processing are given to the users through
the outputs. In the output design it is determined how the information is to be displayed for
immediate need. Output design should improve the relationship of the system with user and
help in decision making. The objective of the output design is to define the format of all
printed documents and of the screens that will be produced by the system. The objective of
the output design is to define the format of all printed documents and of the screens that will
be produced by the system. The output has been designed as per the needs of the institution.
23
3.2 DATABASE DESIGN
A Database is a collection of inter related data stored with minimum redundancy to serve
many users quickly and efficiently. In database design data independence, accuracy, privacy
and security are given higher priority. Database design is an integrated approach to the file
design. This activity deals with the design of the physical data base. All entities and attributes
have been identified while creating the database. The database design deals with the grouping
of data into number of tables so as to.
✓ Reduplication of data.
✓ Minimize storage space.
✓ Retrieve the data efficiently.

Following are some guidelines for the database design:

➢ Design a relational schema so that it is easy to explain its meaning. Do not combine
attributes from multiple entry and relationship type into a single relation.
➢ Design the database schema so that no insertion, deletion or modification anomalies
are present in the relation.
➢ As far as possible, avoid placing attributes in the base relation whose values may
frequently be null.
➢ Design relation schema so that they can be joined with equality conditions on
attributes that are either primary keys or foreign keys in a wat that no spurious tuples
are generated.

3.3 TABLE DESIGN


DB design is required to manage large bodies of information. The management of data
involves both the definition of the structure of storage of information and provisions of
mechanism for the manipulation of information. For developing an efficient database certain
conditions have to be fulfilled such as:

• Control Redundancy
• Ease of Use
• Data Independence
24
• Accuracy and Integrity

There are five major steps in design process:

• Identify the table and relationship.


• Identify the data that is needed for each table and relationship.
• Resolve the relationship.
• Verify the design.
• Implement the design
1.login table
Colum name Data type Constraints Description

login_id int primary key unique identifier

username varchar(50) not null name of user

password varchar(50) not null secret key

user_type varchar(50) not null To specify the user


type

2.student table

Column name Data type Constraints Description

Student_id Int Primary key Unique identifier

Name Varchar(50) Not null Name of student

Place Varchar(50) Not null Place of student

Image Varchar(100) Not null Profile image

Pin Int Not null pincode

email Varchar(50) Not null Students mail id

phone double Not null Phone number

25
3.Teacher table
Column name Data type Constraints Description

teacher_id Int Primary key Unique identifier

Name Varchar(50) Not null Name of student

Place Varchar(50) Not null Place of teacher

Image Varchar(100) Not null Profile image

phone double Not null Phone number

4. Event table
Column name Data type Constraints Description

Event_id int Primary key Unique identifier

name Varchar(50) Not null Name of event

Date date Not null Date of the event

Image Varchar(50) Not null Image of the event

Details Varchar(50) Not null Event details

Creator_id int Not null Id of the event


creator

type Varchar(50) Not null Creator type

26
5. group table
Column name Data type Constraints Description
Group_id Int Primary key Unique identifier
Manager_id Int Not null Id of creator
Type Varchar(50) Not null creator type
Name Varchar(50) Not null Name of group
date date Not null Created date

6.feedback table
Column name Data type Constraints Description

feedback_id Int Primary key Unique identifier

sender_id Int Not null Id of sender

Type Varchar(50) Not null Sender type

feedback Varchar(50) Not null Feedback message

date date Not null Date in which


feedback sends

7. article table
Column name Data type Constraints Description

article_id Int Primary key Unique identifier

sender_id Int Not null Id of sender

Type Varchar(50) Not null Sender type

article Varchar(50) Not null Article message

date date Not null Date in which


article sends

8.discussion table
Column name Data type Constraints Description

27
Discussion_id int Primary key Unique identifier

Topic Varchar(50) Not null Discussion topic

Date Date Not null Date

From_id int Not null Id of person who


starts discussion

9.discussion_sub table
Column name Data type Constraints Description

Sub_id Int Primary key Unique identifier

Discussion_id Int Not null Id of dicussion

Sender_id Int Not null Id of sender

Content Varchar(50) Not null Discussion content

Date Date Not null Date of discussion

status Varchar(50) Not null Current status

10.notification table
Column name Data type Constraints Description

Notification_id Int Primary key Unique identifier

Type Varchar(50) Not null Sender type

Date Date Not null Date of notification

Topic Varchar(50) Not null Notification topic

Notification Varchar(50) Not null Content of notification

Sender_id int Not null Id of sender

11.ideas table
Column name Data type Constraints Description
Ideas_id Int Primary key Unique identifier
Idea Varchar(50) Not null Idea content
Teacher_id Int Not null Id of teacher

28
date date Not null Date of idea created

12.like table
Column name Data type Constraints Description
Like_id Int Primary key Unique identifier
Liked_person_id Int Not null Id of liked person
Article_id Int Not null Id of article
Type Varchar(50) Not null Type of liked person
date date Not null Date of action

13.report table
Column name Data type Constraints Description
report_id Int Primary key Unique identifier
type Varchar(50) Not null Sender type
Member_id Int Not null Sender id
Date Date Not null Date of sending
Report Varchar(50) Not null Report content
Reply_date Date Not null Date of reply
reply Varchar(50) Not null Reply content

14.question table
Column name Data type Constraints Description

question_id Int Primary key Unique identifier

question Varchar(50) Not null Question content

answer Varchar(50) Not null Answer content

15.group_member table

29
Column name Data type Constraints Description

Group_member_id Int Primary key Unique identifier

Group_id Int Not null Id of group

Stud_id int Not null Id of student

16.chat table
Column name Data type Constraints Description

Chat_id Int Primary key Unique identifier

Date Date Not null Date of chat

From_id Int Not null Sender id

To_id Int Not null Receiver id

message Varchar(50) Not null Chat message

3.4 DATA FLOW DIAGRAM

A graphical representation is used to describe and analyses the movement of data through a
system manual or automated including the processes, Storing of data and delays in the
system. Data flow diagrams are the central tool and the basis from which other components
are developed.

The transformation of data, from input to output through process may be described logically
and independently of the physical components associated with the system.

They are termed logical dataflow diagrams, showing the actual implementations and the
movement of data between people, departments and workstations. DFD is one of the most
important modelling tools used in system design. DFD shows the flow of data through
different process in the system.
30
PURPOSE:
The purpose of the design is to create architecture for the evolving implementation and to
establish the common tactical policies that must be used by desperate elements of the system.
We begin the design process as soon as we have reasonably completed model of the behavior
of the system. It is important to avoid premature designs, wherein develop designs before
analysis reaches closer. It is important to avoid delayed designing where in the organization
crashes while trying to complete an unachievable analysis model.

Throughout my project, the context flow diagrams, data flow diagrams and flow
charts have been extensively used to achieve the successful design of the system. In my
opinion, "efficient design of the data flow and context flow diagram helps to design the
system successfully without much major flaws within the scheduled time". This is the most
complicated part in a project. In the designing process, my project took more than the
activities in the software lifecycle. If we design a system efficiently with all the future
enhancements the project will never become junk and it will be operational.

The data flow diagrams were first developed by Larry Constantine as a way of
expressing system requirements in graphical form. A data flow diagram also known as
"bubble chare" has the purpose of clarifying system requirements and identifying major
transformations that will become programs in system design. It functionality decomposes the
requirement specification down to the lowest level. Data Flow Diagram depicts the

information flow, the transformation flow and the transformations that are applied as data
move from input to output. Thus DFD describes what data flows rather than how they are
processed.

Data Flow Diagram is quite effective, especially when the required design is unclear
and the user and analyst need a notational language for communication. It is one of the most
important tools used during system analysis. It is used to model the system components such
as the system process, the data used by the process, any external entities that interact with the
system and information flows in the system.

31
Data Flow Diagrams are made up of a number of symbols, which represents system
components. Data flow modelling method uses four kinds of symbols, which are used to
represent four kinds of system components.

These are

• Process
• Data stores
• Data flows
• External entity

PROCESS:
Process shows the work of the system. Each process has one or more data inputs and produce
one or more data outputs. Processes are represented by rounded rectangles in Data Flow
Diagram. Each process has a unique name and number. This name and number appears inside
the rectangle that represents the process in a Data Flow Diagram.

DATA STORES:
A data stores is a repository of data. Processes can enter data, into a store or retrieve the data
from the data store. Each data has a unique name.

DATA FLOWS

Data flows show the passage of data in the system and are represented by lines joining system
components. An arrow indicates the direction of flow and the line is labelled by name of the
dataflow.

EXTERNAL ENTITIES

External entities are outside the system but they either supply input data into the system or
use other systems output. They are entities on which the designer has control. They may be an
organizations customer or other bodies with which the system interacts. External entities that
supply data into the system are sometimes called source. External entities that use the system
data are sometimes called sinks. These are represented by rectangles in the Data Flow
Diagram.
32
Four basic symbols are used to construct data flow diagrams. They are symbols that represent
data source, data flows, and data transformations and data storage. The points at which data
are transformed are represented by enclosed figures, usually circles, which are called nodes.

Basic data flow diagram symbols are.....

➢ A Square defines a source (originator) or destination of a system data:

➢ An Arrow identifies data flow. It is a pipeline through which information flows:

➢ A Circle represents a process that transforms incoming data flow(s) into outgoing
data flow(s):

➢ An Open Rectangle is a data store:

33
Four steps are commonly used to construct a DFD:

➢ Process should be named and numbered for easy reference. Each name should be
representative of the process.
➢ The direction of flow is from top to bottom and left to right.
➢ When a process is exploded in to lower level details they are numbered.

The names of data stores, sources and destinations are written in Capital letters.

DFD LEVEL 0:

DFD LEVEL 1:

34
DFD LEVEL 1.1- ADMIN

35
DFD LEVEL 1.2 -TEACHER

36
DFD LEVEL 1.3- STUDENT

37
3.5 ER DIAGRAM
An ER diagram is a diagram that helps to design databases in an efficient way. It is a data
model for describing the data or information. It is a visual representation of data that
describes how data is related to each other. The main components of ER models are entities,
attributes and the relationships that can exist among them.
38
Entity

Entities are represented by means of rectangles. Rectangles are named with the entity set they
represent.

Attribute

Attributes are properties of entities. Attributes are represented by means of eclipses. Every
eclipse represents one attribute and is directly connected to its entity (rectangle).

Relationship

Relationships are represented by diamond shaped box. Name of the relationship is written in
the diamond box. All entities (rectangles), participating in relationship, are connected to it by
a line.

Architectural design

39
40
4.CODING

4.1 INPUT INTERFACE


Input design is a part of overall system design, which requires very careful attention. If data
going into the system is correct, then the processing and output will magnify these errors.
Thus the designer has a number of clear objectives in the different stages of input design.

➢ To produce a cost-effective method of input.


➢ To achieve the highest possible level of accuracy.
➢ To ensure that input is acceptable to and understand by the user.

4.2 OUTPUT INTERFACE


At the beginning of the output design various types of outputs such as external, internal,
operational and interactive and turn around are defined. Then the format, content, location,
frequency, volume and sequence of the outputs are specified. The content of the output must
be defined in detail. The system analysis has two specific objectives at this stage.

41
➢ To interpret and communicate the results of the computer part of a system to the users
in a form, which they can understand, and which meets their requirements.
➢ To communicate the output design specifications to programmers in a way in which it
is unambiguous, comprehensive, and capable of being translated into a programming
language.

4.3 TECHNOLOGY SPECIFICATION


The proposed system is developed using HTML , CSS, JavaScript for web and Java(Android
Studio) for Android as Front end. MySQL ,flask and python for web and Python ,MySQL for
Android as Back end.

4.3.1 HTML
HTML is an acronym which stands for Hyper Text Markup Language which is used
for creating web pages and web applications. Let's see what is meant by Hypertext Markup
Language, and Web page. Hyper Text: HyperText simply means "Text within Text." A text has
a link within it, is a hypertext. Whenever you click on a link which brings you to a new
webpage, you have clicked on a hypertext. HyperText is a way to link two or more web pages
(HTML documents) with each other. Markup language: A markup language is a computer
language that is used to apply layout and formatting conventions to a text document. Markup
language makes text more interactive and dynamic. It can turn text into images, tables, links,
etc. Web Page: A web page is a document which is commonly written in HTML and
translated by a web browser. A web page can be identified by entering an URL. A Web page
can be of the static or dynamic type. With the help of HTML only, we can create static web
pages. Hence, HTML is a markup language which is used for creating attractive web pages
with the help of styling, and which looks in a nice format on a web browser. An HTML
document is made of many HTML tags and each HTML tag contains different content

Features
1. It is a very easy and simple language. It can be easily understood and modified.
2. It is very easy to make an effective presentation with HTML because it has a lot of
formatting tags.
3. It is a markup language, so it provides a flexible way to design web pages along with
the text.

42
4. It facilitates programmers to add a link on the web pages (by html anchor tag), so it
enhances the interest of browsing of the user.
5. It is platform-independent because it can be displayed on any platform like Windows,
Linux, and Macintosh, etc.
6. It facilitates the programmer to add Graphics, Videos, and Sound to the web pages
which makes it more attractive and interactive.

7. HTML is a case-insensitive language, which means we can use tags either in

lowercase or upper-case.

HTML Versions
Since the time HTML was invented there are lots of HTML versions in market, the brief
introduction about the HTML version is given below:

HTML 1.0: The first version of HTML was 1.0, which was the barebones version of HTML
language, and it was released in1991.

HTML 2.0: This was the next version which was released in 1995, and it was standard
language version for website design. HTML 2.0 was able to support extra features such as
form-based file upload, form elements such as text box, option button, etc.
HTML 3.2: HTML 3.2 version was published by W3C in early 1997. This version was
capable of creating tables and providing support for extra options for form elements. It can
also support a web page with complex mathematical equations. It became an official standard
for any browser till January 1997. Today it is practically supported by most of the browsers.

HTML 4.01: HTML 4.01 version was released on December 1999, and it is a very stable
version of HTML language. This version is the current official standard, and it provides

added support for stylesheets (CSS) and scripting ability for various multimedia elements.

HTML5 : HTML5 is the newest version of Hyper Text Markup language. The
first draft of this version was announced in January 2008. There are two major organizations
one is W3C (World Wide Web Consortium), and another one is WHATWG( Web Hypertext
Application Technology Working Group) which are involved in the development of HTML 5
version, and still, it is under development.

43
Description of HTML example

<!DOCTYPE>: It defines the document type or it instruct the browser about the version
of
HTML
.

<html> :This tag informs the browser that it is an HTML document. Text between html tag
describes the web document. It is a container for all other elements of HTML except<!
DOCTYPE>

<head> : It should be the first element inside the element, which contains the
metadata(information about the document). It must be closed before the body tag opens.

<title>: As its name suggests it is used to add title of that html page which appears at the
top of the browser window. It must be placed inside the head tag and should close
immediately (optional).

<body> : Text between body tag describes the body content of the page that is visible to the
end user . This tag contains the main content of the html document.

<h1> : Text between <h1> tag describes the first level heading of the webpage.

<p>: Text between <p> tag describes the paragraph of the webpage.

4.3.2 CSS (Cascading Style Sheet)

CSS is used to control the style of a web document in a simple and easy way.CSS is the
acronym for "Cascading Style Sheet".Cascading Style Sheets (CSS) is a style sheet
language used for describing the presentation of a document written in a markup language
like HTML.
CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript .

44
CSS is designed to enable the separation of presentation and content, including layout, colors,
and fonts. This separation can improve content accessibility, provide more flexibility and
control in the specification of presentation characteristics, enable multiple web pages to share
formatting by specifying the relevant CSS in a separate .css file, and reduce complexity and

repetition in the structural content.

History of CSS

CSS was first proposed by HakonWium Lie on October 10, 1994. At the time, Lie was
working with Tim Berners-Lee (father of Html) at CERN. The European Organization for
Nuclear Research is known as CERN. Hakonwium lie is known as father of css.CSS was
proposed in 1994 as a web styling language, to solve some of the problems of Html 4. There
were other styling languages proposed at this time, such as Style Sheets for Html and JSSS
but CSS won.

Why to learn CSS?

Cascading Style Sheets, fondly referred to as CSS, is a simple design language intended to
simplify the process of making web pages presentable.23 CSS is a MUST for students and
working professionals to become a great Software Engineer specially when they are working
in Web Development Domain.
I will list down some of the key advantages of learning CSS:

• Create Stunning Web site - CSS handles the look and feel part of a web page.
Using CSS, you can control the color of the text, the style of fonts, the spacing
between paragraphs, how columns are sized and laid out, what background
images or colors are used, layout designs,variations in display for different
devices and screen sizes as well as a variety of other effects.

• Become a web designer - If you want to start a carrier as a professional web


designer, HTML and CSS designing is a must skill.

45
• Control web - CSS is easy to learn and understand but it provides powerful
control over the presentation of an HTML document. Most commonly, CSS is
combined with the markup languages HTML or XHTML.

• Learn other languages - Once you understand the basic of HTML and CSS
then other related technologies like javascript, php, or angular are become
easier to understand.

Types of CSS

There are three ways of inserting a style sheet in any Html documents, they are given below:

• Inline style sheet


• Internal style sheet
• External style sheet
Inline CSS is use with any elements of HTML where it is used on page. Here we use inline
CSS for paragraph, the example shows how to change the color and the left margin of a
paragraph. An internal style sheet should be used when a single document has a unique style.
Internal styles sheet is defined in the head section of an HTML page, by using the <style> tag.
An external style sheet is ideal when the style is applied to many pages. With an external style

sheet, we can change the look of an entire Web site by changing one file.

CSS Selectors
Selectors are used for select an Html element it is select by name, id, class etc.

1. id selector
2. class selector
3. Element Selector
4. Group Selector
5. Universal Selector

Features
1. A style rule consists of a selector component and a declaration block component.

46
2. The selector is used to point to the HTML component which you want to get

styled.

3. Inside the declaration block, one or more declarations are contained along with

semicolons.

4. Every declaration which is put has a CSS property name, a semicolon, and a

value. For example, color is the property and the value is red in color. Font size is

the property and the 15px is the value.

5. CSS declaration ends with a semicolon and these blocks are surrounded by curly

braces.

6. CSS selectors are the ones which are used to find HTML elements which are

based on the element name, id, attribute, class and more.

7. One unique element will be selected by the ID of an element.

8. If you wish to select the particular element with a specific id, the # function along

with the id attribute should be used.

9. If you wish to select the elements with a specific class, the period character along

with the name class should be written.

10. Universal selector: If you are not interested in choosing the elements of a certain

type, the universal selector simply matches with the element name.

11. Element selector: These selectors choose the element based on the element name.

12. Descendent selector: When a particular element lies inside another element, then it

is called as the descendent selector.

13. ID selector: This selector uses the id of the HTML element so that a specific

element could be selected.

14. Class selectors: It selects the element with a specific class attribute.

47
15. Grouping selectors: It will be a good option to group the selectors so as to

minimize the code. Each selector along with a comma should be used to group the

selectors.

4.3.3 JAVASCRIPT
JavaScript is a object-based scripting language and it is light weighted. It is first
implemented by Netscape (with help from Sun Microsystems). JavaScript was created by
Brendan Eich at Netscape in 1995 for the purpose of allowing code in web-pages (performing
logical operation on client side).It is not compiled but translated. JavaScript Translator is
responsible to translate the JavaScript code which is embedded in browser.Netscape first
introduced a JavaScript interpreter in Navigator 2. The interpreter was 25 an extra software
component in the browser that was capable of interpreting JavaSript source code inside an
HTML document. This means that web page developers no need other software other than a
text editor of develop any web page.

Why we use JavaScript?


Using HTML we can only design a web page but you cannot run any logic on web browser
like addition of two numbers, check any condition, loopingstatements (for, while), decision
making statement (if-else) at client side. All these are not possible using HTML so for
perform all these task at client side you need to use JavaScript

History
JavaScript is an object-based scripting language and it is light weighted. It is first
implemented by Netscape (with help from Sun Microsystems). JavaScript was created by
Brendan Eich at Netscape in 1995 for the purpose of allowing code in web-pages (performing
logical operation on client side).Using HTML we can only design a web page but you cannot
run any logic on web browser like addition of two numbers, check any condition, looping
statements(for, while), decision making statement(if-else) etc. All these are not possible using
HTML so to perform all these task, we use JavaScript. Using HTML we can only design a
web page if we want to run any programs like c programming we use JavaScript. Suppose we
want to print sum of two numbers then we use JavaScript for coding.

48
Features
• JavaScript is an object-based scripting language.

• Giving the user more control over the browser.

• It Handling dates and time.

• It Detecting the user's browser and OS

• It is light weighted.

• JavaScript is a scripting language and it is not java.


• JavaScript is interpreter based scripting language.

• JavaScript is case sensitive.

• JavaScript is object based language as it provides predefined objects.

• Every statement in JavaScript must be terminated with semicolon (;).

• Most of the JavaScript control statements syntax is same as syntax of control

statements in C language. An important part of JavaScript is the ability to

create new functions within scripts. Declare a function in JavaScript using

function keyword

4.3.4 ANDROID
Android is a software stack for mobile devices that includes an operating system,
middleware and key applications. The Android SDK provides the tools and APIs necessary to
begin developing applications on the Android platform using the Java programming language.
Android applications are written in the Java programming language. The Android SDK tools
compile the code—along with any data and resource files— into an Android package, an
archive file with an .apk suffix. All the code in a single .apk file is considered to be one
application and is the file that Android-powered devices use to install the application.
Application components are the essential building blocks of an Android application. Each
component is a different point through which the system can enter your application. Not all
components are actual entry points for the user and some depend on each other, but each one

49
exists as its own entity and plays a specific role—each one is a unique building block that

helps define application's overall behavior. Features

• Application framework enabling reuse and replacement of components

• Dalvik virtual machine optimized for mobile devices

• Integrated browser based on the open source Web Kit engine


• Optimized graphics powered by a custom 2D graphics library; 3D

graphicsbased on the OpenGL ES 1.0 specification (hardware acceleration

optional)

• Media support for common audio, video, and still image formats

(MPEG4,H.264, MP3, AAC, AMR, JPG, PNG, GIF)

• GSM Telephony (hardware dependent)

• Bluetooth, EDGE, 3G, and Wi-Fi (hardware dependent)

• Camera, GPS, compass, and accelerometer (hardware dependent)

• Rich development environment including a device emulator, tools for

debugging, memory and performance profiling, and a plug-in for the Eclipse

IDE.

ANDROID ARCHITECTURE
The following diagram shows the major components of the Android operating system.
Each section is described in more detail below.

50
APPLICATION FRAMEWORK
By providing an open development platform, Android offers developers the ability to build
extremely rich and innovative applications. Developers are free to take advantage of the
device hardware, access location information, run background services, set alarms, add
notifications to the status bar, and much, much more. Developers have full access to the same
framework APIs used by the core applications. The application architecture is designed to
simplify the reuse of components; any application can publish its capabilities and any other
application may then make use of those capabilities (subject to security constraints enforced
by the framework). This same mechanism allows components to be replaced by the user.

Underlying all applications is a set of services and systems, including:

A rich and extensible set of the views that can be used to build an application, including lists,
grids, text boxes, buttons, and even an embeddable web browser

Content Providers that enable applications to access data from other applications (such as
Contacts), or to share their own data

A Resource Manager, providing access to non-code resources such as localized strings,


graphics, and layout files

A Notification Manager that enables all applications to display custom alerts in the status bar

An Activity Manager that manages the lifecycle of applications and provides a common
navigation back stack.
51
Libraries
Android includes a set of C/C++ libraries used by various components of the Android
system. These capabilities are exposed to developers through the Android application
framework. Some of the core libraries are listed below:

• System C library - a BSD-derived implementation of the standard C system


library (libc), tuned for embedded Linux-based devices
• Media Libraries - based on Packet Video’s Open CORE; the librariessupport
playback and recording of many popular audio and video formats, as well as
static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and
PNG
• Surface Manager - manages access to the display subsystem and seamlessly
composites 2D and 3D graphic layers from multiple applications
• LibWebCore - a modern web browser engine which powers both theAndroid
browser and an embeddable web view
• SGL - the underlying 2D graphics engine
• 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries
use either hardware 3D acceleration (where available) or the included, highly
optimized 3D software rasterizer
• Free Type - bitmap and vector font rendering24

Android Runtime
Android includes a set of core libraries that provides most of the functionality available in
the core libraries of the Java programming language. Every Android application runs in its
own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so
that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik
Executable (.dex) format which is optimized for minimal memory footprint. The VM is
register-based, and runs classes compiled by a Java language compiler that have been
transformed into the .dex format by the included "dx" tool. The Dalvik VM relies on the
Linux kernel for underlying functionality such as threading and low-level memory
management. Linux Kernel Android relies on Linux version 2.6 for core system services such
as security, memory management, process management, network stack, and driver model.

52
The kernel also acts as an abstraction layer between the hardware and the rest of the software
stack.

Activity Lifecycle

Activities in the system are managed as an activity stack. When a new activity is started, it is
placed on the top of the stack and becomes the running activity -- the previous activity always
remains below it in the stack, and will not come to the foreground again until the new activity
exits.

An activity has essentially four states:


• If an activity in the foreground of the screen (at the top of the stack), it is
active or running.
• If an activity has lost focus but is still visible (that is, a new non-full sized or
transparent activity has focus on top of your activity), it is paused. A paused
activity is completely alive (it maintains all state and member information and
remains attached to the window 25 manager), but can be killed by the system
in extreme low memory situations.
• If an activity is completely obscured by another activity, it is stopped. It still
retains all state and member information, however, it is no longer visible to the
user so its window is hidden and it will often be killed by the system when
memory is needed elsewhere.
• If an activity is paused or stopped, the system can drop the activity from
memory by either asking it to finish, or simply killing its process. When it is
displayed again to the user, it must be completely restarted and restored to its
previous state.

Android Studio
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. Android Studio
supports all the same programming languages of IntelliJ, and PyCharm and Android Studio
3.0 supports Java 7 language features and a subset of Java 8 language features that vary by
platform version. Features like Gradle-based build support, Android-specific refactoring and

53
quick fixes, a rich layout editor that allows users to drag-and-drop UI components, option to
preview layouts on multiple screen configurations, Android Virtual Device (Emulator) to run

and debug apps in the Android studio, etc. are provided in the current stable version.

4.3.5 JAVA
The first version of Java began in 1991 and was written in 18 months at Sun micro system.
In fact, it wasn’t even called Java in those days it was Oak, and it was used internally at sun.
Java had adopted a model that made it perfect for the Internet, the byte code model. It is
implemented as the Java virtual Machine (JVM), which is the application that actually runs
the java program. 26 When JVM is installed on a computer, it can run java programs. Java
programs, before ,don’t need to be self-sufficient, and they don’t have to include all the
machine –level code that actually runs on the computer .In this way ,our Java program can be
very small, because all the machine-level code to run our program is already on the target
computer and doesn’t have to be downloaded.

When it executes a program, the JVM can strictly monitor what goes on, which makes
it great for Internet Applications.

JAVA FEATURES
The inventors of java wanted to design a language, which could offer solutions to
some of the problems encountered in modern programming. They wanted the language to be
reliable, portable and distributed but also simple, compact and interactive. Sun Microsystems
officially describes java with the following attributes.

• Compiled and Interpreted


• Platform-Independent and Portable
• Object-Oriented
• Robust and Secure
• Distributed
• Familiar, Simple and Small
• Multithreaded and Interactive
• High Performance

• Dynamic and Extensible

54
Compiled and Interpreted
Usually a computer language is either compiled or interpreted. Java combines both these
approaches thus making java a two-stage system first java compiler translate source code in
to byte code instructions. Byte-codes are not machine code that can be directly executed by
the machine that is running the java program. Platform Independent and Portable.
The most significant contribution java over other languages is its portability. Java programs
can be easily moved from one computer system to another, anywhere at any time. Changes
and Upgrades in 27 operating systems, processors and system resources will not force any
changes in java programs. This is the reason why java has become a popular language for
programming on internet, which interconnects different kinds of systems worldwide. Java
ensures portability in two ways. First, java compiler generates byte code instructions that can
implemented on any machine. Secondly, the sizes of the primitive data types are machine
independent.

Object-Oriented
Java is a true Object-Oriented Language. Almost everything in Java is an Object. All
program code and data reside within objects and classes. Java comes with an extensive set of
classes arranged in packages that we can use in our programs by inheritance.
The object model in java is simple and easy to extend.

Robust and Secure


Java is a robust language. It provides many safe guards to ensure reliable code. It has strict
compile time checking for data types. It is designed as garbage collected language. Java also

incorporates with the concept of exception handling.

Distributed
Java is designed as a distributed language for creating application on network.
It has the ability to share both data & Program.

Multithreaded and interactive


Multithreaded means handling multiple tasks simultaneously java supports multithreaded
programs. This means that we not wait for the application to finish one task before beginning

another.

55
High performance
Java performance is impressive for an interpreted language mainly due to the use of
intermediate byte code. Java architecture is also designed to reduce overheads during

runtime.

4.3.6 PYTHON
Python is an object-oriented, high-level programming language with dynamic semantics. Its
high-level built in data structures, combined with dynamic typing and dynamic binding, make
it very attractive for Rapid Application Development, as well as for use as a scripting or glue
language to connect existing components together. Python's simple, easy to learn syntax
emphasizes readability and therefore reduces the cost of program maintenance. Python
supports modules and packages, which encourages program modularity and code reuse. The
Python interpreter and the extensive standard library are available in source or binary form
without charge for all major platforms, and can be freely distributed.

Often, programmers fall in love with Python because of the increased productivity it provides.
Since there is no compilation step, the edit-test-debug cycle is incredibly fast. Debugging
Python programs is easy: a bug or bad input will never cause a segmentation fault. Instead,
when the interpreter discovers an error, it raises an exception. When the program doesn't
catch the exception, the interpreter prints a stack trace. A source level debugger allows
inspection of local and global variables, evaluation of arbitrary expressions, setting
breakpoints, stepping through the code a line at a time, and so on. The debugger is written in
Python itself, testifying to Python's introspective power. On the other hand, often the quickest
way to debug a program is to add a few print statements to the source: the fast edit-test-debug
cycle makes this simple approach very effective.

4.3.7 MySQL
MySQL software is Open Source

Open source means that it is possible for anyone to use and modify. Anybody can download
the MySQL software from the Internet and use it without paying anything. The MySQL
database server is very fast, reliable, and easy to use. It was originally developed to handle
large databases much faster than existing solutions and has been successfully used in highly

demanding production environments for several years. Though under constant development,

56
MySQL Server today offers a rich and useful set of functions . Its connectivity, speed, and
security make MySQL Server highly suited for accessing databases on the Internet

• An object-oriented interface
• Support for prepared statements

• Support for multiple statements

• Support for transactions

• Enhanced debugging support

• Embedded server support

4.3.8 PYCHARM:

PyCharm is an integrated development environment (IDE) used in computer

programming, specifically for the Python language. It is developed by the Czech company
JetBrains (formerly known as IntelliJ).[5] It provides code analysis, a graphical debugger, an
integrated unit tester, integration with version control systems (VCSes), and supports web
development with Django as well as data science with Anaconda.[6]

FEATURES:

➢ Coding assistance and analysis, with code completion, syntax and error highlighting,
linter integration, and quick fixes
➢ Project and code navigation: specialized project views, file structure views and quick
jumping between files, classes, methods and usages
➢ Python refactoring: includes rename, extract method, introduce variable, introduce
constant, pull up, push down and others
➢ Integrated Python debugger
➢ Integrated unit testing, with line-by-line code coverage
➢ Version control integration: unified user interface for Mercurial, Git, Subversion,
Perforce and CVS with change lists and merge

57
4.3.9 FLASK
Flask is a micro frame work written in python. It is classified as microframework
because it does not require particular tools or libraries. [2] It has no database abstraction
layer, form validation, or any other components where pre-existing third-party libraries
provide common functions. However, Flask supports extensions that can add application
features as if they were implemented in Flask itself. Extensions exist for object-relational
mappers, form validation, upload handling, various open authentication technologies and
several common framework related tools.

58
5.CODING PAGES

Chatbot.py

import base64
import random

59
from flask import Flask, render_template, request, redirect, jsonify
from DBConnection import Db
import datetime

app = Flask(__name__)
static_path=r"C:\Users\Athul Thomas\PycharmProjects\chatbot\static\\"

@app.route('/') def
hello_world():
return render_template("login_index.html")

@app.route("/login_post", methods=['post'])
def login_post():
username=request.form['textfield']
password=request.form['textfield2'] db=Db()
res=db.selectOne("select * from login where username='"+username+"' and
password='"+password+"'") if res is not None: if
res['usertype']=="admin":
return redirect("/admin_home")
else: return "invalid" else:
return "invalid"

@app.route("/admin_home") def
admin_home():
return render_template("admin/admin_index1.html")
# return render_template("admin/home.html")

@app.route("/admin_add_question") def
admin_add_question():
return render_template("admin/Add_questions.html")

@app.route("/admin_add_question_post",methods=['post'])
def admin_add_question_post():
qn=request.form['textfield']
ans=request.form['textfield2']
db=Db()
db.insert("insert into question(question, answer) values('"+qn+"','"+ans+"')")
return '<script>alert("added
succcessfully");window.location="/admin_add_question"</script>'

@app.route("/admin_view_question") def
admin_view_question():
60
db=Db()
res=db.select("select * from question")
return render_template("admin/view_question.html", data=res)

@app.route("/admin_delete_question/<qid>")
def admin_delete_question(qid): db=Db()
db.delete("delete from question where question_id='"+qid+"'")
return redirect("/admin_view_question")

@app.route("/admin_add_event") def
admin_add_event():
return render_template("admin/Add_event.html")

@app.route("/admin_add_event_post",methods=['post']) def
admin_add_event_post():
name=request.form['textfield']
date=request.form['textfield2']
image=request.files['fileField']
details=request.form['textarea'] db=Db()
date=datetime.datetime.now().strftime("%d%m%y-%H%M%S")
image.save(static_path + "pic\\"+date+'.jpg')
path="/static/pic/"+date+'.jpg' db.insert("insert into event(name,
date,image,details,creator_id,type)
values('"+name+"','"+date+"','"+str(path)+"','"+details+"',0,'admin')")
return '<script>alert("added
succcessfully");window.location="/admin_home"</script>'

@app.route("/admin_view_teachers") def
admin_view_teachers():
db=Db()
res=db.select("select * from teacher,login where teacher.teacher_id=login.login_id ")
return render_template("admin/view_teachers.html", data=res)

@app.route("/block_teachers/<tid>")
def block_teachers(tid): db=Db()
db.update("update login set usertype='block' where login_id='"+tid+"'")
return redirect("/admin_view_teachers") @app.route("/unblock_teachers/<tid>")
def unblock_teachers(tid):
db=Db()
db.update("update login set usertype='teacher' where login_id='"+tid+"'")
return redirect("/admin_view_teachers")

@app.route("/admin_view_students") def
admin_view_students():
db=Db()

61
res=db.select("select * from student,login where student.student_id=login.login_id")
return render_template("admin/view_students.html", data=res)

@app.route("/block_students/<sid>")
def block_students(sid): db=Db()
db.update("update login set usertype='block' where login_id='"+sid+"'")
return redirect("/admin_view_students")
@app.route("/unblock_students/<sid>") def unblock_students(sid):
db=Db()
db.update("update login set usertype='student' where login_id='"+sid+"'")
return redirect("/admin_view_students")

@app.route("/admin_send_notification") def
admin_send_notification(): return
render_template("admin/send_notificaion.html")
@app.route("/admin_send_notification_post",methods=['post'])
def admin_send_notification_post():
topic=request.form['textfield']
notification=request.form['textarea'] db=Db()
db.insert("insert into notification(type, date, topic, notification, sender_id)
values('admin',curdate(),'"+topic+"','"+notification+"', 0)")
return '<script>alert("noification send");window.location="/admin_home"</script>'

@app.route("/admin_view_notification") def
admin_view_notification():
db=Db()
res=db.select("select * from notification")
return render_template("admin/view_notification.html",data=res)
@app.route("/delete_notification/<dn>") def
delete_notification(dn):
db=Db()
db.delete("delete from notification where notification_id='"+dn+"'")
return redirect("/admin_view_notification")

@app.route("/admin_view_reporting", methods=['get', 'post'])


def admin_view_reporting(): if
request.method=="POST":
name=request.form['textfield']
db = Db()
res = db.select(
"select report.*, student.name as sname from report, student where
report.member_id=student.student_id and report.type='student' and student.name like
'"+name+"%' union(select report.*, teacher.name as sname from report, teacher where
report.member_id=teacher.teacher_id and report.type='teacher' and teacher.name like
'"+name+"%')") return
render_template("admin/View_reporting.html", data=res) else:
db = Db()

62
res = db.select("select report.*, student.name as sname from report, student where
report.member_id=student.student_id and report.type='student' union(select report.*,
teacher.name as sname from report, teacher where
report.member_id=teacher.teacher_id and report.type='teacher')") return
render_template("admin/View_reporting.html",data=res)

@app.route("/admin_send_reply/<rid>") def
admin_send_reply(rid): return
render_template("admin/send_reply.html", rid=rid)
@app.route("/admin_send_reply_post",methods=['post'])
def admin_send_reply_post(): id=request.form['hid']
reply=request.form['textarea'] db=Db()
db.update("update report set reply='"+reply+"', reply_date=curdate() where
report_id='"+id+"'")
return '<script>alert("reply sended
succcessfully");window.location="/admin_home"</script>'

@app.route("/admin_view_feedback", methods=['get', 'post']) def


admin_view_feedback():
if request.method == "POST":
name = request.form['textfield']
db = Db()
res = db.select("select feedback.*,student.name as sname from feedback, student
where feedback.sender_id=student.student_id and feedback.type='student' and
student.name like '"+name+"%' union(select feedback.*, teacher.name as sname from
feedback, teacher where feedback.sender_id=teacher.teacher_id and
feedback.type='teacher' and teacher.name like '"+name+"%')") return
render_template("admin/view_feedback.html", data=res) else:
db = Db()
res = db.select("select feedback.*,student.name as sname from feedback, student
where feedback.sender_id=student.student_id and feedback.type='student' union(select
feedback.*, teacher.name as sname from feedback, teacher where
feedback.sender_id=teacher.teacher_id and feedback.type='teacher')") return
render_template("admin/view_feedback.html",data=res)
@app.route("/admin_view_feedback_post",methods=['post']) def
admin_view_feedback_post():
sender_name=request.form['textarea']

@app.route("/admin_view_event") def
admin_view_event():
db=Db()
res=db.select("select * from event")
return render_template("admin/view_event.html",data=res)
@app.route("/delete_event/<de>")
def delete_event(de): db=Db()
db.delete("delete from event where event_id='"+de+"'")
return redirect("/admin_view_event")

63
@app.route("/admin_update_event") def
admin_update_event(): return
render_template("admin/update_event.html")
@app.route("/admin_update_event_post",methods=['post'])
def admin_update_event_post():
name=request.form['textfield']
date=request.form['textfield2']
image=request.form['fileField']
details=request.form['textarea'] return "ok"

@app.route("/aa")
def aa():
return render_template("admin/admin_index1.html")

############################################# ANDROID
@app.route("/and_Student_register", methods=['post'])
def and_Student_register():
name=request.form['name']
place=request.form['place']
image=request.form['image'] pin=request.form['pin']
email=request.form['email']
phone=request.form['phone'] password =
request.form['pa'] import time
timestr = time.strftime("%Y%m%d-%H%M%S")
a = base64.b64decode(image)
fh = open(static_path + "pic\\" + timestr + ".jpg", "wb")
path = "/static/pic/" + timestr + ".jpg" fh.write(a)
fh.close() db=Db()
lid = db.insert("insert into login(username, password, usertype) values('" + phone +
"',
'" + str(password) + "', 'student')") db.insert("insert into student(student_id,
name, place, image, pin, email, phone) values('"+str(lid)+"', '"+name+"',
'"+place+"', '"+path+"', '"+pin+"', '"+email+"',
'"+phone+"')")
return jsonify(status="ok")

@app.route("/and_Teacher_register", methods=['post'])
def and_Teacher_register():
name=request.form['name'] place =
request.form['place'] image = request.form['image']
phone = request.form['phone'] password =
request.form['pa'] import time
timestr = time.strftime("%Y%m%d-%H%M%S")
a = base64.b64decode(image)
64
fh = open(static_path + "pic\\" + timestr + ".jpg", "wb")
path = "/static/pic/" + timestr + ".jpg" fh.write(a)
fh.close()

db=Db()
lid=db.insert("insert into login(username, password, usertype) values('"+phone+"',
'"+str(password)+"', 'teacher')")
db.insert("insert into teacher(teacher_id,name,place,image,phone) values
('"+str(lid)+"','"+name+"', '"+place+"', '"+path+"', '"+phone+"')")
return jsonify(status="ok")

@app.route("/and_login", methods=['post']) def


and_login():
uname=request.form['uname']
password = request.form['password']

db = Db()
res = db.selectOne("select * from login where username='" + uname + "' and
password='" + password + "'") print(res) if res is not None:
if res['usertype'] == "teacher" or res['usertype'] == "student" or res['usertype'] ==
"block": return jsonify(status="ok", type=res['usertype'], lid=res['login_id'])
else:
return jsonify(status="no")
else:
return jsonify(status="invalid")

@app.route("/teacher_view_events", methods=['post']) def teacher_view_events():


lid=request.form['lid'] db=Db() res=db.select("select * from event where
creator_id='"+lid+"' and type='teacher'") if len(res) >0:
return jsonify(status="ok", data=res)
else:
return jsonify(status="no")

@app.route("/teacher_delete_event", methods=['post'])
def teacher_delete_event(): eid=request.form['eid']
db=Db()
db.delete("delete from event where event_id='"+eid+"'")
return jsonify(status="ok")

@app.route("/teacher_view_notification", methods=['post']) def


teacher_view_notification():
lid=request.form['lid']
db=Db()
res=db.select("select * from notification where sender_id='"+lid+"' and
type='teacher'") if len(res) >0:
return jsonify(status="ok", data=res)
else:
return jsonify(status="no")
65
@app.route("/teacher_delete_notification", methods=['post']) def
teacher_delete_notification():
nid=request.form['nid']
db=Db()
db.delete("delete from notification where notification_id='"+nid+"'")
return jsonify(status="ok")

@app.route("/teacher_view_groups", methods=['post'])
def teacher_view_groups(): lid=request.form['lid']
db=Db()
res=db.select("select * from `group` where manager_id='"+lid+"' and
type='teacher'")
print(res)
if len(res) >0:
return jsonify(status="ok", data=res)
else:
return jsonify(status="no")

@app.route("/teacher_delete_group", methods=['post'])
def teacher_delete_group(): gid=request.form['gid']
db=Db()
db.delete("delete from `group` where group_id='"+gid+"'")
return jsonify(status="ok")

@app.route("/teacher_add_group", methods=['post'])
def teacher_add_group(): lid=request.form['lid']
grpname=request.form['group']
db=Db()
db.insert("insert into `group`(manager_id, type, name, date) values('"+lid+"',
'teacher', '"+grpname+"', curdate())")
return jsonify(status="ok")

@app.route("/teacher_view_student", methods=['post'])
def teacher_view_student(): gid=request.form['gid']
db = Db()
res = db.select("select * from `student` where student_id not in (select stud_id from
group_member where group_id='"+gid+"')") print(res) if len(res) > 0:
return jsonify(status="ok", data=res)
else:
return jsonify(status="no")

@app.route("/teacher_add_grp_member", methods=['post']) def


teacher_add_grp_member():
gid=request.form['gid'] sid=request.form['sid'] db=Db()
db.insert("insert into group_member(group_id, stud_id) values('"+gid+"',
'"+sid+"')")
66
return jsonify(status="ok")

@app.route("/teacher_add_notification", methods=['post'])
def teacher_add_notification(): lid=request.form['lid']
topic=request.form['topic']
notification= request.form['notification'] db=Db() db.insert("insert
into `notification`(type,date,topic,notification,sender_id)
values('teacher',curdate(),'"+topic+"','"+notification+"','"+lid+"')")
return jsonify(status="ok")

@app.route("/teacher_add_event", methods=['post']) def


teacher_add_event(): lid=request.form['lid'] name=request.form['name']
img= request.form['img'] details= request.form['details'] db=Db()
db.insert("insert into `event`(name,date,image,details,creator_id,type)
values('"+name+"',curdate(),'"+img+"','"+details+"','"+lid+"'','teacher')")
return jsonify(status="ok")

@app.route("/and_add_event", methods=['post'])
def and_add_event():
name=request.form['name'] date =
request.form['date'] image =
request.form['image'] details =
request.form['details']
lid = request.form['lid']

import time
timestr = time.strftime("%Y%m%d-%H%M%S")
a = base64.b64decode(image)
fh = open(static_path + "pic\\" + timestr + ".jpg", "wb")
path = "/static/pic/" + timestr + ".jpg"
fh.write(a)
fh.close()

db=Db() db.insert("insert into event(name,date,image,details, creator_id,


type) values ('"+name+"', '"+date+"', '"+path+"', '"+details+"','"+str(lid)+"',
'teacher')") return jsonify(status="ok")

@app.route("/send_feedback", methods=['post']) def


send_feedback(): id=request.form['id']
feedback=request.form['feedback'] type=request.form['type']
db=Db() db.insert("insert into
feedback(type,sender_id,date,feedback)
values('"+type+"','"+id+"',curdate(),'"+feedback+"')")
return jsonify(status="ok")

67
@app.route("/add_report", methods=['post']) def
add_report():
id=request.form['id']
report=request.form['report'] type
= request.form['type'] db=Db()
db.insert("insert into report(type,member_id,date,report,reply_date,reply) values
('"+type+"','"+id+"',curdate(),'"+report+"','pending','pending')")
return jsonify(status="ok")

@app.route("/and_view_report", methods=['post'])
def and_view_report(): lid=request.form['lid']
db=Db()
res=db.select("select * from report where member_id='"+lid+"'")
return jsonify(status="ok", data=res)

@app.route("/and_delete_report", methods=['post'])
def and_delete_report(): rid=request.form['rid']
db=Db()
db.delete("delete from report where report_id='"+rid+"'")
return jsonify(status="ok")

@app.route("/teacher_share_article", methods=['post'])
def teacher_share_article(): lid=request.form['lid']
image = request.form['image'] atype =
request.form['atype'] stype = request.form['stype']
gid = request.form['gid']

import time
timestr = time.strftime("%Y%m%d-%H%M%S")
a = base64.b64decode(image)
fh = open(static_path + "pic\\" + timestr + "." + atype, "wb")
path = "/static/pic/" + timestr + "." + atype fh.write(a)
fh.close()

db=Db()
db.insert("insert into article(sender_id,type,article,date, group_id)
values('"+lid+"','"+stype+"','"+path+"',curdate(), '"+gid+"')")
return jsonify(status="ok")

@app.route("/teacher_share_idea", methods=['post'])
def teacher_share_idea(): id=request.form['id']
ideas=request.form['ideas'] db=Db()
db.insert("insert into ideas(idea,teacher_id,date)
values('"+ideas+"','"+id+"',curdate())")
return jsonify(status="ok")

@app.route("/teacher_view_profile", methods=['post'])
def teacher_view_profile(): id=request.form['lid']
db = Db()
68
res=db.selectOne("select * from teacher where teacher_id='"+id+"'")
return jsonify(status="ok",
name=res['name'],place=res['place'],image=res['image'],phone=res['phone'])

@app.route("/teacher_view_discussion", methods=['post'])
def teacher_view_discussion(): db=Db()
res=db.select("select * from discussion, student where
student.student_id=discussion.from_id order by discussion_id desc")
return jsonify(status="ok", data=res)

@app.route("/teacher_view_approved_reply", methods=['post']) def


teacher_view_approved_reply():
id=request.form['did']
db=Db()
# res=db.select("select * from student,discussion_sub where
student.student_id=discussion_sub.sender_id and discussion_sub.discussion_id='"+id+"'
and status='pending'")
res=db.select("select * from student,discussion_sub where
student.student_id=discussion_sub.sender_id and
discussion_sub.discussion_id='"+id+"' and status='approved'")
print(res)
return jsonify(status="ok", data=res)

@app.route("/teacher_view_discussion_reply", methods=['post']) def


teacher_view_discussion_reply():
id=request.form['did']
db=Db()
# res=db.select("select * from student,discussion_sub where
student.student_id=discussion_sub.sender_id and discussion_sub.discussion_id='"+id+"'
and status='pending'")
res=db.select("select * from student,discussion_sub where
student.student_id=discussion_sub.sender_id and
discussion_sub.discussion_id='"+id+"' and status='pending'")
print(res)
return jsonify(status="ok", data=res)

@app.route("/teacher_approve_reply", methods=['post'])
def teacher_approve_reply(): rid=request.form['rid']
db=Db()
db.update("update discussion_sub set status='approved' where sub_id='"+rid+"'")
return jsonify(status="ok")

@app.route("/teacher_reject_reply", methods=['post'])
def teacher_reject_reply(): rid=request.form['rid']
db=Db()
db.update("update discussion_sub set status='rejected' where sub_id='"+rid+"'")
return jsonify(status="ok")
69
@app.route("/view_profile_student", methods=['post'])
def view_profile_student(): id=request.form['lid']
db = Db()
res=db.selectOne("select * from student where student_id='"+id+"'")
return jsonify(status="ok",
name=res['name'],place=res['place'],image=res['image'],phone=res['phone'],email=res['em
ail'],pin=res['pin'])

@app.route("/profile_update_student", methods=['post'])
def profile_update_student(): name =
request.form['name'] place = request.form['place']
phone = request.form['phone'] email =
request.form['email'] pin = request.form['pin'] image
= request.form['attach'] lid = request.form['lid'] if
image != "": import time
timestr = time.strftime("%Y%m%d-%H%M%S")
a = base64.b64decode(image)
fh = open(static_path + "pic\\" + timestr + ".jpg", "wb") path =
"/static/pic/" + timestr + ".jpg" fh.write(a) fh.close() db=Db()
db.update("update student set image='"+path+"' where student_id='"+lid+"'")
db=Db()
db.update("update student set name='"+name+"', place='"+place+"', pin='"+pin+"',
email='"+email+"', phone='"+phone+"' where student_id='"+lid+"'")
db.update("update login set username='"+email+"' where login_id='"+lid+"'") return
jsonify(status="ok")

@app.route("/view_notification", methods=['post']) def


view_notification():
db=Db() res=db.select("select * from notification order by
notification_id desc") if len(res) >0:
return jsonify(status="ok", data=res)
else:
return jsonify(status="no")

@app.route("/view_events", methods=['post']) def


view_events(): db=Db() res=db.select("select * from
event order by event_id desc") if len(res) >0:
return jsonify(status="ok", data=res)
else:
return jsonify(status="no")

@app.route("/student_view_groups", methods=['post'])
def student_view_groups(): db=Db()
lid=request.form['lid']
res=db.select("select * from `group`,group_member where

70
group.group_id=group_member.group_id and stud_id='"+lid+"'")
print(res) if len(res) > 0:
return jsonify(status="ok", data=res)
else:
return jsonify(status="no")

@app.route("/teacher_delete_grp_member", methods=['post']) def


teacher_delete_grp_member():
mid=request.form['mid']
db=Db()
db.delete("delete from group_member where group_member_id='"+mid+"'")
return jsonify(status="ok")
@app.route("/teacher_view_group_members", methods=['post']) def
teacher_view_group_members():
gid=request.form['gid']
db=Db()
res=db.select("select student.*, group_member.group_member_id from student,
group_member where group_member.stud_id=student.student_id and
group_member.group_id='"+gid+"'") return jsonify(status="ok", data=res)

@app.route("/stud_view_article", methods=['post'])
def stud_view_article(): lid=request.form['lid']
db=Db()
res=db.select("select article.*, student.name as name from article,student where
article.sender_id=student.student_id and article.sender_id!='"+lid+"' union (select
article.*, teacher.name as name from article,teacher where
article.sender_id=teacher.teacher_id and article.sender_id!='"+lid+"')") return
jsonify(status="ok", data=res)

@app.route("/student_delete_article", methods=['post'])
def student_delete_article(): aid=request.form['aid']
db=Db()
db.delete("delete from article where article_id='"+aid+"'")
return jsonify(status="ok")

@app.route("/stud_view_article_own", methods=['post'])
def stud_view_article_own(): # lid=request.form['lid']
gid=request.form['gid'] db=Db()
res=db.select("select * from article where group_id='"+gid+"'")
return jsonify(status="ok", data=res)

@app.route("/insert_discussion", methods=['post'])
def insert_discussion(): lid=request.form['lid']
topic=request.form['topic'] db=Db()
db.insert("insert into discussion(topic, date, from_id) values('"+topic+"', curdate(),
'"+lid+"')")

71
return jsonify(status="ok")

@app.route("/student_view_discussion", methods=['post']) def


student_view_discussion():
db=Db()
res=db.select("select * from discussion, student where
student.student_id=discussion.from_id")
return jsonify(status="ok", data=res)

@app.route("/stud_view_ideas", methods=['post']) def


stud_view_ideas():
db=Db()
res=db.select("select * from ideas, teacher where teacher.teacher_id=ideas.teacher_id
order by ideas_id desc")
return jsonify(status="ok", data=res)

@app.route("/and_like_idea", methods=['post']) def


and_like_idea():
idea_id=request.form['id']
lid=request.form['lid'] db=Db()
res=db.selectOne("select * from `like` where idea_id='"+idea_id+"' and
person_id='"+lid+"'") if res is not None:
return jsonify(status="no")
else:
db=Db()
db.insert("insert into `like` values(null, '"+idea_id+"', '"+lid+"', curdate())")
return jsonify(status="ok")

@app.route("/student_view_discussion_reply", methods=['post']) def


student_view_discussion_reply():
id=request.form['did']
db=Db()
res=db.select("select * from student,discussion_sub where
student.student_id=discussion_sub.sender_id and
discussion_sub.discussion_id='"+id+"' and status='approved'")
return jsonify(status="ok", data=res)
@app.route("/insert_answer", methods=['post']) def
insert_answer():
lid=request.form['lid']
did=request.form['did']
ans=request.form['ans'] db=Db()
db.insert("insert into discussion_sub(discussion_id, sender_id, content, date, status)
values('"+did+"', '"+lid+"', '"+ans+"', curdate(), 'pending')") return
jsonify(status="ok")

72
@app.route("/in_message2", methods=['post']) def
in_message2():
lid = request.form['fid'] toid = request.form['toid']
msg = request.form['msg'] db=Db() db.insert("insert
into chat(date,from_id,to_id,message)
values(curdate(),'"+lid+"','"+toid+"','"+msg+"')")
res=db.select("select * from question")
qns=[] answers=[]
scores=[] from
check import chk
obj=chk()
for i in res:
qn=i['question']
qns.append(i['question'])
answers.append(i['answer'])
vec1=obj.text_to_vector(msg)
vec2=obj.text_to_vector(qn) cosine
= obj.get_cosine(vec1, vec2)
scores.append(cosine) print("Score :
", scores) max_score=max(scores)
print("Max : ", max_score)
idx=scores.index(max_score)
print("Index :", idx) print("Question
: ", qns[idx]) print("Answer : ",
answers[idx]) answer = answers[idx]
if max_score == 0.0:
answer = "Sorry. I didnt understand your question."

db = Db()
db.insert(
"insert into chat(date,from_id,to_id,message) values(curdate(),'" + toid + "','" + lid
+ "','" + answer + "')")
return jsonify(status="ok")

@app.route("/view_message2", methods=['post'])
def view_message2(): fid=request.form['fid']
toid=request.form['toid']
lastmsgid=request.form['lastmsgid']
print(fid, toid, lastmsgid)
db=Db()
res=db.select("select * from chat where ((from_id='"+fid+"' and to_id='"+toid+"') or
(from_id='"+toid+"' and to_id='"+fid+"')) and chat_id>'"+lastmsgid+"'")
print(res)
return jsonify(status="ok", data=res)

if __name__ == '__main__':
app.run(port=4000, host="0.0.0.0")

73
6. SYSTEM TESTING

74
6.1 TESTING AND EVALUATION
Testing is a process of executing a program with the intent of finding an error. Software
testing is a critical element of software quality assurance and represents the ultimate review
or specifications, design and coding. Testing includes verifications of the basic logic of each
program and verification that the entire system works properly. Testing demonstrates that
software functions appear to be working according to specification. In addition, data collected
as testing is conducted provided a good indication of software quality as a while. The
debugging process is the most unpredictable part of testing process. Testing begins at the
module level and works towards the integration of the entire computer-based system testing
and debugging are different activities, but any testing includes debugging strategy for
software testing must accommodate low level tests that are necessary to verify that a small
source code segment has been currently implemented as well as high-level tests that validate
major system function, against customer requirements. No testing is complete without
verification and validation part. The goals of verification and validation activities are to
access and improve the quality of work products generated during the development and
modification of the software. There are two types of verification: life cycle verification and
formal verification. Life cycle verification is the process of determining the degree to which
the products of the given phase of the development cycle fulfil the specification established
during the prior process. Formal verification is the rigorous mathematical demonstration that
source code confirms to its specifications. Validation is a process of evaluating software at the
end of the software development process to determine compilation with the requirements.

Software testing is a critical element of software quality assurance and represents the
ultimate review of specification, design and code generation. The primary objectives, when
we test software are the following:

➢ Testing is a process of exceeding with the intent of finding an error.


➢ A good test case is one that has a high probability of finding an undiscovered error.
➢ A successful test is one uncovers undiscovered errors.
75
Thus, testing plays a very critical role in determining the reliability and efficiency of the
software and hence is very important stage in software development. Tests are to be
conducted on the software to evaluate its performance under a number of conditions. Ideally,
it should so at the level of each module and also when all of them are integrated to from the
completed system. Software testing is done at different levels.

6.2 TESTING STRATEGIES


A strategy for software testing integrates software test case design method in to a well-
planned series of steps that result in the successful construction of the software. The strategy
provides a road map that describes the step to be conducted as part of testing, when these
steps are planned and then undertaken, and how much effort, time and resources will be
required. Therefore any testing strategy must incorporate test planning, test case, design, test
execution and resultant data collection and evaluation. A software testing strategy should be
flexible enough to promote a customized testing approach. At the same time, it must be rigid
enough to promote reasonable planning and management tracking as the project progresses.

The general characteristics of software testing strategies are:

➢ Testing begins at the component level and works “outward” toward the integration of
the entire computer system.
➢ Different testing techniques are appropriate at different points in time.

A strategy for software testing must accommodate low-level tests that are necessary to verify
that a small source code segment has been correctly implemented as well as high-level tests
that validate major system functions against customer requirements.

A strategy must provide guidance for the practitioner and set of mild stones for the manager.
Because the step on the test strategy occurs at a time when deadline pressure begins to rise,
progress must be measurable and problem must surface as early as possible.

The software team’s approach to testing is defining a plan that describes an overall strategy
and a procedure that defines specific testing steps and tests that will be conducted. In the
proposed system, if the administrator makes any attempt to login to the application without
entering his password, then the system will not allow the user to login to the application.

76
6.3 TESTING TECHNIQUES
The various testing techniques are given below:

6.3.1 WHITE BOX TESTING

White-box testing is also called as glass-box testing, is a test case design method that goes to

the control structure of the procedural design to derive test cases. Using white box testing

methods, the software engineer can derive test cases that,

✓ Guarantee that all independent paths within a module have been exercised at Least
once.
✓ Exercise all logical decision on their true and false sides.
✓ Execute all loops at their boundaries and within their operational sides.
✓ Exercise internal data structure to ensure their validity.

White box testing was successfully conducted on our system. All independent paths within a
module have been executed at least once and all logical decisions have been exercised on
their true and false sides.

6.3.2 BLACK BOX TESTING

Black-box testing is also called as behavioural testing, focuses on the functional requirement
of the software. It is a complimentary approach that is likely uncover a different class of
errors than white box methods. Black box testing attempts to find errors in the following
categories.

✓ Incorrect or missing functions.


✓ Interface errors.
✓ Error on data structures or external database access.
✓ Behaviour or performance errors.
✓ Initialization and termination errors.

77
Black box testing was successfully conducted on your system. The system was
divided into a number of modules and testing was conducted on each module. We have tested
the system for incorrect or missing functions, interface and performance errors.

6.3.3 UNIT TESTING

Unit testing comprises the set of tests performed by an individual programmer prior to the
integration of the system. Testing removes residual bugs and improves the reliability of the
system.

Testing allows the developer to find out the design faults if any, and enable correction if
needed. Exhaustive unit testing has to be carried out to ensure the validity of the data. In
order to successfully test the entire package, unit testing is carried out. Each module was
tested as when it was developed. Thus, it proved easier to conduct minute testing operation
and correct them then and there.

6.3.4 INTEGRATION TESTING

Bottom-up integration is the traditional strategy used to integrate the component of a software
system into a functional whole. Bottom-up integration consists of unit testing, followed by
subsystem testing and followed by testing of the entire system. Unit testing has the goal of
discovering errors in the individual parts of the system.

Parts are tested in isolation from one another in an artificial environment known as “Test
Harness”, which consists of driver programs and data necessary to exercise the modules. Unit
testing should be as exhaustive as possible to entire that each representative case handled by
each module has been tested. Unit testing is eased by a system structure that is composed of
small loosely coupled modules.

Both control and data interfaces must be rested. Large software system may require several
levels of subsystem testing. Lower level subsystems are successively combined to form
higher level subsystems. In most software systems, exhaustive testing of subsystem
capabilities is not feasible due to the combination complexity of the module interfaces.
Therefore, test cases must be carefully chosen to exercise the interfaces in the desired manner.

78
6.3.5 ACCEPTANCE TESTING

Acceptance testing involves planning and execution of functional tests, performance tests and
stress tests in order to demonstrate that the implemented system satisfies its requirements. It is
not unusual for two sets of acceptance test to be run, those developed by the quality group
and those developed by the customer.

In addition to the functional and performance tests, stress tests are performed to determine
the limitation of the system. For example, a compiler might be tested to determine the effect
of the symbol table overflow, or real-time system might be tested to determine the effect of
simultaneous arrival of numerous high priority interrupts.

6.3.6 OUTPUT TESTING

Output testing of the proposed system is important since no system could be useful if it does
not produce the required output.

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. For the hard copy also the output comes out
as the specified requirements by the user. Hence output testing doesn’t result in any
correction on the system.

7.SYSTEM IMPLEMENTATION AND


DEPLOYMENT

79
Implementation is the process of deploying the new system in the operational environment.
Proper implementation is essential to provide a reliable system to meet the organizational
requirement. There are four types of implementation methods. They are Direct Changeover,
Phased Implementation, Parallel Run and Pilot Approach. The most commonly used
implementation methods are Pilot Approach and Parallel Run.

The system which is developed as a web application hence the other functions as normal
application, as usual some web development technologies are used in the implementation of
the project. The language I selected to program this software is PHP. The reason I selected
PHP is that is a simple and powerful language that especially developed to create web
application.

Technologies used in the development of the software are:

✓ Programming language – Python


✓ DBMS – MySQL server
✓ Development tool – PyCharm
✓ Development platform – Windows 10

The front end is HTML, and CSS and back end is MySQL Server and Python. The system
developed on PyCharm in Windows 10 operating system.

80
8. CONCLUSION

The ‘CampusTalk: your personal college chatbot’ has been developed for all given conditions
and it is found working effectively under the all the circumstances that may arise in the real
environment. It is helpful in guiding students with correct and most up to date sources of
information. It is advantageous for international applicants for queries such as fee payment
and academic matters. Students can get the information at their fingertips rather than visiting
college office. It improves efficiency by taking over tasks for which humans are not essential.
Nevertheless, active learning helps to improve the bot performance for handling off-script
queries. The system is done with an insight into the necessary modifications that may be
required in the future. Hence the system can be maintained successfully without much work.

8.1 FUTURE ENHANCEMENT

To improve the current functionalities of College Chatbot, in the future, the scope of the
chatbot can be increased by inserting data for all the departments, training the bot with varied
data, testing it on live website, and based on that feedback inserting more training data to the
bot. Some of the new features which can be added to the bot are

1) speech recognition feature through which students can ask their queries verbally and get
the answers from the bot.

81
2) integration with multiple channels such as phone call, SMS, and various social media
platforms like Skype, Facebook and Twitter.

3) handling context aware and interactive queries in which bot will be aware of the context of
an ongoing conversation with a student.

4) integration with services such as password reset and course enrolment.

9.REFERENCE

BOOKS:
Database System Concept: Marvin .F. Korth
A Byte of Python : Swaroop C H
Apress Software Engineering : Rajib Mall

WEBSITES:
www.wikipedia.com
www.tutorialspoint.com
www.youtube.com www.codementor.io

82
10. APPENDIX

SCREENSHOTS

Admin-login page:

83
Admin- home page

84
85
Add event

86
View event

Add questions

View questions

87
Add notification

View report & send reply

88
View members

89
ANDROID

User IP connection

90
Login page

91
Student signup

92
Teacher signup

93
Teacher home

94
Student home

95
96

You might also like