Commit 38e9d7d1 by Hussain Mohamed

changes

parent fe1bf9ac
......@@ -36,8 +36,26 @@ class ExamController extends CI_Controller
$this->db->where('es.status', 1);
$this->db->group_by('q.schedule_id');
$query = $this->db->get();
return $result = $query->result();
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);
}
}
......
......@@ -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>
......@@ -74,19 +74,56 @@
</html>
<div class="modal fade" id="examModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-center">
<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="<?= base_url('ExamController/takeExam/').$row->id ?>" class="btn btn-primary">Take Exam</a>
<a href="javascript:startExam('<?= $row->id ?>')" class="btn btn-primary">Take Exam</a>
</div>
</div>
</div>
......@@ -99,4 +136,13 @@ 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
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