<?php

/* Attempt to connect to MySQL database */
/* Attempt to connect to MySQL database */
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'restax');

define('DB_PASSWORD', 'restax@123');

define('DB_NAME', 'Restax'); 

$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'];
  $proctor_id = $request->getParsedBody()['proctor_id'];
  $file=$request->getParsedBody()['file'];
  $paper = $request->getParsedBody()['paper'];
  $slot=$request->getParsedBody()['slot'];
  $datetime=$request->getParsedBody()['date_time'];
  $roll_number = $request->getParsedBody()['roll_number'];
  $status = $request->getParsedBody()['status'];
 $response=array();
 $data=array();



 $sql="INSERT INTO submit_answer_script (course_id,season_id,exams_id,paper,slot,roll_number,status,date_time,file,proctor_id) VALUES ('$course_id','$season_id','$exams_id','$paper','$slot','$roll_number','$status','$datetime','$file','$proctor_id')";
$res=mysqli_query($con,$sql);
if ($res=true) {
     $data=
        array(
          "Exam_id"=>$exams_id,
         );
    
    $message=$data;

$response=array('status' => "true",'Message' => "Answer Key Submitted Succesfully",'Exam' => $message);
echo json_encode($response);
        }
        else{
          $response=array('status' => "false",'Message' => "Answer Key Submitted Failed");
         echo json_encode($response);
        }
?>