Problem while summing good answes on online quiz system : I'm trying to build an online quiz system for a driving school.
They asked me to make available that questions and answers will be added on database. I did make it but the problem is that I'm having a hard time knowing if the answers are correct.

The code I'm using to generate the form is this:

   

     $sql = mysql_query("SELECT * FROM questions ORDER BY question_id ASC");
    						
    				
    						while($row = mysql_fetch_array($sql)){
    							echo ' 
    					
    							<section>
    							<h1>'.$row['question'].'?</h4>
    								</br> <hr> </br>
    
    								<div class="row">
    								<div class="col-sm-4 foto pb-2">
    <img  src="" style="max-width:100%;height: auto;" >
    </div>
       <div class="col-12 col-sm-8">
       <div class="pergjigjet mb-2 pl-2 pr-2" style="padding-left: .5rem!important;padding-right: .5rem!important;margin-bottom: .5rem!important;">
       <div class="pergjigje">
       <label><input type="checkbox" name="q_'.$row['question_id'].'_a_1" value="1"> '.$row['answer1'].'.</label>
       </div>
       <div class="pergjigje">
       <label><input type="checkbox" name="q_'.$row['question_id'].'_a_2" value="1"> '.$row['answer2'].'.</label>
       </div>
       <div class="pergjigje"><label>
       <input type="checkbox" name="q_'.$row['question_id'].'_a_3" value="1"> '.$row['answere'].'.</label>
       </div>
       </div>
    </div>
    </section>

The quiz has total 30 questions and max 3 correct answers. 
If you don't select all the right answers it needs to be wrong. It means that you don't get points if you haven't selected the right answers for the question.

Array of the post data is this.

        array(4) {
      ["q_1_a_1"]=>
      string(1) "1"
      ["q_1_a_2"]=>
      string(1) "1"
      ["q_2_a_1"]=>
      string(1) "1"
      ["q_2_a_2"]=>
      string(1) "1"
    }

The table is this,

    id, question_id, exam_id, question, answer1, answer2, answer3, CorrectAnswers, QuestionPoints

I store the correct answers in this format

    1,2

P.S the client asked me to use mysql, not mysqli or PDO