You are on page 1of 24

A

PROJECT REPORT
ON
“TODO LIST”

SUBMITTED BY
Mr. Salunke Om Sachin [135]

Under the guidance of


Mr.A.L.Deokate

Department of Computer Technology


Sanjivani Rural Education Society’s
SANJIVANI K. B. P. POLYTECHNIC
KOPARGAON – 423603, DIST : AHMEDNAGAR
2023-2024

1
Sanjivani Rural Education Society’s
SANJIVANI K. B. P. POLLYTEHNIC
DEPARTMENT OF COMPUTER TECHNOLOGY

CERTIFICATE
This is to certify that the Project report entitled
“TODO LIST”

Submitted by
Mr. Salunke Om S [135]
Under our supervision and guidance for partial fulfillment of the
requirement for
DIPLOMA IN COMPTUTER TECHNOLOGY

Mr.A.L.Deokate Mr. G. N. Jorvekar


Project guide. H.O.D

2
ACKNOWLEDGEMENT

First and foremost, we, express my deep sense of gratitude, and sincere and
deep sense of appreciation to project Guide Mr.A.L.Deokate, Department of
Computer Technology, Sanjivani
K.B.P. Polytechnic Kopargaon. Your availability at any time throughout the
year, valuable guidance, option, view, comments, critics, encouragement, and
support tremendously boosted this project work.
Lots of thanks to Mr.G.N.Jorvekar, head of Department Computer
Technology Department, for providing us the best support we ever had. We like
to express my sincere gratitude to Mr.A.R.Mirikar, principal Sanjivani K.B.P.
Polytechnic, Kopargaon for providing a great platform to complete the project
within the schedule time.
We are also thankful to all the faculty members, the Computer Technology
Department, Sanjivani
K.B.P. polytechnic, and Kopargaon for giving comments for the Improvement
of work, encouragement and help during completion of the project.
Last but not the least, we should say thanks from the bottom of our hearts to my
Family and Friends for their never-ending love, help, and support in so many
ways through all this time.
Thank you so much.

Salunke Om Sachin (135)

3
INDEX

SR.NO TITLE PAGE NO.

1. Introduction 5

2. Code 6-20

3. Output 21-23

4. Conclusion 24

5. References 24

4
INTRODUCTION

In the digital age, educational tools and platforms have become indispensable
for both learners and educators. With the widespread use of smartphones,
creating engaging and interactive learning experiences through mobile
applications has become increasingly popular. One such application is a quiz
app, which not only helps users test their knowledge but also provides a fun and
dynamic way to learn new concepts.

Our quiz app developed in Android Studio using Java aims to provide users
with an intuitive and stimulating interface to participate in quizzes on various
topics. Through this app, users can challenge themselves, track their progress,
and reinforce their understanding of different subjects. Whether it's preparing
for exams, exploring new topics, or simply enjoying a trivia game, our quiz app
offers a versatile platform for learning and entertainment

5
CODE
//activity_main.xml:-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".MainActivity">

<TextView
android:id="@+id/AppName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Quiz App"
android:gravity="center"
android:textSize="44sp"
android:textStyle="bold" />

<ImageView
android:id="@+id/logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_below="@id/AppName"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
app:srcCompat="@drawable/logo" />

<TextView
android:id="@+id/questionTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"

6
android:text="Choose Quiz Mode"
android:gravity="center"
android:layout_below="@+id/logo"
android:textSize="34sp"
android:layout_marginTop="50dp"
android:textStyle="bold" />

<Button
android:id="@+id/easyBtn"
android:layout_width="190dp"
android:layout_height="60dp"
android:backgroundTint="#EDD928"

android:layout_centerHorizontal="true"
android:layout_below="@id/questionTextView"
android:layout_marginTop="26dp"
android:textColor="@color/white"
android:textSize="20dp"

android:text="Easy" />

<Button
android:id="@+id/midBtn"
android:layout_width="190dp"
android:backgroundTint="#1653CC"
android:layout_height="60dp"
android:textSize="20dp"
android:textColor="@color/white"

android:layout_centerHorizontal="true"
android:layout_below="@id/easyBtn"
android:layout_marginTop="28dp"
android:text="Medium" />
<Button
android:id="@+id/hardBtn"
android:layout_width="190dp"
android:layout_height="60dp"

7
android:textSize="20dp"

android:textColor="@color/white"
android:backgroundTint="#F60247"
android:layout_centerHorizontal="true"
android:layout_below="@id/midBtn"
android:layout_marginTop="28dp"
android:text="Hard" />
</RelativeLayout>
//activity_quiz_page.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
tools:context=".quiz_page">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:textSize="34dp"
android:gravity="center"
android:layout_marginTop="20dp"
android:layout_height="wrap_content"
android:text="Quiz Mode:-"
/>
<TextView
android:id="@+id/totalquestion"
android:layout_width="match_parent"
android:textSize="24dp"
android:gravity="center"
android:layout_below="@+id/title"
android:layout_marginTop="10dp"
android:layout_height="wrap_content"
android:text="Questions:-"
/>

8
<TextView
android:id="@+id/timer"
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="20dp"
android:layout_below="@id/totalquestion"
android:text="(0)"/>
<TextView
android:id="@+id/question"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/totalquestion"
android:gravity="center"
android:textSize="20dp"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:layout_marginTop="70dp"
android:text="Grastest Batsman of all time Grastest Batsman of all timeGrastest
Batsman of all time"
/>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/option1"
android:layout_width="320dp"
android:layout_height="60dp"
android:background="@drawable/buttondesign"
android:layout_centerHorizontal="true"
android:layout_below="@id/question"
android:layout_marginTop="26dp"
android:textColor="@color/white"
android:textSize="20dp"
android:text="Option1" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/option2"
android:layout_width="320dp"

9
android:layout_height="60dp"
android:background="@drawable/buttondesign"
android:layout_centerHorizontal="true"
android:layout_below="@id/option1"
android:layout_marginTop="16dp"
android:textColor="@color/white"
android:textSize="20dp"
android:text="Option2" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/option3"
android:layout_width="320dp"
android:layout_height="60dp"
android:background="@drawable/buttondesign"
android:layout_centerHorizontal="true"
android:layout_below="@id/option2"
android:layout_marginTop="16dp"
android:textColor="@color/white"
android:textSize="20dp"
android:text="Option3" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/option4"
android:layout_width="320dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:layout_below="@id/option3"
android:layout_marginTop="16dp"
android:background="@drawable/buttondesign"
android:textColor="@color/white"
android:textSize="20dp"
android:text="Option4" />
<Button
android:id="@+id/submit"
android:layout_width="320dp"
android:layout_height="60dp"
android:backgroundTint="#1EA4E1"
android:layout_centerHorizontal="true"
android:layout_below="@id/option4"

10
android:layout_marginTop="56dp"
android:textColor="@color/white"
android:textSize="20dp"
android:text="Next" />
</RelativeLayout>
//MainActivity.java
package com.example.microproject;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {


Button easyBtn,medBtn,hardBtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
easyBtn = findViewById(R.id.easyBtn);
medBtn = findViewById(R.id.midBtn);
hardBtn = findViewById(R.id.hardBtn);
easyBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent t1 = new Intent(MainActivity.this, quiz_page.class);
t1.putExtra("mode",10);
startActivity(t1);
}
});medBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent t1 = new Intent(MainActivity.this, quiz_page.class);
t1.putExtra("mode",15);
startActivity(t1);

11
}
});hardBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent t1 = new Intent(MainActivity.this, quiz_page.class);
t1.putExtra("mode",20);
startActivity(t1);
}
});
}
}
//quiz_page.java
package com.example.microproject;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class quiz_page extends AppCompatActivity {


Button option1,option2,option3,option4,submit;
TextView questions,question,title,timer;
int totalAskQuestion=10;
int score=0,totalQuestion=totalAskQuestion;
int currentQuestionIndex=0;
String selectedAns="";
@Override
protected void onCreate(Bundle savedInstanceState) {

12
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz_page);
int num = getIntent().getIntExtra("mode",10);
totalAskQuestion=num;
totalQuestion=num;
title=findViewById(R.id.title);
if(num==10){
title.setText("Quiz Mode:- Easy");
} else if (num==15) {
title.setText("Quiz Mode:- Medium");

}
else{
title.setText("Quiz Mode:- Hard");

}
// Toast.makeText(this, num, Toast.LENGTH_SHORT).show();
MainLoader();
TimerChecker();
}
public void MainLoader(){

option1 =findViewById(R.id.option1);
option2 =findViewById(R.id.option2);
option3 =findViewById(R.id.option3);
option4 =findViewById(R.id.option4);
questions= findViewById(R.id.totalquestion);
question= findViewById(R.id.question);
submit =findViewById(R.id.submit);

option1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
option_fun1();
}
});option2.setOnClickListener(new View.OnClickListener() {
@Override

13
public void onClick(View v) {
option_fun2();
}
});option3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
option_fun3();
}
});
option4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
option_fun4();
}
});
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

if(totalAskQuestion>(currentQuestionIndex+1)){

if(QuestionAnswer.correctAnswer[currentQuestionIndex]==selectedAns){
score++;
}
currentQuestionIndex++;
if(totalAskQuestion<(currentQuestionIndex+2)) {
submit.setText("Submit");
}

loadNewQuestion();
}
else{
if(QuestionAnswer.correctAnswer[currentQuestionIndex]==selectedAns){
score++;
}
resultDeclare(score+" correct out of "+totalQuestion);

14
}
}

});
loadNewQuestion();

}
public void resultDeclare(String message){
AlertDialog dialog = new AlertDialog.Builder(quiz_page.this)
.setTitle("Result")
.setMessage(message)
.setPositiveButton("ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
Intent t1 = new Intent(quiz_page.this,MainActivity.class);
startActivity(t1);
}
}).create();
dialog.show();

}
public void loadNewQuestion(){
submit.setVisibility(View.INVISIBLE);
questions.setText("Questions:("+(currentQuestionIndex+1)+"/"+totalQuestion+")");
question.setText(QuestionAnswer.question[currentQuestionIndex]);
option1.setBackgroundColor(Color.RED);
option2.setBackgroundColor(Color.RED);
option3.setBackgroundColor(Color.RED);
option4.setBackgroundColor(Color.RED);
option1.setText(QuestionAnswer.choices[currentQuestionIndex][0]);
option2.setText(QuestionAnswer.choices[currentQuestionIndex][1]);
option3.setText(QuestionAnswer.choices[currentQuestionIndex][2]);
option4.setText(QuestionAnswer.choices[currentQuestionIndex][3]);
}
public void option_fun1() {
submit.setVisibility(View.VISIBLE);

15
selectedAns=option1.getText().toString();
option1.setBackgroundColor(Color.GREEN);
option2.setBackgroundColor(Color.RED);
option3.setBackgroundColor(Color.RED);
option4.setBackgroundColor(Color.RED);
}
public void option_fun2() {
submit.setVisibility(View.VISIBLE);

selectedAns=option2.getText().toString();
option1.setBackgroundColor(Color.RED);
option2.setBackgroundColor(Color.GREEN);
option3.setBackgroundColor(Color.RED);
option4.setBackgroundColor(Color.RED); }
public void option_fun3() {
submit.setVisibility(View.VISIBLE);

option1.setBackgroundColor(Color.RED);
option2.setBackgroundColor(Color.RED);
option3.setBackgroundColor(Color.GREEN);
option4.setBackgroundColor(Color.RED);
selectedAns=option3.getText().toString();

}
public void option_fun4() {
submit.setVisibility(View.VISIBLE);

option1.setBackgroundColor(Color.RED);
option2.setBackgroundColor(Color.RED);
option3.setBackgroundColor(Color.RED);
option4.setBackgroundColor(Color.GREEN);
selectedAns=option4.getText().toString();

}
private Handler mHandler = new Handler();
public void TimerChecker() {
timer= findViewById(R.id.timer);

16
t1.run();
}

public Runnable t1 = new Runnable() {


final int[] i = {0}; // Declare i outside of run()

@Override
public void run() {
Log.d("error", "welcome");
try {
i[0]++;
timer.setText("(" + i[0] + "/60)");
if (i[0] == 60) {
resultDeclare(score + " correct out of " + totalAskQuestion);
mHandler.removeCallbacks(t1);
return;
}
mHandler.postDelayed(this, 1000);
} catch (Exception e) {
Log.d("error", e.getMessage());
}
}
};

}
//QuestionAnswer.java
package com.example.microproject;

public class QuestionAnswer {

public static String hardquestion[]={


"What is the capital of France?",
"Who wrote the play \"Hamlet\"?",
"What is the chemical symbol for gold?",
"Which planet is known as the \"Red Planet\"?",
"What is the tallest mountain in the world?",

17
"What is the largest mammal in the world?",
"Who painted the Mona Lisa?",
"What is the currency of Japan?",
"Which country is famous for kangaroos?",
"What is the national flower of India?",
"Which gas is most abundant in Earth's atmosphere?",
"Who is known as the father of modern physics?",
"What is the chemical formula for water?",
"What is the main ingredient in guacamole?",
"Which country is famous for the Great Barrier Reef?",
"What is the largest ocean on Earth?",
"Who discovered penicillin?",
"What is the capital of Brazil?",
"Which planet is known as the \"Blue Planet\"?",
"What is the speed of light in a vacuum?"
};
public static String hardchoice[][]={
{"Berlin", "Paris","London","Rome"},
{"William Shakespeare", "Charles Dickens","Jane Austen","Leo Tolstoy"},
{"Ag", "Au","Fe","Hg"},
{"Mars", "Venus","Jupiter","Saturn"},
{"Mount Kilimanjaro", "Mount Everest","K2","Matterhorn"},
{"African Elephant", "Blue Whale","Giraffe","Polar Bear"},
{"Leonardo da Vinci", "Vincent van Gogh","Pablo Picasso","Michelangelo"},
{"Yen", "Won","Yuan","Euro"},
{"Australia", "Canada","Brazil","India"},
{"Lotus", "Rose","Sunflower","Tulip"},
{"Oxygen", "Nitrogen","Carbon dioxide","Helium"},
{"Isaac Newton", "Albert Einstein","Galileo Galilei","Niels Bohr"},
{"H2O", "CO2","NaCl","C6H12O6"},
{"Avocado", "Tomato","Onion","Cilantro"},
{"Australia", "Canada","Brazil","Mexico"},
{"Pacific Ocean", "Atlantic Ocean","Indian Ocean","Arctic Ocean"},
{"Alexander Fleming", "Louis Pasteur","Marie Curie","Thomas Edison"},
{"Rio de Janeiro", "Brasília","São Paulo","Salvador"},
{"Earth", "Mars","Neptune","Uranus"},

18
{"299,792,458 meters per second", "300,000,000 meters per second","299,792
kilometers per second","300,000 kilometers per second"}
};
public static String hardcorrectAnswer[]={
"Paris","William Shakespeare","Au","Mars",
"Mount Everest","Blue Whale","Leonardo da Vinci","Yen",
"Australia","Lotus","Nitrogen","Albert Einstein",
"H2O","Avocado","Australia","Pacific Ocean",
"Alexander Fleming","Brasília","Earth","299,792,458 meters per second"
};
public static String question[]={
"Which planet is known as the \"Morning Star\" and the \"Evening Star\"?",
"Who is the author of the Harry Potter series?",
"What is the largest organ in the human body?",
"What is the chemical symbol for iron?",
"In which city would you find the Eiffel Tower?",
"Who wrote the novel \"1984\"?",
"Which animal is known as the \"Ship of the Desert\"?",
"What is the currency of the United Kingdom?",
"What is the process by which plants make their food called?",
"Who painted the ceiling of the Sistine Chapel?",
"What is the study of earthquakes called?",
"What is the hardest natural substance on Earth?",
"Which famous scientist developed the theory of general relativity?",
"What is the national animal of China?",
"What is the longest river in the world?",
"What is the largest ocean on Earth?",
"Who discovered penicillin?",
"What is the capital of Brazil?",
"Which planet is known as the \"Blue Planet\"?",
"What is the speed of light in a vacuum?"
};
public static String choices[][]={
{"Mercury", "Venus","Mars","Jupiter"},
{"J.K. Rowling", "Stephen King","George R.R. Martin","J.R.R. Tolkien"},
{"Heart", "Brain","Liver","Skin"},
{"Ir", "Fe","In","Au"},

19
{"London", "Paris","Rome","New York"},
{"George Orwell", "Aldous Huxley","Ray Bradbury","Ernest Hemingway"},
{"Camel", "Horse","Elephant","Lion"},
{"Euro", "Dollar","Pound Sterling","Yen"},
{"Photosynthesis", "Respiration","Digestion","Circulation"},
{"Leonardo da Vinci", "Michelangelo","Raphael","Donatello"},
{"Seismology", "Biology","Astronomy","Geology"},
{"Diamond", "Graphite","Quartz","Topaz"},
{"Isaac Newton", "Albert Einstein","Stephen Hawking","Niels Bohr"},
{"Giant Panda", "Dragon","Tiger","Phoenix"},
{"Nile", "Amazon","Yangtze","Mississippi"},
{"Pacific Ocean", "Atlantic Ocean","Indian Ocean","Arctic Ocean"},
{"Alexander Fleming", "Louis Pasteur","Marie Curie","Thomas Edison"},
{"Rio de Janeiro", "Brasília","São Paulo","Salvador"},
{"Earth", "Mars","Neptune","Uranus"},
{"299,792,458 meters per second", "300,000,000 meters per second","299,792
kilometers per second","300,000 kilometers per second"}
};
public static String correctAnswer[]={
"Venus","J.K. Rowling","Skin","Fe","Paris",
"George Orwell","Camel","Pound Sterling","Photosynthesis","Michelangelo",
"Seismology","Diamond","Albert Einstein","Giant Panda","Nile","Alexander
Fleming","Brasília","Earth","299,792,458 meters per second"
};

20
OUTPUT

21
22
23
CONCLUSION

our quiz app developed in Android Studio using Java has emerged as a
powerful tool for promoting learning and engagement among users. Through
its user-friendly interface, diverse question formats, and interactive features,
the app has successfully provided a platform for users to test their knowledge,
challenge themselves, and expand their understanding of various topics.

REFERENCES

• https://www.geeksforgeeks.org/android-tutorial/
• https://developer.android.com/guide
• https://www.javatpoint.com/android-tutorial
• https://www.tutorialspoint.com/android/index.htm

24

You might also like