title: Online-Quiz: Dividing the answers and questions in to 3 Categories by choosing different Radio-Buttons
body: <p>I have a problem by updating my Online-Quiz.</p>
  
  <p>I want to Categorize my Questions and Answers by clicking on Radio Buttons.
  This is my HTML-Code:</p>
  
  <pre><code>&lt;fieldset id="my" data-role="controlgroup" data-mini="true"&gt;
      &lt;legend&gt;Choose a Category&lt;/legend&gt;
      &lt;input type="radio" name="radio-mini" id="radio-mini-1" value="choice-1"  /&gt;
      &lt;label for="radio-mini-1"&gt;Amateur&lt;/label&gt;
      &lt;input type="radio" name="radio-mini" id="radio-mini-2" value="choice-2"  /&gt;
      &lt;label for="radio-mini-2"&gt;Middle&lt;/label&gt;
      &lt;input type="radio" name="radio-mini" id="radio-mini-3" value="choice-3"  /&gt;
      &lt;label for="radio-mini-3"&gt;Legend&lt;/label&gt;
  &lt;/fieldset&gt;
  
  &lt;a href="#" id="Next" data-role="button" onclick="nextStart()"&gt;Send&lt;/a&gt;
  </code></pre>
  
  <p>So I have 3 Radio Buttons.  These radio buttons have also their own multidimensional arrays.    After I choose one category, the array-name should be renamed to an generally array name "question", because for this array name I have lots of different function which I don`t want to write for every single array. My Javascript-Code after I have clicked on the Send-Button:</p>
  
  <pre><code>function nextStart()    
  {
  //document.getElementById("quiz").submit();
  
  $.mobile.changePage( "quiz.html", 
  {
      transition: "pop",
      reverse: false,
      changeHash: false
  });
  
  
  $("input[name=radio-mini]:checked").each(function next() 
  {
          if ($(this).val() = "choice-1")
          {
              category = "amateur";   
          }
  
          else if ($(this).val() = "choice-2")
          {   
              schwierigkeit = "middle";
          }
  
          else 
          {
              schwierigkeit = "legend";
          }
  }); 
  }
  </code></pre>
  
  <p>Now I tell my general array "question" from which array it got the informations:</p>
  
  <pre><code>    if(category = "amateur")
      {       
          question = amateur.slice(); 
      }
  
      else if (category = "middle")
      {
          question = middle.slice();
      }
  
      else
      {
          question = legend.slice();
  
      }
  </code></pre>
  
  <p>If I click the category 2 or 3 "legend" and then on the Send Button I get only on the next side, the answers and questions from the first array "amateur". 
  So I think it doesn't save the right array name after the function </p>
  
  <pre><code>nextStart() 
  </code></pre>
  
  <p>But I don`t got the solution to fix it.. Can somebody help me?</p>
  
  <p>It would be nice, thanks beforehand :-)  </p>