From fe0721ae4783d16428cd443b7f1837e434032976 Mon Sep 17 00:00:00 2001 From: Srujan Jha Date: Fri, 6 Mar 2015 20:42:14 +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/model/QuizModel.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/BuildmLearnStore/src/com/buildmlearnstore/model/QuizModel.java b/source/BuildmLearnStore/src/com/buildmlearnstore/model/QuizModel.java index 1a8ecbd..801a77e 100644 --- a/source/BuildmLearnStore/src/com/buildmlearnstore/model/QuizModel.java +++ b/source/BuildmLearnStore/src/com/buildmlearnstore/model/QuizModel.java @@ -12,6 +12,11 @@ public class QuizModel { public static QuizModel mQuizModel; + public static void clearInstance() + { + mQuizModel.totalCorrect=0; + mQuizModel.totalWrong=0; + } public static QuizModel getInstance() { if(mQuizModel==null)