BBnepal-Accounts/application/views/student/my-tests-exams.php

125 lines
4.8 KiB
PHP
Raw Normal View History

2024-07-10 12:43:19 +00:00
<style type="text/css">
.content-last-sec li {
list-style-type: none;
color: #585469;
font-size: 13px;
width: 30%;
}
</style>
<main class="common_margin" id="main">
<div class="main-inner-content main-wrap">
<div class="class-head">
<h3 class="common-heading">Up coming Tests/Exams</h3>
</div>
<div class="content-box-scroll">
<!--------------------exam -notification-box -->
<?php
if (isset($exams_data) && !empty($exams_data)) {
foreach ($exams_data as $key => $value) {
$st_date = new DateTime($value['exam_starttime']);
$ed_date = new DateTime($value['exam_endtime']);
$currentTime = new DateTime($nepali_curr_date);
if ($currentTime >= $st_date && $currentTime <= $ed_date) {
$active = 1;
}elseif($currentTime >= $ed_date){
$active = 2;
}else{
$active = 0;
}
$interval = $ed_date->diff($st_date);
if ($interval->format('%H') == '' || $interval->format('%H') == 0) {
$duration = $interval->format('%I min');
}else{
$duration = $interval->format(' %H hr %I min');
}
?>
<div class="content-exam-box-one">
<div class="content-box-one-inner">
<div class="content-right-side">
<h6><?php echo $value['subject_name'] .' : '. $value['e_name'] ?> </h6>
</div>
<?php if ($active == 2 ) { ?>
<div class="content-left-side">
<div class="blue-tick bg-success"><i class="fas fa-check"></i></div>
</div>
<?php } else{
if ($active == 2 ) { ?>
<div class="content-left-side">
<div class="blue-tick bg-success"><i class="fas fa-check"></i></div>
</div>
<?php } else{?>
<div class="content-left-side">
<div class="blue-tick"></div>
</div>
<?php } } ?>
</div>
<div class="content-last-sec">
<li><?php echo ($NDate == $value['exam_date'] ? 'Today - '. $value['exam_date'] : 'Date - '.$value['exam_date']) ?></li>
<li>Time - <?php echo $st_date->format('H:i A'); ?></li>
<li>Duration - <?php echo $duration ?></li>
<?php
if ($value['attempt'] == 'yes') {?>
<li>
<span class="font-weight-bold text-success "> Completed</span>
</li>
<?php }else{
if ($active == 1){
if ($value['total_marks'] == $value['counting_mark']) {
?>
<li>
<a href="<?= base_url() ?>student/view-test-detail/<?php echo $value['questions_id']; ?>"><input type="button" value="Start-exam" class="exam-last-sec-btn"></a>
</li>
<?php
}else{?>
<li>
<div class="text-danger font-weight-bold float-left">
<p> Invalid Question Paper Contact Admin/Teacher</p>
</div>
</li>
<?php }
}elseif ($active == 2) { ?>
<li>
<span class="font-weight-bold text-danger "> Finish Exam</span>
</li>
<?php } ?>
<?php }?>
</div>
<div class="content-last-sec">
<span style=" color: #585469;font-size: 13px;">Marks : <?php echo $value['counting_mark']; ?></span>
</div>
</div>
<?php } }else{ ?>
<div class="content-exam-box-one">
<h4 class="text-center font-weight-bold text-info">
No Up-coming Exam
</h4>
</div>
<?php } ?>
</div>
</div>
</main>