Campus Chat Bot
Campus Chat Bot
Submitted by
VIDYA SHREE S 23MCAB36
MANNA AN CHERIYAN 23MCAB17
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.
Valued by
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
3 System Design 28
4
3.4 Data Flow Diagrams 38
3.5 ER Diagrams 46
4 Coding 48
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
8 Conclusion 91
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
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:
● 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.
9
● There are no ambiguous requirements.
● Ample resources with required expertise are available to support the product.
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.
● Easy to manage due to the rigidity of the model. Each phase has specific deliverables
and a review process.
● Works well for smaller projects where requirements are very well understood.
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
● 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.
● 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
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.
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.
• Time consuming
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
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.
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.
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
The software required for the application depends on the following factors:
Software Requirement
This specifies the minimum software requirements for implementing the system. This
includes:
The software required for the application depends on the following factors:
15
✔ Financial factors.
✔ Maintenance and support.
Hardware Requirement
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.
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)?
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
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
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
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.
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.
➢ 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.
• Control Redundancy
• Ease of Use
• Data Independence
24
• Accuracy and Integrity
2.student table
25
3.Teacher table
Column name Data type Constraints Description
4. Event table
Column name Data type Constraints Description
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
7. article table
Column name Data type Constraints Description
8.discussion table
Column name Data type Constraints Description
27
Discussion_id int Primary key Unique identifier
9.discussion_sub table
Column name Data type Constraints Description
10.notification table
Column name Data type Constraints Description
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
15.group_member table
29
Column name Data type Constraints Description
16.chat table
Column name Data type Constraints Description
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.
➢ A Circle represents a process that transforms incoming data flow(s) into outgoing
data flow(s):
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
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.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.
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.
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
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.
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.
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:
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
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
8. If you wish to select the particular element with a specific id, the # function along
9. If you wish to select the elements with a specific class, the period character along
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
13. ID selector: This selector uses the id of the HTML element so that a specific
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.
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.
• It is light weighted.
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
optional)
• Media support for common audio, video, and still image formats
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.
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 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:
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.
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.
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.
Distributed
Java is designed as a distributed language for creating application on network.
It has the ability to share both data & Program.
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
4.3.8 PYCHARM:
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")
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_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")
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_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_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_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("/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()
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_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("/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("/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")
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 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:
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
✓ 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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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