/*
	Login handling and permission check
*/
$login = new loginHandler($config);
if (!$login->is_logged_in()) {
    $login->redirect_login('Please login');
}
if ($login->get_user_type() != 'admin') {
    $login->not_authorized_error();
}
if (!isset($_GET['courseid'])) {
    header("Location: " . $config['url']['base_url'] . $config['url']['error'] . '?msg=' . base64_encode('Invalid Course id.'));
}
require_once "ajax_table.class.php";
$obj = new ajax_table(['courseid' => $_GET['courseid']]);
$records = $obj->getRecords();
//echo phpinfo();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title>Ajax Table Inline Edit</title>
  <script>
	 // Column names must be identical to the actual column names in the database, if you dont want to reveal the column names, you can map them with the different names at the server side.
	 var columns = new Array("question","type");
	 var placeholder = new Array("Enter Question","Select Type");
	 var inputType = new Array("text","select");
	 var table = "tableDemo";
	 var selectOpt = new Array("radio","comment");;