<?php
$con = mysqli_connect(localhost, Restax_final, Restax_final123, Restax_api_data);     
 $question_id=$request->getParsedBody()['question_id'];
  $course_id=$request->getParsedBody()['course_id'];
   $season_id=$request->getParsedBody()['season_id'];
    $exam_id=$request->getParsedBody()['exam_id'];
   $total_score=$request->getParsedBody()['total_score'];
    $marks=$request->getParsedBody()['marks'];
     $re_check=$request->getParsedBody()['re_check'];
      $roll_number=$request->getParsedBody()['roll_number'];
      $status=$request->getParsedBody()['status'];
      $paper=$request->getParsedBody()['paper'];
$marks_data = json_encode($marks);
$total_score_data = json_encode($total_score);
$question_id_data = json_encode($question_id);
		
$response=array();


// $sql="SELECT * FROM units WHERE set_papers_id='$set_papers_id'";

// $result = $con->query($sql);
 
// if ($result->num_rows > 0) 

// {
//       $sql="Update units 
//   set units='$units_data' where set_papers_id=$set_papers_id";
  
//   $res= $con->query($sql);
    
    	
//     	$response=array('status' => "false",'Message' => "already present inside");

// echo json_encode($response); 
// }
// else
// {

$sql="INSERT INTO question_answer_submit (question_id,course_id,season_id,exam_id,total_score,marks,re_check,roll_number,paper,status) VALUES ('$question_id_data','$course_id','$season_id','$exam_id','$total_score_data','$marks_data','$re_check','$roll_number','$paper','$status')";

$res= $con->query($sql);

	$data=array('name' =>$grade, );
	$response=array('status' => "true",'Message' => "Data inserted successfully",$data);

echo json_encode($response);
// }

  
    



?>