Design advice: multiple choice quiz
<p>I'm interested in hearing what you guys think is the most efficient/solid object-oriented design for a simple multiple choice quiz. </p>

<p>Basically, the app presents a series of questions with 4 choices each. If the choice you selected is correct, then a new activity will display some congrats and full details behind the correct answer and if you're wrong it'll say you got it wrong, along with the details, etc. </p>

<p>After that, the user goes to the next question. On each new question, you'll see your score so far. So maybe you get 50 points for each correct answer, something like that. </p>

<p>Here's how I thought about implementing this: Create a custom view with some radiobuttons or some other widget that could be used for choosing an answer. The custom view takes a Question object, which is just a regular old java object, with fields for choices 1-4. Then, in the custom view, I can set the text of the radiobuttons to the choices from my Question object. </p>

<p>So in my <code>activity</code> it would look something like <code>Question myQuestion = new Question("string for choice 1", "string for choice 2"...)</code> </p>

<p>And then..</p>

<p>Use the question with my custom view. <code>QuestionView myView = new QuestionView(this, myQuestion);</code></p>

<p>Ok so that's all great. I'm just wondering if I'm setting myself up for trouble. For one, I've got to keep track of the score across all the question activities. Does it make sense to have all of my questions subclass some, mostly empty, <code>activity</code> that I create which can have a counter in it that gets incremented anytime the user gets an answer right (i.e in my superclass activity <code>int scoreKeeper;</code> and in each activity that subclasses this activity: <code>if(choiceIsCorrect) scoreKeeper++</code>). This will allow the score to persist across the activities. I realize I could hold a score between activities by passing and extra to each new activity and then simply adding to it, but that doesn't really seem to make sense to me. </p>

<p>Sorry for all of the blabbering..but I guess my questions are: what do you think is the simplest design for this? Also, in general, I always assumed that you should always use a new activity whenever the user is doing a "single, focused thing"...as the Android paradigm states. But sometimes it feels weird to create so many activities. I know the fact that "it feels weird" is no reason not to do it, but when does it make sense to simply reuse on activity (e.g. in this case, just swapping in a new question in my activity and updating the UI accordingly) as opposed to starting a new activity? </p>

<p>Also, a more detailed question - what would be a smooth way to set which choice (e.g. which radiobutton) contains the right answer, so that when the user presses submit, I can check if they have the right answer and yes/no then react accordingly? </p>

<p>To summarize: </p>

<ol>
<li>What is a straightforward, object-oriented way to create a succession of multiple choice question activities?</li>
<li>What's the most sensible way to keep track of the score? </li>
<li>Does each question necessarily need to be a separate activity? (And, in general, how do you guys approach the question of whether something ought to be a separate activity?)</li>
<li>Also, kind of a particular: what's the easiest way for me to flag which choice is the correct one so I can check to see if the user got right? I know that with a radiobutton, for example, you can use onCheckedChangeListener and retrieve which radiobutton is currently checked, but I'm not sure how to use that in my design to check if the user got it right...</li>
</ol>

<p>Thanks!</p>
