Пример #1
0
 * @Modified By 
 * @version 1.0 
 * @desc This is main file (addquestion) which is used to add the question for particular quiz
 */
//Includes config file
include "../includes/config.inc.php";
//Includes global class file
include DIR_ADMIN_CLASSES . "/clsGlobal.php";
//Checks if session is set for admin login or not
if ($_SESSION["UsErId"] == "" && $_SESSION["UnAmE"] == "") {
    header("Location:index.php");
}
$hldGlobal = new clsGlobal($hdlDb);
if ($_GET["eid"]) {
    // This will edit the question
    $intCheck = $hldGlobal->fnCheckQuestionQuiz($_GET["mid"], $_POST["question"], $_GET["qqid"], 1, $_GET["qtid"]);
    if (!$intCheck) {
        $hldGlobal->fnInsQuestionQuiz(0, 0, $_POST["question"], $_GET["qqid"], 1);
    } else {
        $strErrormessage = 'ErrorMess~Question already added';
        echo $strErrormessage . "~2~" . $_GET["qqid"];
        exit;
    }
    if ($_SESSION["InTlAsTiD"]) {
        $qqqid = $_SESSION["InTlAsTiD"];
    } else {
        $qqqid = $_GET["qtid"];
    }
    $strTab = $hldGlobal->fnFetchQuestionQuiz($qqqid, $_GET["eid"]);
    $strResposeText = "EditQuestion~" . $strTab . "~2~" . $_GET["qqid"];
    echo $strResposeText;