<?php
include ("mysql_connect.php");

if(isset($_POST["submit"])){

$correct_answers = 0;
$wrong_answers = 0;

//variables to count total answered and unanswered questions
$total_answered = $unanswered = 0; 

$total = $_POST['total'] ;

$questions = $_POST['question_id']; //---an array with all question id's---

foreach($questions as $question_id){

$sql = mysqli_query($connection, "SELECT * FROM `answers` WHERE answers.question_id = '".$question_id ."' AND answers.correct = 1 ")or die(mysqli_error($connection));
$result = mysqli_fetch_assoc($sql);

//------check only those option values which are exist---------
if(isset($_POST['answers'.$question_id])){
$selected_choice = $_POST['answers'.$question_id];

   //----------checking answer choices----------
   if($selected_choice == $result['answer_id']){
        $correct_answers ++ ;
    }else{
        $wrong_answers ++;
    }

//----count the number of answered questions(correct+wrong)--------
$total_answered++;
}
}

//------calculation for score percentage-----
$score = $correct_answers / $total;
$score = number_format($score * 100);

echo "your score is $score<br />";

//------count correct answers------------
if ($correct_answers > 0){
echo "<h2><span>You have $correct_answers correct answers</span></h2>";
}

//----------count wrong answers---------
if ($wrong_answers > 0) {
echo "<h2><span>You have $wrong_answers wrong answers</span></h2>" ;
}

//----------calculation for count of unanswered questions----------
$unanswered = $total - $total_answered;
if ($unanswered > 0) {
echo "<h2><span>You did not answer $unanswered questions</span></h2>" ;
}

}
?>

Hello Nasyia

I have attached the modified version of process.php to count the number of unanswered questions. You can check the code in the attached file. If you found any problem you can tell me.

