<?php
$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
     
	    $course_id=$request->getParsedBody()['course_id'];
		$season_id=$request->getParsedBody()['season_id'];
		$exams_id=$request->getParsedBody()['exams_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'];
			// $exam_start="0";	
$response=array();
/*
$sqll="(SELECT * FROM set_student_season WHERE  rollnumber='$rollnumber' OR status='$status')";
$res= $con->query($sqll);
if($res->num_rows>0)
{
$response1=array('status' => "true",'Message' => "data already exist");
echo json_encode($response1);
}

else{*/
$sql="INSERT INTO evaluate_answer_scripts(course_id,season_id,exams_id,submit_answer_script_id,
evaluation_result,score,state,grade)
 VALUES ('$course_id','$season_id','$question_pattern_id','$submit_answer_script_id','$evaluation_result','$score','$state','$grade')";

$res= $con->query($sql);
	
if($res==true)
{
		$data=array(
	"course_id"=>$course_id,
	"season_id"=>$season_id,
	"exams_id"=>$exams_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 inserted successfully",'evaluate_answer_scripts' => $message);
echo json_encode($response);
        
}
        else{
          $response=array('status' => "false",'Message' => " insert data failed");
         echo json_encode($response);
        }   
		
	



?>