Quiz Contest A Quiz Application A PROJEC
Quiz Contest A Quiz Application A PROJEC
Quiz Contest A Quiz Application A PROJEC
Quiz Contest
(A Quiz Application) A
PROJECT REPORT
Submitted by
NAME
2
BONAFIDE CERTIFICATE
Certified that this project report on ‘Quiz Contest’ – a Quiz Android application
is the bonafide work of Paritosh Ram who carried out the project work under
my supervision.
Signature of Mentor
______________________
Jaydeep Mondal
Pvt. Ltd.
Salt Lake,kolkata
3
ACKNOWLEDGEMENT
I take this opportunity to express my deep gratitude and most sincere thanks to
my project mentor, Jaydeep Mondal for giving most valuable suggestion, helpful
guidance and encouragement in the execution of this project work.
I would like to thank my mentor for guiding me. Last but not the least I'm
grateful to all the team members of HPE.
Paritosh Ram
Contents
Page no.
1.Introduction
1.1 Relevance………………………………………………
………………. 5
1.2 Problem
Definition………………………………………………….
5
1.3 Objective…………………………………………………
…………….. 6
2.Basic Concepts & Tools
2.1 Introduction to
Java……………………………………………….. 7-9
2.2 Android…………………………………………………
………………..9-13
3.System Analysis
3.1 Feasibility
4
Study……………………………………………………
13-14
3.2 Existing
System………………………………………………………
14-15
3.3 Proposed
System……………………………………………………
16
4.Software requirements……………………………..
……………….. 17
5.Hardware requirements………………………………………………
17
6.Diagram
3.1Data-flow
Diagram…………………………………………………..1718
3.2 Use-case
Diagram……………………………………………………..19
3.3 Entity-relationship
Diagram……………………………………… 20
3.4 Table
Diagram…………………………………………………………
.. 20
7.Form
Design……………………………………………………………
………. 21
8.Testing
8.1 Objective…………………………………………………
……………….. 21-22
8.2 Process
Overview……………………………………………………
.. 22-23
8.3 Testing
Process………………………………………………………
… 23-25
8.4 Testing
Strategy……………………………………………………
…. 25
5
8.5 Test
Cases…………………………………………………………
…….. 26-27
9.Results….…………………………………………..
………..................... 27-31
10. Future scope and further enhancement of the Project…… 32
11. Code ………………………………………………………..
……………………33-46
12. Conclusion……………………………………………………
………………… 48
13. References…………………………………………………
……………………. 48
14. Bibliography
……………………………………………………………….....
49
Introduction:
Relevance:
Quiz Contest is an android application that has general questions
related to current affairs and computer. It has multiple choice
questions with time limit and it also calculate scores of each
correct answer. It is good for students of every age group it helps
in increasing general knowledge about world ,Sports and
computer etc. Don't need register simply give any user name and
password it will saved automatically and you can login again with
same user name and password don’t have to worry about the
past score. The application helps the user to increase his/her
knowledge. Since Smartphone mobiles are being widely used by
general population and students, the Quiz Contest application
can provide on the Student's mobile.
Problem Definition:
6
Objective:
The main objective of “Quiz Contest” is to facilitate a user
friendly environment for all users and reduces the manual
effort. In past days quiz is conducted manually but in further
resolution of the technology we are able to
generate the score and pose the queries automatically. The
functional requirements include to create users that are going
to participate in the quiz, automatic score and report generation and
administrative tasks like add, delete, update for admin privilege
users. In this application, all the
permissions lies with the administrator i.e., specifying the details of
the quiz with checking result will show to interviewee or not,
addition of question and answers, marks for each question, Set timer
for each quiz and generate report with score for each quiz.
Basic Concepts &Tools :
Introduction to Java
7
Characteristics of Java
The target of Java is to write a program once and then run this
program on multiple operating systems.
Java has the following properties:
Android
Android is a software platform and operating system for mobile
devices. Android is available as open source. It allows developers
to write managed code in the Java language, controlling the device
via Google-developed Java libraries.
Architecture of Android OS
Architecture of Android OS
Applications Layer
Android ships with a set of core applications including an email
client, SMS program, calendar, maps, browser, contacts and
others. All applications are built using the Java. Each of the
applications aims at performing a specific task that it is actually
intended to do.
Application Framework Layer
The next layer is the application framework. This includes the
programs that manage the phone’s basic functions like resource
allocation, telephone applications, switching between processes
or programs and keeping track of the phone's physical location.
Application developers have full access to Android's application
11
Components of Android
iA tp
yp l iai cc t
i o
n
Android Components
Activity
An Activity is, fundamentally, an object that has a lifecycle. An
Activity is a chunk of code that does some work, as necessary.
The work can include displaying a UI to the user, though it
doesn't have to as some Activities never display UIs. Typically,
we designate one of our application's Activities as the entry
point to our application.
Broadcast Receiver
Broadcast Receiver is yet another type of component that can
receive and respond to any of the broadcast announcements.
Service
A Service is a body of code that runs in the background. It can
run in its own process, or in the context of another application's
process, depending on its needs. Other components "bind" to a
Service and invoke methods on it via remote procedure calls. An
example of a Service is a media player; even when the user quits
13
the mediaselection UI, she probably still intends for her music to
keep playing. A Service keeps the music going even when the UI
has completed.
Content Provider
Content Provider is a data storehouse that provides access to
data on the device; the classic example is the Content Provider
that is used to access the user's list of contacts. Our application
can access data that other applications have exposed via a
Content Provider, and we can also define our own Content
Providers to expose data of our own.
System Analysis:
Feasibility Study:
The feasibility study is an evaluation and analysis of the
potential of a proposed project which is based on extensive
investigation and research to support the process of decision
making. Depending on the results of the initial investigation the
survey is now expanded to a more detailed feasibility study.
Feasibility Study
System: Quiz Contest Date: 15-03-2017
Author: XXX Page: 1
Product
The project is a Quiz android application . It will help its users to improve their general
knowledge.
Technical Feasibility
14
The android application will be developed using Android Studio. The team is competent in
that. Social Feasibility
Some training for the users/admin are required but all users are IT literate. Market Research
Market research says that this application would be useful for the users as it could seamlessly
help them for their lifestyle.
Economic Feasibility
The application can be developed within budget.
Alternate Solution
Could be a desktop system but that would not be as portable.
Existing System:
Proposed System:
Unlike the websites where you need to make account for every
quiz you want to play, using this application based on android,
you just have to login by user name and password and then you
will get access to all quizzes from it. The proposed system is an
application for the Android platform mobiles will help in
improving the knowledge and accuracy. Android is a Linux-
based operating system designed primarily for touch screen
mobile devices such as smart phones and tablet computers,
developed by Google in conjunction with the Open Handset
Alliance.
The proposed system will be developed for Android mobiles
only because the market share of Android is more than other
operating systems.
Table of Comparison :
Comparison of Existing System & Proposed System Parameters
Existing Proposed
System System
Method Manual Automatic
16
Software Requirements:
Operating System: Android
Database: SQLite
Hardware Requirements:
2.3 minimum version (API 8)
Android phone (Having Version Above or
2.3)
Diagram:
Level 0 DFD:
Entity-Relationship Diagram:
18
Table Diagram:
Components---
Testing:
Objective:
The objective our test plan is to find and report as many
bugs as possible to improve the integrity of our
program. Although exhaustive testing is not possible,
we will exercise a broad range of tests to achieve our
goal. We will also test the user friendliness of our app
.The application will be used as an important tool, but
we would like to ensure that it could be run on a variety
of platforms with little impact on performance or
usability.
Process Overview :
20
Testing Process:
Specifications Document.
Design/Build Test Procedures includes setting up
procedures such as Error Management systems and
Status reporting.
Testing Strategy :
23
Test Cases:
24
Results:
Splash Screen:
25
Login Screen:
User Profile:
27
Continue page:
Quiz page(GameStart):
28
Score page(QuizActivity):
29
1)MainActivity.java :
package com.example.quiz_contest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
30
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
Thread t=new Thread()
{ public void run()
{ try {
Thread.sleep(3000);
Intent intent=new
Intent(getApplicationContext(), LoginScreen.class);
startActivity(intent);
}
catch (Exception e)
{
e.printStackTrace();
}
}
};
t.start();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if
it is present. getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
2)HomeScreen.java :
package com.example.quiz_contest;
android.app.AlertDialog; import
android.content.Context; import
android.content.DialogInterface; import
android.content.Intent; import
android.content.SharedPreferences; import
android.os.Bundle; import
android.view.Menu; import
android.view.View; import
android.view.View.OnClickListener; import
31
android.widget.Button; import
android.widget.TextView;
TextView tv;
String n;
Button btn,btn2,btn3;
SharedPreferences sharedpreferences;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_screen);
tv=(TextView)findViewById(R.id.textView1);
btn=(Button)findViewById(R.id.button1);
btn2=(Button)findViewById(R.id.button2);
btn3=(Button)findViewById(R.id.button3); Bundle
data=getIntent().getExtras(); n=data.getString("Name");
tv.setText("Welcome "+n);
btn.setOnClickListener(new OnClickListener() {
@Override
sharedpreferences=getSharedPreferences(LoginScreen.MyPREFERENCES,
Context.MODE_PRIVATE);
SharedPreferences.Editor
editor=sharedpreferences.edit();
editor.clear();
editor.commit();
Intent i=new
Intent(getApplicationContext(),LoginScreen.class);
startActivity(i); } });
32
btn2.setOnClickListener(new OnClickListener() {
@Override
i.putExtra("Name", n);
startActivity(i);
});
btn3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent i=new
Intent(getApplicationContext(),HighScores.class);
i.putExtra("Name", n);
startActivity(i);
});
@Override
new
AlertDialog.Builder(this).setIcon(android.R.drawable.ic_dialog_alert).setTi
tle("Exit") .setMessage("Are you sure?")
.setPositiveButton("yes", new
DialogInterface.OnClickListener() {
@Override
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent); finish();
} }).setNegativeButton("no", null).show();
@Override
return true;
3) LoginScreen.java :
package com.example.quiz_contest;
SharedPreferences sharedpreferences;
EditText et1,et2;
Button btn; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_screen);
et1=(EditText)findViewById(R.id.editText1);
et2=(EditText)findViewById(R.id.editText2);
btn=(Button)findViewById(R.id.button1);
sharedpreferences=getSharedPreferences(MyPREFERENCES,
Context.MODE_PRIVATE);
String val=sharedpreferences.getString(Name, null); if(val!=null)
{
Intent i=new Intent(getApplicationContext(), HomeScreen.class);
i.putExtra("Name", val); startActivity(i);
}
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String name=et1.getText().toString(); String
pass=et2.getText().toString();
if(name.equals("") || pass.equals(""))
{
Toast.makeText(getApplicationContext(), "login
details Empty.!", Toast.LENGTH_LONG).show(); return;
}
SharedPreferences.Editor editor=sharedpreferences.edit();
editor.putString(Name, name); editor.putString(Password, pass);
editor.commit();
Intent i=new Intent(getApplicationContext(),
HomeScreen.class);
i.putExtra("Name", name);
startActivity(i);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_login_screen, menu); return true;
}
4) GameStart.java :
35
package com.example.quiz_contest;
extends Activity {
RadioGroup rg;
TextView tv; Button
btn; private Cursor p;
String n;
private SQLiteDatabase db;
String q[]={ "UNIVAC is",
"The basic operations performed by a computer are",
"The two major types of computer chips are",
"Microprocessors as switching devices are for which generation
computers",
"The main electronic component used in first generation computers
was",
"ASCII and EBCDIC are the popular character coding systems. What
does EBCDIC stand for?",
"The brain of any computer system is",
"Storage capacity of magnetic disk depends on",
"The two kinds of main memory are:",
"A storage area used to store data to a compensate for the
difference in speed at which the different units can handle data is",
"Computer is free from tiresome and boardoom. We call it",
"Integrated Circuits (Ics) are related to which generation of
computers?",
"CD-ROM is a",
"A hybrid computer",
"Which type of computers uses the 8-bit code called EBCDIC?",
"The ALU of a computer responds to the commands coming from",
"Chief component of first generation computer was",
"To produce high quality graphics (hardcopy) in color, you would
want to use a/n",
"What are the stages in the compilation process?",
"Which of the following IC was used in third generation of
computers?",
"Dos is Spanish for which number?","How many hours are equal to
600 minutes?",
"Can you unscramble this word to find the name of a country:
36
SUSAIR?",
"What is the meaning of the Latin phrase ‘bona fide’?","What do the
fifty stars on the US flag represent?",
"Which country is first to appear in the English dictionary?","What is
the last letter of the Greek alphabet?",
"What name is given to a triangle with one angle greater than 90
degrees?",
"What is the name of Scooby Doo`s psychedelic van?","What is the
largest island in the Caribbean?",
"Which TV series features a chemistry teacher called Walter
White?",
"Which F.R.I.E.N.D.S. character makes jokes when he is
uncomfortable?",
"If you were born December 4th, which star sign would you belong
to?",
"In the film Shrek, what is the name of Shrek`s wife?","What was
the name of the boy in the Jungle Book?",
"What is the name of the actor who played the role of Harry Potter
in the film series?",
"Which Bond movie did Daniel Craig first star in?","Who played Jack
in the film The Titanic?",
"From which movie did this quote come from: A lie keeps growing
and growing until it is as plain as the nose on your face?",
"How many square meters are there in a hectare?","How many
rings does Saturn have around it?",
"Which of the five senses develops first?","How many carats are
there in pure gold?",
"Who scored the winning penalty in the 2006 world cup final?","How
many red balls are used in a game of snooker?",
"Who has won the most FIFA Ballons d Or?","In which sport is the
Davis cup awarded?",
"At what time did Andres Iniesta score the winning goal to help Spain win their first
World Cup ever?"
};
String a[]={"Universal Automatic Computer","Arithmetic operation","External memory chip","First
Generation","Transistors","Extended Binary Coded Decimal
Interchange Code","ALU","tracks per inch of surface",
"Primary and secondary","Memory","Accuracy","First
generation","Semiconductor memory","Resembles digital
computer","Minicomputers","Primary memory","Transistors","RGB monitor"
,"Feasibility study, system design and
testing","SSI" ,"Transistors","many words","22","20","Uruguay","in good
faith","Presidents","Argentina","Omega","Obtuse","The Mystery Traveller",
"Cuba","Prison Break","Ross","Gemini","Alice","Timon","Daniel
Radcliffe","Spectre","Christan Bale","Toy Story","10000","4","Touch","22",
"Andrea Pirlo","12","Cristiano Ronaldo","Football","117"}; String
b[]={"Universal Array Computer","Logical operation","Primary memory chip","Second
Generation","Extended Bit Code Decimal Interchange Code","Memory","bits per inch of
tracks","Random and
sequential","Buffer","Reliability","Second generation","Memory register","Resembles analogue
computer","Microcomputers",
37
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i=new Intent(getApplicationContext(),
QuizActivity.class);
i.putExtra("Name", n); startActivity(i);
}
});
38
}
protected void createDatabase()
{ db=openOrCreateDatabase("QuizDB.db", Context.MODE_PRIVATE, null); db.execSQL("CREATE
TABLE IF NOT EXISTS questions(id INTEGER PRIMARY
KEY AUTOINCREMENT NOT NULL, question VARCHAR, opA VARCHAR," +
"opB VARCHAR, opC VARCHAR,opD VARCHAR,answer
NUMBER)"); }
protected void insertDB()
{
//tv.setText("Getting the quiz ready..."); int l=50;
for(int i=0;i<l;i++)
{
String query="INSERT INTO
questions(question,opA,opB,opC,opD,answer) values('"+q[i]+"','"+a[i]+"','"+b[i]+
"','"+c[i]+"','"+d[i]+"','"+ans[i]+"');)";
db.execSQL(query);
}
Toast.makeText(getApplicationContext(), "Application ready to use!",
Toast.LENGTH_SHORT).show();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu); return true;
}
5) QuizActivity.java :
package com.example.quiz_contest;
TextView tv,tv2,tv3,tv4;
RadioGroup rg;
Button btn;
39
@Override
public void onClick(View v) {
// TODO Auto-generated method stub int
res=rg.getCheckedRadioButtonId(); switch(res) {
case 0: case 1: case 2:
case 3: break;
default:
Toast.makeText(getApplicationContext(),
"Select atleast one option", Toast.LENGTH_SHORT).show(); return;
}
if(res==Integer.parseInt(c.getString(6)))
{
Toast.makeText(getApplicationContext(),
"Correct Answer!", Toast.LENGTH_SHORT).show();
scr+=nscr;
tv2.setText("Score: "+scr);
} else
{ mp=MediaPlayer.create(getApplicationContext(),
R.raw.alert2); mp.start();
Toast.makeText(getApplicationContext(), "Incorrect
Answer!", Toast.LENGTH_SHORT).show(); }
if(questions<10)
{
//c.moveToNext();
rg.removeAllViews();
getQuestion(); timer.cancel();
pb.setProgress(100);
startCount();
} else
{
40
pb.setProgress(pb.getProgress()-5);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_quiz, menu); return true;
}
6) HighScores.java :
package com.example.quiz_contest;
NUMBER)"); }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_high_scores, menu); return true;
}
7)FinalActivity.java :
package com.example.quiz_contest;
}
}
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent i=new Intent(getApplicationContext(),
HomeScreen.class);
i.putExtra("Name", n); startActivity(i);
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_final, menu); return true;
}
Conclusion:
Currently there are many medication reminder systems which
are operable manually. Due to increased manual work, the
available system becomes more time consuming. So in the
given work, an attempt has been made to implement fully
automatic medication reminder system. It eases the user’s task
of recalling when to take the medicine by reminding them of
the particular medicine at the correct time thereby reducing
the much prevalent manual work.
44
References:
[1] Neil Smyth, Android Studio Development Essentials,1
edition, Create Space Independent Publishing Platform(July 22,
2014).
www.stackoverflow.com
www.w3schools.co m
www.wikipedia.org
45
Contest