0% found this document useful (0 votes)
18 views

Micro-Project Report - MAD

The document describes a quiz application for Android. It has the following key points: 1) The quiz application allows users to take general knowledge quizzes on topics like current affairs and computers with multiple choice questions and a time limit. 2) It automatically calculates scores for correct answers and allows users to check their high scores without needing to register an account. 3) The proposed application aims to automate the quiz taking process and generate automatic reports and scores, addressing limitations of existing manual quiz systems.

Uploaded by

So
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Micro-Project Report - MAD

The document describes a quiz application for Android. It has the following key points: 1) The quiz application allows users to take general knowledge quizzes on topics like current affairs and computers with multiple choice questions and a time limit. 2) It automatically calculates scores for correct answers and allows users to check their high scores without needing to register an account. 3) The proposed application aims to automate the quiz taking process and generate automatic reports and scores, addressing limitations of existing manual quiz systems.

Uploaded by

So
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

“ Quiz Application ”

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.

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.

Existing System:

User has to Login first by giving any user name and password it will be added automatically
in database so that user can login again in future by same user name and password.  Then
Welcome(user profile) will be appear user has to choose any of three option 'Start Game',
'High Score', 'Logout'.  After choosing start game continue page will be appear to continue
game.  After Clicking on continue multiple choice questions will come automatically one
by one with a specific time limit.  User has to choose any of four existing options and then
user has to hit the submit button and each right answer will automatically count the score. 
At the end of the game it will show the score of the user. All these findings demands new
application which will reduce the manual work & do everything automatically. Also the
existing systems have some major drawbacks which motivate us to develop new system.
Those drawbacks are as follows: 18 ▪ Quest won't get update automatically need to update
manually. ▪ Existing systems has not type of fields in like questions on
History,Game,Sports,Geography etc. ▪ There is possibility of hanging down the existing
systems.

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 :

Software Requirements:
Operating System: Android
Toolkit: Software Development Toolkit(SDK)
Platform: Java and Android
Android phone (Having Version Above or 2.3)
Output Of Project :-
Coding :-

Activity_main.xml

<?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.vikasojha.quizbee.MainActivity"
>

<TextView
android:id="@+id/textView"
android:layout_width="363dp"
android:layout_height="88dp"
android:layout_above="@+id/editName"
android:layout_alignParentStart="true"

android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginStart="41dp"
android:layout_marginLeft="41dp"
android:layout_marginTop="61dp"
android:layout_marginEnd="23dp"
android:layout_marginRight="23dp"
android:layout_marginBottom="178dp"
android:text="Wel-Come To Quiz"
android:textColor="#F44336"
android:textSize="36dp" />

<Button
android:id="@+id/button"
android:layout_width="200dp"
android:layout_height="52dp"
android:layout_above="@+id/button2"
android:layout_alignStart="@+id/editName"
android:layout_alignLeft="@+id/editName"
android:layout_marginBottom="25dp"
android:background="#FF5722"
android:fontFamily="casual"
android:text="Start"
android:textColor="#ffffff"
android:textSize="30dp" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="@+id/editName"
android:textColor="#df040b"
android:hint="Enter Your Name"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />

<Button
android:layout_width="200dp"
android:layout_height="52dp"
android:text="About"
android:visibility="invisible"
android:id="@+id/button2"
android:textSize="30dp"
android:layout_marginBottom="33dp"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/button"
android:layout_alignStart="@+id/button"
android:background="#01579B"
android:textColor="#ffffff" />
</RelativeLayout>
Activity_quitions.xml

<?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.vikasojha.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_dark"
android:text="Your Score"
android:id="@+id/textView3"
android:visibility="invisible"
android:textColor="#000000"
android:textSize="19dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"/>
<TextView
android:layout_width="wrap_content"
android:visibility="invisible"
android:layout_height="24dp"
android:textAppearance="@color/abc_background_cache_hint_selector_material_dark"
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>

Activity_result.xml

<?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.vikasojha.quizbee.ResultActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="28dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvres"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="70dp"

android:gravity="center_horizontal"
android:textColor="#000000"
android:textAlignment="center"
android:textSize="19dp" />

<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Restart"
android:id="@+id/btnRestart"
android:layout_alignParentBottom="true"
android:layout_marginBottom="119dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:background="#01579B"
android:textColor="#ffffff" />

<TextView
android:layout_width="wrap_content"
android:layout_height="28dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvres2"

android:layout_below="@+id/tvres"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="31dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:textColor="#000000"
android:gravity="center_horizontal"
android:textSize="19dp" />

<TextView
android:id="@+id/tvres3"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_above="@+id/btnRestart"
android:layout_below="@+id/tvres2"

android:layout_alignEnd="@+id/tvres2"
android:layout_alignRight="@+id/tvres2"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginStart="165dp"
android:layout_marginLeft="165dp"

android:layout_marginTop="39dp"
android:layout_marginEnd="172dp"
android:layout_marginRight="172dp"
android:layout_marginBottom="310dp"
android:gravity="center_horizontal"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000"
android:textSize="19dp" />
</RelativeLayout>

Main_Activity.java

package com.example.vikasojha.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);
}
});
}
}

QuestionsActivity.java

package com.example.vikasojha.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[] = {
"Android is Developed by?",
"Android is an _____________ Operating system?",
"Android is based on which kernel?",
"AVD Stands for?",
"DVM Stands for?",
"What year was the Open Handset Alliance announced?",
"If you want share the data across the all applications
,you should go for?",
"What built-in database is Android shipped with?",
"Which one is not a nickname of a version of Andriod?",
"The ___________ file specifies the layout of your
screen?"
};
String answers[] = {"Android Inc.","Open
Source","Linux","Android Virtual Device","Dalvik Virtual
Machine","2007","Content provider","SQLite","Muffin","Layout file"};
String opt[] = {
"Apple","Android Inc.","Microsoft","Google",
"Close Source","Commercial","Proprietary","Open Source",
"Windows","Linux","Mac","Redhat",
"Android Virtual Machine","Android Virtual
Device","Android Virtual Data","Android Virtual Development",
"Dalvik Virtual Machine","Device Virtual
Machine","Dalvik Virtual Management","Java Virtual Machine",
"2005","2007","2006","2008",
"SQLite Databases","Internal Storage","Shared
Preferences","Content provider",
"Apache","SQLite","MySQL","Oracle",
"Muffin","cupcake","Gingerbread","Honeycomb",
"Layout file","Manifest file","Strings XML","R file"
};

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) {
//int color = mBackgroundColor.getColor();
//mLayout.setBackgroundColor(color);

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();
// Toast.makeText(getApplicationContext(), ansText,
Toast.LENGTH_SHORT).show();
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);
}
});
}

Result_Activity.java

package com.example.vikasojha.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);
}
});
}
}

Mobile App ScreenShot’s :-

You might also like