                                                                                                                                         


<?php

$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);


        $id = $request->getAttribute('id');
       
		$set_sections_id=$request->getParsedBody()['set_sections_id'];
		$Q_questions=$request->getParsedBody()['Q_questions'];
		$marks_alloted=$request->getParsedBody()['marks_alloted'];
		$subsets=$request->getParsedBody()['subsets'];
		$marks_for_subsets=$request->getParsedBody()['marks_for_subsets'];
		$ideal_time=$request->getParsedBody()['ideal_time'];
		
				
	$sql= ("UPDATE set_Q_papers SET set_sections_id='$set_sections_id' , Q_questions='$Q_questions', marks_alloted='$marks_alloted', subsets='$subsets', marks_for_subsets='$marks_for_subsets', ideal_time='$ideal_time' WHERE id=$id");	
	
 if($con->query($sql)){
		$data=array(
   
	"set_sections_id"=>$set_sections_id,	
	"Q_questions"=>$Q_questions,
	"marks_alloted"=>$marks_alloted,	
	"subsets"=>$subsets,
	"marks_for_subsets"=>$marks_for_subsets,	
	"ideal_time"=>$ideal_time,
	);
	    $message=$data;
	

	
	$response=array('status' => "true",'Message' => "Data updated successfully",'set_Q_papers' => $message);
echo json_encode($response);
        
}
        else{
          $response=array('status' => "false",'Message' => " update data failed");
         echo json_encode($response);
        }   
		
	

?>
