Esempio n. 1
0
    $hdlTpl->setVariable("error_message", "Correct option updated successfully");
    //Assigns error message
}
$arrCMName = $hldGlobal->fnGetCMName($_GET["id"]);
//Fetches cource and module name
if (is_array($arrCMName) && count($arrCMName) > 0) {
    $hdlTpl->setVariable("mname", $arrCMName[0]["cname"] . "->" . $arrCMName[0]["cname"]);
    //Assigns module and cource name
    $hdlTpl->setVariable("quizzes_question", $arrCMName[0]["quizzes_question"]);
    //Assigns question
    $hdlTpl->setVariable("qid", $_GET["id"]);
    //Assigns id
    $hdlTpl->setVariable("return", $_GET["return"]);
    //Assigns return
    $arrAnswer = $hldGlobal->fnGetCountAnswer($_GET["id"]);
    $arrAns = $hldGlobal->fnFetchAnswer($_GET["id"]);
    if (is_array($arrAns) && count($arrAns)) {
        $stropt = "";
        $intans = 1;
        foreach ($arrAns as $key1 => $value1) {
            if ($arrCMName[0]["option_id"] == $value1["id"]) {
                $strChecked = "checked='checked'";
            } else {
                $strChecked = "";
            }
            $stropt .= "<input type='radio' name='ans' value='" . $value1["id"] . "' " . $strChecked . ">" . $intans . ")";
            $intans++;
        }
        $hdlTpl->setVariable("correct_option", $stropt);
        //Assigns correct answer
    }