<?php

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

$course_id = $request->getAttribute('course_id');
$exams_id=$request->getAttribute('exams_id');
$papers_shortcode=$request->getAttribute('papers_shortcode');

$response=array();

if($re_evaluate==""){
    $re_evaluate="0";
}
if($correction_papers==""){
    $correction_papers="0";
}

//--------------------------------------------------total_re_evaluate_students-------------------------------------------------------------//
  if(isset($course_id)&&isset($exams_id)&&isset($papers_shortcode)){
     $sql="SELECT roll_number  from pwe_answersheet_submit WHERE re_evaluate='1' AND  course_id='$course_id' AND exams_id='$exams_id' 
       AND papers_shortcode='$papers_shortcode' ";
         }

           $result=mysqli_query($con,$sql);
              while ($row1[]=mysqli_fetch_assoc($result)) {  
                $re_evaluate=count($row1);
                     }

//--------------------------------------------------re_evaluate_correction_papers-------------------------------------------------------------//
    
 if(isset($course_id)&&isset($exams_id)&&isset($papers_shortcode)){
   $sql2="SELECT roll_number from  re_evaluate_submit WHERE  course_id='$course_id' AND exams_id='$exams_id' 
    AND papers_shortcode='$papers_shortcode' ";
     }
    
     
    $result2=mysqli_query($con,$sql2);   
        while ($row2[]=mysqli_fetch_assoc($result2)) {    
          $correction_papers=count($row2);   
        }
      

        echo '[{"total_re_evaluate_students":"'.$re_evaluate.'","resolve_status":"'.$correction_papers.'"}]';
?>