From 5925fe4b3cee9170b9a721a86ac48b5aa0b31a3e Mon Sep 17 00:00:00 2001 From: Srujan Jha Date: Fri, 6 Mar 2015 20:40:04 +0530 Subject: [PATCH] Quiz Template: The score gets added, when the quiz is restarted/played again. The score(total correct, total wrong) adds up with the quiz taken previously, if the quiz is restarted/played again. Also the Unanswered gets wrong. This issue is fixed now. I have just initialized the variables: totalCorrect and totalWrong in the QuizModel to '0', and called this function from ScoreActivity, whenever the quiz is restarted. --- .../src/com/buildmlearnstore/activities/ScoreActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/BuildmLearnStore/src/com/buildmlearnstore/activities/ScoreActivity.java b/source/BuildmLearnStore/src/com/buildmlearnstore/activities/ScoreActivity.java index c1ccebe..3c8dacf 100644 --- a/source/BuildmLearnStore/src/com/buildmlearnstore/activities/ScoreActivity.java +++ b/source/BuildmLearnStore/src/com/buildmlearnstore/activities/ScoreActivity.java @@ -66,6 +66,7 @@ public void onClick(View arg0) { Intent myIntent = new Intent(arg0.getContext(), QuestionActivity.class); startActivityForResult(myIntent, 0); + mQuizModel.clearInstance(); finish(); } }); @@ -75,6 +76,7 @@ public void onClick(View arg0) { @Override public void onClick(View arg0) { + mQuizModel.clearInstance(); // android.os.Process.killProcess(android.os.Process.myPid()); finish(); }