query("select id,name from subject_master where seo_url='$topic_permalink'"); list($subject_id,$subject_name)=$rs_subject->fetch_row(); if(isset($_POST["btnContinue"])){ $limit=$_POST["cmbLimit"]; //$subject_id=$_POST["txtSubjectId"]; //$duration=$_POST["cmbDuration"]; $duration=$limit; $total_duration_min=($duration); $topics=$_POST["topics"]; $types=$_POST["Types"]; $_SESSION["s_question_paper_id"]=0; $_SESSION["s_start_datetime"]=date("Y-m-d H:i:s"); $_SESSION["s_end_datetime"]=date("Y-m-d H:i:s",(strtotime("+$total_duration_min minutes"))); $criteria=""; if(isset($_SESSION["question_paper"])) { unset($_SESSION["question_paper"]); unset($_SESSION["sn"]); } if(!isset($_SESSION["question_paper"])){ if(is_array($types)){ $types_csv=implode(",",$types); $criteria.=" and mbm.type_id in($types_csv)"; } if(is_array($topics)){ $topics_csv=implode(",",$topics); $criteria.=" and mbm.topics_id in($topics_csv)"; } $order_by=" order by rand(), mbm.type_id limit $limit"; $sql="select mbm.id,mbm.question,mbm.type_id,tm.name,mbm.points,mbm.not_random from mcq_bank_master mbm,topics_master tm where tm.id=mbm.topics_id $criteria $order_by"; echo $sql; $rs=$db->query($sql); $total_mark=0; $total_question=0; while(list($question_id,$question,$type_id,$topic_name,$point,$not_random)=$rs->fetch_row()){ $total_question++; $total_mark+=$point; add_question_into_session($question_id,$question,$type_id,$point,$not_random); } $rs->free(); //print_r($_SESSION["question_paper"]); header("location:question.php"); }//end if }//end isset continure ?> Model TEST ON ,
Select Number of Questions
Select Question Type
Select Topics