<?php
include("../../db.php");
header("Access-Control-Allow-Origin: * ");

$status = 0;
$msg = "Unable to execute operation at this time..! Please retry later";

if (isset($_POST['teacher_id']) && isset($_POST['session'])) {


    $class = $_POST['class'];
    $section = $_POST['section'];
    $exam_name = $_POST['exam_name'];
    $file_name = $_POST['file_name'];
    $teacher_id = $_POST['teacher_id'];
    $session = $_POST['session'];

    $aryData = array("class" => $class, "section" => $section, "exam_name" => $exam_name, "file_name" => $file_name, "teacher_id" => $teacher_id, "session" => $session);

    $insert_activity = $db->insertAry("exam_question", $aryData);

    if ($insert_activity > 0) {
        $status = 1;
        $msg = "Record added successfully";
    } else {
        $msg = "Failed to add record..! Please try again later";
    }

}

echo json_encode(array('status' => $status, 'msg' => $msg));