Multiple and single choice test
<p>I am working on a Single choice and Multiple choice test.</p>

<p>I have couple of questions and 4 answers for each question.</p>

<p>I am shuffling the answers as each answer is assigned to radio button.
This is how i am shuffling the arraylist where Random is a arraylist with items and r1,r2,r3,r4 are radio buttons.</p>

<pre><code>random.add(val);
Collections.shuffle(random);


r1.setText(random.get(0));
r2.setText(random.get(1));
r3.setText(random.get(2));
r4.setText(random.get(3));
</code></pre>

<p>I am able to display the answers in jumbled way but when i select the answer i need to show that the answer is correct or wrong.</p>

<pre><code>Sample question and options.
1. which language is used for android programming?
 A.PHP
 B.JAVA
 C.C
 D.C++
</code></pre>

<p>Correct answer is B i need to display that correct answer is B.</p>

<p>How to acheive this.</p>

<p><strong>EDIT:</strong>
I have tried this:</p>

<p>Onclick of each radio button assign the value A and compare the value with xml value if its correct display correct but when i jumble its will not work.</p>

<p><strong>EDIT 2</strong>
xml</p>

<pre><code>&lt;Question no="1" text="Which Programming language is used in android develoment" type="SCA" noc="4" jumble="NO" correctans="PHP"&gt;
&lt;choice a = "PHP" flag="A"&gt; 
&lt;choice b = "JAVA" flag="B"&gt; 
&lt;choice c = "C" flag="C"&gt; 
&lt;choice d = "C++" flag="D"&gt; 
</code></pre>
