Helped need with processing a Multiple Choice Quiz script (php mysql)

I am pretty new to using php and mysql and am struggling to understand how to go about processing a multiple choice quiz script to check if the answer given by the user is right or wrong and give the user the final result . I understand how to write and process register pages and login scripts and the like but for some reason I just can’t understand what i need to do for this type of script So far my thinking has been

  1. When the page is submitted have a query that compares the answer selected to the answer in the database. 2) Have php variables for correct and and incorrect both initialised to 0 and which will change depending on the answers given.
  2. Use an if else statement similar to the code below to add up the score : -

4) Have a query that enters the person taking the quiz’s grade in to the database.

I would really appreciate it someone could give me some guidance for the best way to do this. I have included below my code for selecting the questions from the database.

      // Starts the session

      if (!isset($_SESSION['user_level']) or ($_SESSION['user_level'] != 0))
      header("Location: error_page.php");

      require_once ('mysqli_connect.php');

      $email_address = ['email_address'];
      $quizGradeBegan=("INSERT INTO learner_grade_db( email_address, score, )
      VALUES     ('$email_address',0) ");
      $result=@mysqli_query($dbcon, $submittedAnswerQuery);


     <!DOCTYPE html>
         <meta charset="utf-8" />
         <title>Q-Quiz: Learner Homepage</title>
         <link rel="stylesheet" href="sdnt.css" />


    <div class="wrapper">  <!-- Start of wrapper div -->
        <div class="header"> <!-- Start of header div -->
            <h1>e-Quiz: <br> Learner Homepage</h1>

               //Makes a call to includes/leaner_nav.php in order to show The Learner Navigation Bar
               //Makes a call to includes/welcome_name.php in order to show the Learners name.
              /*Makes a call to includes/current_date in order to shows the current date.
      Will appear in the Day Month Year Format.*/


     </div><!-- End of Header div -->

     <div class="article"> <!-- Start of the article div -->

        $query=("SELECT  question_id, question, distractor_1, distractor_2, distractor_3,
        distractor_4 FROM multiplechoice_db ORDER BY RAND() LIMIT 3 " );
        $result = @mysqli_query ($dbcon, $query); // Run the query.
        while($row = mysqli_fetch_array($result, MYSQL_BOTH)):?>
        <form  action="gradepage.php" method="post">
        <?php echo $row['question_id'];?>
        <?php echo $row['question'];?>

           <input type="radio" value="1" id=' distractor<?php echo $row['question_id'];?>'
            name ='<?php echo   $row['question_id'];?>'/><?php echo $row['distractor_1'];?>
            <input type="radio" value="2" id=' distractor  <?php echo $row['question_id'];?>
            name ='<?php echo $row['question_id'];?>'/><?php echo $row['distractor_2'];?>
            <input type="radio" value="3" id=' distractor  <?php echo $row['question_id'];?>'
             name ='<?php echo $row['question_id'];?>'/><?php echo $row['distractor_3'];?>
            <input type="radio" value="4" id=' distractor  <?php echo $row['question_id'];?>'
            name ='<?php $row['question_id'];?>'/><?php echo $row['distractor_4'];?>
            <?php endwhile;?>
             <input id="submit" type="submit" name="submit"
          value="Click To Submit Completed Quiz">
           </div> <!-- End of the article div -->

          <div class="aside"> <!-- Start of the aside div -->
     <ul class="nav2">

      //Makes a call to includes/leanersidebar1.php in order to show The Learner Sidebar

     </div> <!-- End of the aside div -->

    <div class="footer "><!-- Start of the footer div -->

       //Makes a call to includes/footer.php in order to show the Footer

    </div><!-- End of the footer div -->
    </div><!-- End of the wrapper div -->