QuizApp
15IT324E Mini Project Report
Submitted by
Jishnu Sen : RA1711003010049
Sidhant Khokhar : RA1711003010142
Subroto Das : RA1711003010194
In partial fulfillment of the requirements for the degree of
BACHELOR OF TECHNOLOGY
DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING
FACULTY OF ENGINEERING AND TECHNOLOGY
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
KATTANKULATHUR- 603 203
BONAFIDE CERTIFICATE
Certified to be the project report titled “QuizApp” is the bonafide work
done by Jishnu Sen (RA1711003010049) , Sidhant Khokhar
(RA1711003010042) and Subroto Das (RA1711003010194) of CSE B.
Tech Degree course in the theory 15IT324E Mini Project Report
during the academic year 2019-20.
Sign of the Faculty
Name : S. Prabhakaran
Department of Computer Science and Engineering
Date of Submission: 18 April, 2020
ACKNOWNLEDGMENT
It is a matter of great pleasure and privilege for me to present this report
of Mobile App Development Project. Through this report , I would like
to thank numerous people whose consistent support and guidance has
been the standing pillar in architecture of this report.
To begin with, my sincere thanks to Dr.C.Muthamizhchelvan,(Director
E&T). I express thanks to Dr. B. Amutha, HOD-CSE who gave
encouragement and valuable suggestions throughout the training.
I would like to express my sincere thanks to Mr S. Prabhakaran
(102261), Mobile App Development Faculty, for guiding me during the
project.
TABLE OF CONTENTS
Sl. No. Topic Page No.
1. Abstract
2. Introduction
3. System Requirements
4. Code
5. Dataflow Diagram
6. Screenshots
7. Conclusion
8. Bibliography
ABSTRACT
This application is developed for educational purpose, allowing the
users to prepare for the multiple choice questions for different
examinations. The main goal of the application is to enable users to
practice for objective questions conducted for admissions and
recruitment ,with focus on computer science field. The quiz consists of
ten objective questions that are chosen randomly. This quiz includes two
functions – next question and quit. If the user doesn’t know the answer
of the current question he can choose to skip it and continue . The user
can also quit the quiz at any moment . Once all the questions are
completed or the user quits , the user is shown his/her final score.
INTRODUCTION
In today’s world, smartphones have changed our lives and have become
an indispensable part of our lives because of its specialty to simplify our
routine work and thereby saving our time. A smartphone with an
Android OS offers excellent functionality to the users offering a distinct
experience. Android is a Linux based operating system and it was
bought by Google in 2005. There are tons of applications available on
Android and one of the prime reason for this vast number is android
being open source. On the other hand, android based device like mobile,
tab are very user friendly. A survey was done by “Light Castle Partners”
research wing which indicates that though other operating system exist
but the majority of users go with android operating system.
In this context, the project application is developed based on android
platform. The name of application is define as ‘QuizApp”. Aims of this
project is to develop an android platform supported Quiz application. It
is an offline quiz application. So, goals of this project to facilitate users
to configure quizzes as well as giving quizzes with this android based
smart phone. User friendly environment configuration is also another
goal for this project application.
The main objective of 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.
SYSTEM REQUIREMENTS
Minimum System Requirements for Android Studio 3.6:
4 GB RAM minimum, 8 GB RAM recommended
2 GB of available disk space minimum, 4 GB Recommended (500 MB for
IDE + 1.5 GB for Android SDK and emulator system image)
1280 x 800 minimum screen resolution
Microsoft Windows 7/8/10 (32- or 64-bit). The Android Emulator supports
64-bit Windows only
Minimum System Requirements for Quiz App:
Android 7.0 and above
20 MB of free space
512 MB and above RAM
Screen size 4” and above
CODE
Main.java
package com.example.subroto.quizbee;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
public class QuestionsActivity extends AppCompatActivity {
TextView tv;
Button submitbutton, quitbutton;
RadioGroup radio_g;
RadioButton rb1,rb2,rb3,rb4;
String questions[] = {
"Which method can be defined only once in a
program?",
"Which of these is not a bitwise operator?",
"Which keyword is used by method to refer to
the object that invoked it?",
"Which of these keywords is used to define
interfaces in Java?",
"Which of these access specifiers can be used
for an interface?",
"Which of the following is correct way of
importing an entire package ‘pkg’?",
"What is the return type of Constructors?",
"Which of the following package stores all the
standard java classes?",
"Which of these method of class String is used
to compare two String objects for their equality?",
"An expression involving byte, int, & literal
numbers is promoted to which of these?"
};
String answers[] = {"main
method","<=","this","interface","public","import pkg.*","None of the
mentioned","java","equals()","int"};
String opt[] = {
"finalize method","main method","static
method","private method",
"&","&=","|=","<=",
"import","this","catch","abstract",
"Interface","interface","intf","Intf",
"public","protected","private","All of the mentioned",
"Import pkg.","import pkg.*","Import pkg.*","import
pkg.",
"int","float","void","None of the mentioned",
"lang","java","util","java.packages",
"equals()","Equals()","isequal()","Isequal()",
"int","long","byte","float"
};
int flag=0;
public static int marks=0,correct=0,wrong=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_questions);
final TextView score = (TextView)findViewById(R.id.textView4);
TextView textView=(TextView)findViewById(R.id.DispName);
Intent intent = getIntent();
String name= intent.getStringExtra("myname");
if (name.trim().equals(""))
textView.setText("Hello User");
else
textView.setText("Hello " + name);
submitbutton=(Button)findViewById(R.id.button3);
quitbutton=(Button)findViewById(R.id.buttonquit);
tv=(TextView) findViewById(R.id.tvque);
radio_g=(RadioGroup)findViewById(R.id.answersgrp);
rb1=(RadioButton)findViewById(R.id.radioButton);
rb2=(RadioButton)findViewById(R.id.radioButton2);
rb3=(RadioButton)findViewById(R.id.radioButton3);
rb4=(RadioButton)findViewById(R.id.radioButton4);
tv.setText(questions[flag]);
rb1.setText(opt[0]);
rb2.setText(opt[1]);
rb3.setText(opt[2]);
rb4.setText(opt[3]);
submitbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(radio_g.getCheckedRadioButtonId()==-1)
{
Toast.makeText(getApplicationContext(), "Please select
one choice", Toast.LENGTH_SHORT).show();
return;
}
RadioButton uans = (RadioButton)
findViewById(radio_g.getCheckedRadioButtonId());
String ansText = uans.getText().toString();
if(ansText.equals(answers[flag])) {
correct++;
Toast.makeText(getApplicationContext(), "Correct",
Toast.LENGTH_SHORT).show();
}
else {
wrong++;
Toast.makeText(getApplicationContext(), "Wrong",
Toast.LENGTH_SHORT).show();
}
flag++;
if (score != null)
score.setText(""+correct);
if(flag<questions.length)
{
tv.setText(questions[flag]);
rb1.setText(opt[flag*4]);
rb2.setText(opt[flag*4 +1]);
rb3.setText(opt[flag*4 +2]);
rb4.setText(opt[flag*4 +3]);
}
else
{
marks=correct;
Intent in = new
Intent(getApplicationContext(),ResultActivity.class);
startActivity(in);
}
radio_g.clearCheck();
}
});
quitbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new
Intent(getApplicationContext(),ResultActivity.class);
startActivity(intent);
}
});
}
Layout.java
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.subroto.quizbee.QuestionsActivity">
<TextView
android:layout_width="200dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/DispName"
android:textColor="@color/accent_material_light"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/DispName"
android:layout_alignStart="@+id/DispName"
android:id="@+id/answersgrp"
android:clickable="true"
android:layout_centerVertical="true">
<!--android:layout-->
<!--android:checkedButton="@+id/radioButton"-->
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="A"
android:id="@+id/radioButton"
android:checked="false"
/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="B"
android:id="@+id/radioButton2"
android:checked="false" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="C"
android:id="@+id/radioButton3"
android:checked="false" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="D"
android:id="@+id/radioButton4"
android:checked="false" />
</RadioGroup>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Next Question"
android:id="@+id/button3"
android:layout_marginTop="27dp"
android:layout_below="@+id/answersgrp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#FF5722"
android:textColor="#ffffff"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Quit"
android:id="@+id/buttonquit"
android:layout_marginTop="20dp"
android:layout_below="@+id/button3"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="#01579B"
android:textColor="#ffffff" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Questions"
android:id="@+id/tvque"
android:layout_marginBottom="52dp"
android:layout_above="@+id/answersgrp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="24dp"
android:textAppearance="@color/abc_background_cache_hint_selector_material_dar
k"
android:text="Your Score"
android:id="@+id/textView3"
android:textColor="#000000"
android:textSize="19dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="24dp"
android:textAppearance="@color/abc_background_cache_hint_selector_material_dar
k"
android:id="@+id/textView4"
android:text="0"
android:textColor="#000000"
android:layout_alignParentBottom="true"
android:textAlignment="center"
android:layout_alignParentRight="true"
android:textSize="19dp" />
</RelativeLayout>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.subroto.quizbee">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity android:name=".QuestionsActivity">
<intent-filter>
<action
android:name="com.example.subroto.quizbee.QuestionsActivity" />
<category android:name="android.intent.category.DEFAULT"
/>
</intent-filter>
</activity>
<activity android:name=".DeveloperActivity">
<intent-filter>
<action
android:name="com.example.subroto.quizbee.DeveloperActivity" />
<category android:name="android.intent.category.DEFAULT"
/>
</intent-filter>
</activity>
<activity android:name=".ResultActivity"></activity>
</application>
</manifest>
COMPONENTS
DeveloperActivity.java
package com.example.subroto.quizbee;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.QuickContactBadge;
import android.widget.TextView;
import org.w3c.dom.Text;
public class ResultActivity extends AppCompatActivity {
TextView tv, tv2, tv3;
Button btnRestart;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result);
tv = (TextView)findViewById(R.id.tvres);
tv2 = (TextView)findViewById(R.id.tvres2);
tv3 = (TextView)findViewById(R.id.tvres3);
btnRestart = (Button) findViewById(R.id.btnRestart);
StringBuffer sb = new StringBuffer();
sb.append("Correct answers: " + QuestionsActivity.correct + "\n");
StringBuffer sb2 = new StringBuffer();
sb2.append("Wrong Answers: " + QuestionsActivity.wrong + "\n");
StringBuffer sb3 = new StringBuffer();
sb3.append("Final Score: " + QuestionsActivity.correct + "\n");
tv.setText(sb);
tv2.setText(sb2);
tv3.setText(sb3);
QuestionsActivity.correct=0;
QuestionsActivity.wrong=0;
btnRestart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new
Intent(getApplicationContext(),MainActivity.class);
startActivity(in);
}
});
}
}
MainActivity.java
package com.example.subroto.quizbee;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button startbutton=(Button)findViewById(R.id.button);
Button aboutbutton=(Button)findViewById(R.id.button2);
final EditText nametext=(EditText)findViewById(R.id.editName);
startbutton.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
String name=nametext.getText().toString();
Intent intent=new
Intent(getApplicationContext(),QuestionsActivity.class);
intent.putExtra("myname",name);
startActivity(intent);
}
});
aboutbutton.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v) {
Intent intent=new
Intent(getApplicationContext(),DeveloperActivity.class);
startActivity(intent);
}
});
}
}
QuestionActivity.java
package com.example.subroto.quizbee;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
public class QuestionsActivity extends AppCompatActivity {
TextView tv;
Button submitbutton, quitbutton;
RadioGroup radio_g;
RadioButton rb1,rb2,rb3,rb4;
String questions[] = {
"Which method can be defined only once in a
program?",
"Which of these is not a bitwise operator?",
"Which keyword is used by method to refer to the
object that invoked it?",
"Which of these keywords is used to define
interfaces in Java?",
"Which of these access specifiers can be used for
an interface?",
"Which of the following is correct way of
importing an entire package ‘pkg’?",
"What is the return type of Constructors?",
"Which of the following package stores all the
standard java classes?",
"Which of these method of class String is used to
compare two String objects for their equality?",
"An expression involving byte, int, & literal
numbers is promoted to which of these?"
};
String answers[] = {"main method","<=","this","interface","public","import
pkg.*","None of the mentioned","java","equals()","int"};
String opt[] = {
"finalize method","main method","static method","private
method",
"&","&=","|=","<=",
"import","this","catch","abstract",
"Interface","interface","intf","Intf",
"public","protected","private","All of the mentioned",
"Import pkg.","import pkg.*","Import pkg.*","import pkg.",
"int","float","void","None of the mentioned",
"lang","java","util","java.packages",
"equals()","Equals()","isequal()","Isequal()",
"int","long","byte","float"
};
ResultsActivity.java
package com.example.subroto.quizbee;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.QuickContactBadge;
import android.widget.TextView;
import org.w3c.dom.Text;
public class ResultActivity extends AppCompatActivity {
TextView tv, tv2, tv3;
Button btnRestart;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result);
tv = (TextView)findViewById(R.id.tvres);
tv2 = (TextView)findViewById(R.id.tvres2);
tv3 = (TextView)findViewById(R.id.tvres3);
btnRestart = (Button) findViewById(R.id.btnRestart);
StringBuffer sb = new StringBuffer();
sb.append("Correct answers: " + QuestionsActivity.correct + "\n");
StringBuffer sb2 = new StringBuffer();
sb2.append("Wrong Answers: " + QuestionsActivity.wrong + "\n");
StringBuffer sb3 = new StringBuffer();
sb3.append("Final Score: " + QuestionsActivity.correct + "\n");
tv.setText(sb);
tv2.setText(sb2);
tv3.setText(sb3);
QuestionsActivity.correct=0;
QuestionsActivity.wrong=0;
btnRestart.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent in = new
Intent(getApplicationContext(),MainActivity.class);
startActivity(in);
}
});
}
FLOW CHART
Screenshots
CONCLUSION
The Android app ecosystem is rich and diverse and their usage is
changing people’s lives. Apps alone aren’t going to make the world a
better place , but the people developing and using them are working to
share information, teach, collaborate , and that will make the world a
better place . It already has. QuizApp is one such attempt to educate the
students about the developments in the Computer Science field. We
really got to understand the efforts that are made to make even a simple
offline application like this. This project really helped us to fine-tune
our application development skills and the ability to work in a team. It
will also help us in our future endeavours . In the future versions of this
app , multiple fields can be added . Also , the students can get an option
to add questions in this app.
BIBLIOGRAPHY
For the completion of this project, the following references were used:
1. www.developer.android.com
2. www.freecodecamp.org
3. www.tutorialspoint.com
4. www.javatpoint.com
5. www.w3schools.com