title: PHP quiz with on screen results
body: <p>I am trying to create a simple quiz based on a tutorial I found. <a href="http://css-tricks.com/building-a-simple-quiz/" rel="nofollow">http://css-tricks.com/building-a-simple-quiz/</a></p>
  
  <p>Unfortunately, this is making me spin my wheels and the answer is probably pretty simple.</p>
  
  <p>I got this working perfectly. I would like to change the functionality. Instead of it counting the answers, I want it to do something else.</p>
  
  <ol>
  <li>I would like to display the questions again.</li>
  <li>Also, with the chosen answer and the correct answer. echo the answer, <strong>not</strong> the letter A,B,C,D.</li>
  </ol>
  
  <p>It seems silly to me to have a quiz and say you missed 2 and not show what questions were missed.</p>
  
  <p><strong>I'd prefer to avoid use of a database</strong>. It can be on screen, on a new screen or e-mailed. No preference. Any suggestions?</p>
  
  <p>Here is the code from the above mentioned site:</p>
  
  <pre><code>&lt;form action="grade.php" method="post" id="quiz"&gt;
  &lt;li&gt;
  
  &lt;h3&gt;CSS Stands for...&lt;/h3&gt;
  
  &lt;div&gt;
      &lt;input type="radio" name="question-1-answers" id="question-1-answers-A" value="A" /&gt;
      &lt;label for="question-1-answers-A"&gt;A) Computer Styled Sections &lt;/label&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;input type="radio" name="question-1-answers" id="question-1-answers-B" value="B" /&gt;
      &lt;label for="question-1-answers-B"&gt;B) Cascading Style Sheets&lt;/label&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;input type="radio" name="question-1-answers" id="question-1-answers-C" value="C" /&gt;
      &lt;label for="question-1-answers-C"&gt;C) Crazy Solid Shapes&lt;/label&gt;
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;input type="radio" name="question-1-answers" id="question-1-answers-D" value="D" /&gt;
      &lt;label for="question-1-answers-D"&gt;D) None of the above&lt;/label&gt;
  &lt;/div&gt;
  
  &lt;/li&gt;
  &lt;/form&gt;
  &lt;input type="submit" value="Submit Quiz" /&gt;
  </code></pre>
  
  <p>Then the PHP script:</p>
  
  <pre><code>&lt;?php
  
  $answer1 = $_POST['question-1-answers'];
  $answer2 = $_POST['question-2-answers'];
  $answer3 = $_POST['question-3-answers'];
  $answer4 = $_POST['question-4-answers'];
  $answer5 = $_POST['question-5-answers'];
  
  $totalCorrect = 0;
  
  if ($answer1 == "B") { $totalCorrect++; }
  if ($answer2 == "A") { $totalCorrect++; }
  if ($answer3 == "C") { $totalCorrect++; }
  if ($answer4 == "D") { $totalCorrect++; }
  if ($answer5) { $totalCorrect++; }
  
  echo "&lt;div id='results'&gt;$totalCorrect / 5 correct&lt;/div&gt;";
  
  ?&gt;
  </code></pre>
  
  <p>Any suggestions or links would be much appreciated. My Google skills are failing me. Everything I think to search for brings up irrelevant stuff.</p>