//Assigns Metatag $hdlTpl->setVariable("header", $strHeader); //Assigns header $hdlTpl->setVariable("footer", $strFooter); //Assigns footer $hdlTpl->setVariable("menu", $strLmenu); //Assigns left menu if ($_POST["submit_ans"] == "Submit Answer") { if (is_array($_POST["opt"]) && count($_POST["opt"]) > 0) { $strUnique = $hldGlobal->generatePassword(); foreach ($_POST["opt"] as $key1 => $value1) { $sqlIns = "INSERT INTO tblQuizAnswer(id,qid,userid,option_id,module_id,quiz_title_id,course_id,quiz_date,attempted) VALUES('','" . $key1 . "','" . $_SESSION["UID"] . "','" . $value1 . "','" . $_POST["mid"] . "','" . $_POST["quiz_title_id"] . "','" . $_GET["cid"] . "','" . date("Y-m-d") . "','" . $strUnique . "')"; mysql_query($sqlIns); } $_SESSION["StRuNiQuE"] = $strUnique; $hldGlobal->fnStoreCorrectPercent($_GET["cid"], $_GET["qid"], $_POST["mid"], $_SESSION["UID"], $strUnique); $redirect = SITE_NAME . "showresult/" . $_GET["qid"] . "/" . $_POST["mid"] . ".htm"; header("Location:{$redirect}"); } } $hldGlobal->fnTrackUser("Take Quiz", $_SESSION["MaInId"], $_GET["cid"], $_GET["qid"]); $arrCourseName = $hldGlobal->fnFetchCourse($_GET["cid"]); $hdlTpl->setVariable("cname", $arrCourseName[0]["cname"]); //Assigns course name $arrQuizquestion = $hldGlobal->fnGetQuizQuestion($_GET["qid"]); if (is_array($arrQuizquestion) && count($arrQuizquestion) > 0) { $intCnt = 1; foreach ($arrQuizquestion as $key => $value) { $hdlTpl->setVariable("mid", $value["module_id"]); //Assign mid $hdlTpl->setVariable("quiz_title_id", $value["quiz_title_id"]);