Android Quiz App MAD
Android Quiz App MAD
Benefits:
● Proposed Methodology:
Technology in the field of education is constantly evolving, growing and this increase will continually
offer new and extraordinary advances in the field of education. Traditional E-learning systems developed
for laptop and desktops were based on standalone application and web based application architecture.
These applications will have some limitations to be used effectively or we cannot use them easily since
these applications need a computing device and network connectivity. With the advancement in the
mobile technology and availability of smart mobile devices and networks we can create a system which
can be used to check knowledge levels of students. Since mobile network is available at maximum areas
so this can be used for the knowledge testing of any person specially candidates of software company
who need a specific skill for job
The current system developed is feasible. Thus it provides easy access to the users. The database’s
purpose is to make, establish and maintain a workflow among various entities in order to facilitate all
concerned users in their different capacities or roles. Permission to the users would be granted based on
the roles specified. Therefore, this provides the technical guarantee of correctness, speed and security.
The software and hard requirements for the development of this project are not many and are already
available in-house at NIC or are available as free as open source. The work for the project is done with
the current equipment and existing software technology. Necessary bandwidth exists for providing fast
feedback to the users irrespective of the number of users using the system. The main theme of this app is
to save time while conducting examinations. Generally, to conduct exams we need so much infrastructure
,but here if we have the application installed it is enough for the examination.
Modules:-
● VALIDATION: Every student needs to have a unique account to login and password to write the exam.
In this validation phase the database validates the user only if user id and password matches.
● CHOOSE TEST: In this module students can choose from various tests to appear and write the test
accordingly.
● FETCH URL: Here we provide some number of links for preparing the subjects and prepare for the test
by following the material provided in the link.
● VIEW RESULT: After completing the exam the result will be declared in this
Procedures:-
Software Requirements
2 Review of Literature
4 Resources Required
6 Design of System
11 Testing of System
12 Compilation of Report
13 Compilation of Presentation
14 Presentation of Seminar
15 Final Submission
● Resources Required:
Sr
Name of Resource/Material Specification Qty. Remarks
No
Thus the main objective of the project is to develop an interactive mobile application based on an android
platform to conduct quiz sessions in the class for different technical topics. On further enhancement this
app can be used for the college which will be able to save time and efforts to arrange quizzes manually.
Benefits:
package com.example.vikasojha.quizbee;
import android.graphics.Color;
/**
* Created by Sushant on 23-11-2016.
*/
import java.util.Random;
public class BackgroundColor
{ private String[] mColors =
{
"#39add1", // light blue
"#3079ab", // dark blue
"#c25975", // mauve
"#e15258", // red
"#f9845b", // orange
"#838cc7", // lavender
"#7d669e", // purple
"#53bbb4", // aqua
"#51b46d", // green
"#e0ab18", // mustard
"#637a91", // dark gray
"#f092b0", // pink
"#b7c0c7" // light gray}
};
public int getColor(){
//Randomly generate a color
String color;
Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(mColors.length);
color = mColors[randomNumber];
int colorAsInt;
colorAsInt = Color.parseColor(color);
return colorAsInt;
}
}
package com.example.Damini.quizbee;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
btnRestart.setOnClickListener(new View.OnClickListener()
{ @Override
public void onClick(View v) {
Intent in2 = new Intent(getApplicationContext(),MainActivity.class);
startActivity(in2);
}
});
}
}
package com.example.Damini.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;
{ @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);
}
});
}
}
package com.example.Damini.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;
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);
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);
}
});
}
}
package com.example.Damini.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;
@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);
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);
}
});
}
}
<?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.Damini.quizbee.DeveloperActivity">
<?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.Damini.quizbee.MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quizapp"
android:layout_marginTop="48dp"
android:textSize="60dp"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_alignLeft="@+id/editName"
android:layout_alignStart="@+id/editName"
android:textColor="#F44336" />
<Button
android:layout_width="200dp"
android:layout_height="52dp"
android:text="Start"
android:id="@+id/button"
android:textSize="30dp"
android:layout_above="@+id/button2"
android:layout_alignLeft="@+id/editName"
android:layout_alignStart="@+id/editName"
android:layout_marginBottom="25dp"
android:background="#FF5722"
android:textColor="#ffffff" />
<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: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>
<?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.Damini.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>
</resources>
www.campusify.co.in
www.google.com