Commit 252e5c44 by Manoj

changes

parents b4925e40 38e9d7d1
......@@ -15,6 +15,49 @@ class ExamController extends CI_Controller
$this->load->view('base/base_template', $data);
}
public function viewExam()
{
$view_data['records']=$this->getExamQuestions();
$data = array(
'title' => 'View Exam',
'page' => 'View Exam',
'content' => $this->load->view('exam/view_exam', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
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->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');
$this->db->join('exam_type as et', 'et.id = q.exam_type', 'left');
$this->db->where('es.status', 1);
$this->db->group_by('q.schedule_id');
$query = $this->db->get();
return $result = $query->result();
}
public function takeExam($id)
{
$view_data['questions']=$this->mcommon->records_all('question',array('schedule_id'=>$id));
$authId = 1;
date_default_timezone_set('Asia/Calcutta');
$date = date('Y-m-d h:i:s',strtotime("+40 minutes"));
$time = date('h:i:s',strtotime("+40 minutes"));
$view_data['time'] = $time;
$view_data['date'] = $date;
$data = array(
'title' => 'View Exam',
'page' => 'View Exam',
'content' => $this->load->view('exam/exam', $view_data, true),
);
$this->load->view('base/base_template', $data);
}
}
?>
\ No newline at end of file
......@@ -5,7 +5,18 @@
<div class="content-body">
<div class="container-fluid">
<!-- row -->
<div class="row">
<div class="row">
<div class="col-xl-12">
<div class="page-title">
<h4><span class="pull-right" id="time"><?= $time ?></span></h4>
<div>
</div>
</div>
</div>
<div class="col-xl-12">
<div class="card">
<div class="card-header">
......@@ -95,4 +106,31 @@
<!--**********************************
Content body end
***********************************-->
<script>
function updateTime() {
var date = "<?php echo $date ?>";
var currentTime = new Date(date);
// Subtract 40 minutes from the current time
//currentTime.setMinutes(currentTime.getMinutes() - 40);
currentTime.setSeconds(currentTime.getSeconds() + 1);
// Format the time as HH:mm:ss
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var seconds = currentTime.getSeconds();
hours = (hours < 10) ? "0" + hours : hours;
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
var formattedTime = hours + ":" + minutes + ":" + seconds;
$('#time').text(formattedTime);
}
setInterval(() => {
updateTime();
}, 1000);
</script>
<!DOCTYPE html>
<html lang="en">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
<title>View Exam</title>
</head>
<body>
<?php $segment = $this->uri->segment(2) ?>
<div class="content-body">
<!-- row -->
<div class="container-fluid">
<!-- 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...">
<span class="input-group-text"><a href="javascript:void(0)">
<svg width="15" height="15" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.5605 15.4395L13.7527 11.6317C14.5395 10.446 15 9.02625 15 7.5C15 3.3645 11.6355 0 7.5 0C3.3645 0 0 3.3645 0 7.5C0 11.6355 3.3645 15 7.5 15C9.02625 15 10.446 14.5395 11.6317 13.7527L15.4395 17.5605C16.0245 18.1462 16.9755 18.1462 17.5605 17.5605C18.1462 16.9747 18.1462 16.0252 17.5605 15.4395V15.4395ZM2.25 7.5C2.25 4.605 4.605 2.25 7.5 2.25C10.395 2.25 12.75 4.605 12.75 7.5C12.75 10.395 10.395 12.75 7.5 12.75C4.605 12.75 2.25 10.395 2.25 7.5V7.5Z" fill="#01A3FF" />
</svg>
</a></span>
</div>
<div>
</div>
</div>
</div>
<!--column-->
<div class="col-xl-12 wow fadeInUp" data-wow-delay="1.5s">
<div class="table-responsive full-data">
<table class="table-responsive-lg table display dataTablesCard student-tab dataTable no-footer" id="example-student">
<thead>
<tr>
<th class="wd-20p">S.No</th>
<th class="wd-25p">Academic Year</th>
<th class="wd-15p">Exam Type</th>
<th class="wd-15p">Date</th>
<th class="wd-15p">Time</th>
<th class="wd-15p">Action</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
foreach ($records as $row) { ?>
<tr>
<td><?= $i ?></td>
<td><?= $row->year ?></td>
<td><?= $row->name ?></td>
<td><?= isset($row->date) ? date('d-m-Y',strtotime($row->date)) :'' ?></td>
<td><?= isset($row->time) ? date('H:i a',strtotime($row->time)) :'' ?></td>
<td>
<a href="javascript:takeExam('<?= $row->id ?>')" data-toggle="tooltip" id="edit" data-placement="top" title="Edit" data-original-title="Edit" class="btn btn-sm btn-info">View</a>
</td>
</tr>
<?php $i++; } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<div class="modal fade bd-example-modal-lg show" id="examModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Take Exam</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<h4 class="text-center">Asian College of Journalism</h4>
<h5>English Entrance Examination</h5>
<br>
<h5><b>Total time allowed: </b> 30 minutes</h5>
<h5><b>Total marks: </b> 40 minutes</h5>
<h5>
<b>Please note:</b> There are eight sections of multiple-choice questions. Please read the
instructions in each section before you start answering the questions. There are no
negative marks
</h5>
<h4 class="text-center">SECTION 1</h4>
<h5 class="text-danger">Complete these sentences with the correct definite and indefinite articles in the list.
However, if you think the sentence does not need any of these articles, select ‘No change’ (5
marks)</h5>
<h4 class="text-center">SECTION 2</h4>
<h5 class="text-danger">Choose the sentence with the correct active voice and with the same tense as the original
sentence. (5 marks)</h5>
<h4 class="text-center">SECTION 3</h4>
<h5 class="text-danger">Complete the sentences with the appropriate words (quantifiers) from the list. (5
marks)</h5>
<h4 class="text-center">SECTION 4</h4>
<h5 class="text-danger">Complete the sentences with the appropriate word from the list. (5 marks)</h5>
<h4 class="text-center">SECTION 5</h4>
<h5 class="text-danger">Select the grammatically correct version of the sentences below. (5 marks)</h5>
<h4 class="text-center">SECTION 6</h4>
<h5 class="text-danger">Complete the sentences with the appropriate comparative form from the list. (5 marks)</h5>
<h4 class="text-center">SECTION 7</h4>
<h5 class="text-danger">Choose the appropriate word to complete these proverbs/sayings. (5 marks)</h5>
<h4 class="text-center">SECTION 8</h4>
<h5 class="text-danger">Choose the one word or phrase from the list that would best retain the meaning of the
original sentence. (5 marks)</h5>
</div>
<div class="modal-footer">
<a href="javascript:startExam('<?= $row->id ?>')" class="btn btn-primary">Take Exam</a>
</div>
</div>
</div>
</div>
<script>
function takeExam(id)
{
$('#examModal').modal('show');
}
function startExam(id)
{
if(confirm("are you sure want to start exam?") === true)
{
var url = "<?= base_url('ExamController/takeExam/') ?>"+id;
window.location=url;
}
}
</script>
\ No newline at end of file
......@@ -53,7 +53,7 @@
*
* NOTE: If you change these, also change the error_reporting() code below
*/
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'production');
/*
*---------------------------------------------------------------
......
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