Commit d919f886 by Hussain Mohamed

changes

parent 38e9d7d1
......@@ -2363,6 +2363,19 @@ class ApplicationController extends CI_Controller
$option_d = $this->input->post('option_d');
$answer = $this->input->post('answer');
$record = $this->mcommon->specific_row('exam_type', array('id' => $exam_type));
$totalQuestions = isset($record['total_questions']) ? $record['total_questions'] : 0;
$count = $this->mcommon->getQuestionCount($exam_type,$category);
if($totalQuestions == $count)
{
$this->session->set_flashdata('alert_danger', 'Question Limit Exceeded !');
redirect('ApplicationController/viewQuestion');
//return exit();
}
$insert_array = array(
'academic' => $academic,
'exam_type' => $exam_type,
......
......@@ -28,7 +28,7 @@ class ExamController extends CI_Controller
public function getExamQuestions()
{
$this->db->select('y.year, es.academic, es.exam_schedule, es.date, es.time, es.id,et.exam_type_name as name');
$this->db->select('y.year, es.academic, es.exam_schedule, es.objective_date, es.objective_time, es.id,et.exam_type_name as name');
$this->db->from('question as q');
$this->db->join('exam_schedule as es', 'es.id = q.schedule_id', 'left');
$this->db->join('accadamic_year as y', 'y.id = q.academic', 'left');
......@@ -41,7 +41,7 @@ class ExamController extends CI_Controller
public function takeExam($id)
{
$view_data['questions']=$this->mcommon->records_all('question',array('schedule_id'=>$id));
$view_data['questions']=$this->mcommon->getExamQuestions();
$authId = 1;
date_default_timezone_set('Asia/Calcutta');
$date = date('Y-m-d h:i:s',strtotime("+40 minutes"));
......
......@@ -424,6 +424,30 @@ class Common_model extends CI_Model
return $result;
}
public function getExamQuestions()
{
$this->db->select('c.category, c.id as categoryId, q.id, q.question, q.option_a, q.option_b, q.option_c, q.option_d, q.answer');
$this->db->from('question as q');
$this->db->join('section_category as c', 'c.id = q.category', 'left');
$query = $this->db->get()->result();
$groupByArr = [];
foreach($query as $key=>$val)
{
$groupByArr[$val->category][] = $val;
}
return $groupByArr;
}
public function getQuestionCount($type,$category)
{
$this->db->select('COUNT(question) as cont');
$this->db->from('question');
$this->db->where('exam_type', $type);
$this->db->where('category', $category);
$result = $this->db->get()->row_array();
return (isset($result['cont']) && $result['cont'] > 0) ? $result['cont']:0;
}
......
4545454545454
<?php if ($this->session->flashdata('alert_success')) {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>Success!</strong> <?php echo $this->session->flashdata('alert_success'); ?>
</div>
<?php
}
if ($this->session->flashdata('alert_danger')) {
?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>Success!</strong> <?php echo $this->session->flashdata('alert_danger'); ?>
</div>
<?php
}
if ($this->session->flashdata('alert_warning')) {
?>
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>Success!</strong> <?php echo $this->session->flashdata('alert_warning'); ?>
</div>
<?php } ?>
\ No newline at end of file
......@@ -84,6 +84,12 @@
</a>
</li>
<li><a href="<?php echo base_url(); ?>ExamController/viewExam/" aria-expanded="false">
<i class="material-symbols-outlined">filter</i>
<span class="nav-text">Exam</span>
</a>
</li>
<!-- <li><a href="<?php echo base_url(); ?>ApplicationController/scoreList/" aria-expanded="false">
<i class="material-symbols-outlined"></i>
<span class="nav-text">Score</span>
......
......@@ -42,49 +42,45 @@
<p class="mt-2 mb-0">Step 4</p>
</a></li>
</ul> -->
<?php
if(isset($questions)){ $tot = 0; ?>
<div class="tab-content">
<?php foreach($questions as $key=>$val){ ?>
<div id="wizard_Service" class="tab-pane" role="tabpanel">
<h5 class="text-center"><?= $key ?></h5>
<?php foreach($val as $row){
$tot++;
?>
<div class="row">
<div class="col-lg-6 mb-2">
<div class="mb-3">
<label class="text-label form-label">First Name<span class="required">*</span></label>
<input type="text" name="firstName" class="form-control" placeholder="Parsley" required>
</div>
<div class="col-lg-12 mb-2">
<h5><?= $row->question ?></h5>
</div>
<div class="col-lg-6 mb-2">
<div class="mb-3">
<label class="text-label form-label">Last Name<span class="required">*</span></label>
<input type="text" name="lastName" class="form-control" placeholder="Montana" required>
<div class="form-check custom-checkbox mb-3 checkbox-success">
<input type="radio" class="form-check-input" id="customRadioBox4" name="questions[<?= $row->id ?>]">
<label class="form-check-label" for="customRadioBox4"><?= $row->option_a ?></label>
</div>
</div>
<div class="col-lg-6 mb-2">
<div class="mb-3">
<label class="text-label form-label">Email Address<span class="required">*</span></label>
<input type="email" class="form-control" id="inputGroupPrepend2" aria-describedby="inputGroupPrepend2" placeholder="example@example.com.com" required>
<div class="form-check custom-checkbox mb-3 checkbox-success">
<input type="radio" class="form-check-input" id="customRadioBox4" name="questions[<?= $row->id ?>]">
<label class="form-check-label" for="customRadioBox4"><?= $row->option_b ?></label>
</div>
</div>
<div class="col-lg-6 mb-2">
<div class="mb-3">
<label class="text-label form-label">Phone Number<span class="required">*</span></label>
<input type="number" name="phoneNumber" class="form-control" placeholder="(+1)408-657-9007" required>
<div class="form-check custom-checkbox mb-3 checkbox-success">
<input type="radio" class="form-check-input" id="customRadioBox4" name="questions[<?= $row->id ?>]">
<label class="form-check-label" for="customRadioBox4"><?= $row->option_c ?></label>
</div>
</div>
<div class="col-lg-6 mb-2">
<div class="mb-3">
<label class="text-label form-label">Passward<span class="required">*</span></label>
<input type="passward" class="form-control" id="inputGroupPrepend45" aria-describedby="inputGroupPrepend45" placeholder="Enter your Passward" required>
<div class="form-check custom-checkbox mb-3 checkbox-success">
<input type="radio" class="form-check-input" id="customRadioBox4" name="questions[<?= $row->id ?>]">
<label class="form-check-label" for="customRadioBox4"><?= $row->option_d ?></label>
</div>
</div>
</div>
<div class="col-lg-6 mb-2">
<label class="text-label form-label">Select Options<span class="required">*</span></label>
<select class=" default-select form-control wide" aria-label="Default select example">
<option selected>Company Name </option>
<option value="1">Account Number</option>
<option value="2">State</option>
<option value="3">City</option>
</select>
</div>
</div>
</div>
<div class="row">
......@@ -92,10 +88,11 @@
<div class="col-md-3">
<a href="javascript:void()" class="btn btn-primary pull-right">Previous</a>
<a href="javascript:void()" class="btn btn-primary pull-right">Next</a>
</div>
</div>
</div>
</div>
<?php } } ?>
</div>
<?php } ?>
</div>
</div>
</div>
......
......@@ -78,7 +78,7 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Take Exam</h5>
<h5 class="modal-title" id="exampleModalLabel">Start Exam</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
......@@ -123,7 +123,7 @@ original sentence. (5 marks)</h5>
</div>
<div class="modal-footer">
<a href="javascript:startExam('<?= $row->id ?>')" class="btn btn-primary">Take Exam</a>
<a href="javascript:startExam('<?= $row->id ?>')" class="btn btn-primary">Start Exam</a>
</div>
</div>
</div>
......
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from akademi.dexignlab.com/codeigniter/demo/student by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Mar 2024 10:51:33 GMT -->
<!-- Added by HTTrack -->
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>
<!-- Title -->
<title>List</title>
<!-- Meta -->
</head>
<body>
<?php $segment = $this->uri->segment(2) ?>
<div class="content-body">
<!-- row -->
<div class="container-fluid">
<?php if ($this->session->flashdata('alert_success')) {
?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>Success!</strong> <?php echo $this->session->flashdata('alert_success'); ?>
</div>
<?php
}
if ($this->session->flashdata('alert_danger')) {
?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>Error!</strong> <?php echo $this->session->flashdata('alert_danger'); ?>
</div>
<?php
}
if ($this->session->flashdata('alert_warning')) {
?>
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>Warning!</strong> <?php echo $this->session->flashdata('alert_warning'); ?>
</div>
<?php } ?>
<!-- Row -->
<div class="row">
<div class="col-xl-12">
<div class="row">
<div class="col-xl-12">
<div class="page-title flex-wrap">
<div class="input-group search-area mb-md-0 mb-3">
<input type="text" class="form-control" placeholder="Search here...">
......@@ -101,9 +111,6 @@
</div>
</body>
</html>
<script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment