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

$id=$request->getAttribute('id');
$roll_number=$request->getParsedBody()['roll_number'];
$status=$request->getParsedBody()['status'];
$state=$request->getParsedBody()['state'];
$score=$request->getParsedBody()['score'];


$response=array();

$sql="UPDATE pwe_answersheet_submit SET roll_number='$roll_number', status='$status',  state='$state', score='$score' WHERE id='$id'";

if($con->query($sql)){
    $data=array(
        "roll_number"=>$roll_number,
        "status"=>$status,
        "state"=>$state,
        "score"=>$score
    );
    $messages=$data;

    $response=array('status'=>"true", 'message'=>"data updated successfully", 'Exam_list'=>$messages);
    echo json_encode($response);
}
else{
    $response2=array('status'=>"false", 'message'=>"data updated failed");
    echo json_encode($response2);
}



?>