Esempio n. 1
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"]);
        //Assign quiz title id
        $arrOption = $hldGlobal->fnFetchOption($value["id"]);
        $intCnt1 = count($arrOption);
        $strTab = "";
        if ($intCnt1) {
            $strTab .= '<table width="100%"  border="0" cellspacing="2" cellpadding="1">';
            for ($c = 0; $c < $intCnt1;) {
                $temp = $c;
                $strTab .= '<tr>';