                                                                                                                                         
<?php

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



        $id = $request->getAttribute('id');
		$submit_answer_script_id=$request->getParsedBody()['submit_answer_script_id'];
		$evaluation_result=$request->getParsedBody()['evaluation_result'];
		$score=$request->getParsedBody()['score'];
		$state=$request->getParsedBody()['state'];
	  $grade=$request->getParsedBody()['grade'];
		
				
	$sql= ("UPDATE evaluate_answer_scripts SET  submit_answer_script_id='$submit_answer_script_id', evaluation_result='$evaluation_result', score='$score', state='$state' , grade='$grade' WHERE id=$id");	
	
 if($con->query($sql)){
		$data=array(
    "id" => $id,
	"submit_answer_script_id"=>$submit_answer_script_id,
	"evaluation_result"=>$evaluation_result,
	"score"=>$score,
	"state"=>$state,
	"grade"=>$grade,
	);
	    $message=$data;
	

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