<!DOCTYPE html>
<html lang="en">
<?php
require_once('../assets/constants/config.php');
require_once('constants/check-login.php');
require_once('constants/assessment-check.php');
?>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>OES - Assessment</title>
<link rel="icon" href="../assets/images/favicon.ico">

<link rel="stylesheet" href="../assets/styles/vendor/smart.wizard/smart_wizard.min.css">
<link rel="stylesheet" href="../assets/styles/vendor/smart.wizard/smart_wizard_theme_arrows.min.css">
<link rel="stylesheet" href="../assets/styles/vendor/smart.wizard/smart_wizard_theme_circles.min.css">
<link rel="stylesheet" href="../assets/styles/vendor/smart.wizard/smart_wizard_theme_dots.min.css">
<link type="text/css" rel="stylesheet" href="../assets/loader/waitMe.css"><link rel="stylesheet" href="../assets/styles/css/themes/lite-purple.min.css">

</head>

<body id="exam___body">
<div class="app-admin-wrap">
<div class="main-header">
<div class="logo">
<img src="../assets/images/logo.png" alt="">
</div>



<div class="green-board"><k class="time-board" id="count_down">00h 00m 00s</k></div>

<div class="header-part-right">

<i class="i-Full-Screen header-icon d-none d-sm-inline-block" data-fullscreen></i>

<div class="dropdown">
<div class="user colalign-self-end">
<?php
if ($myvataor == null) {

print ' <img class="img-crop" src="../assets/images/blank_avatar.png" id="userDropdown" alt="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">';

}else{

print ' <img class="img-crop" src="../assets/uploads/avatar/'.$myvataor.'" id="userDropdown" alt="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">';

}

?>


<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
<div class="dropdown-header">
<i class="i-Lock-User mr-1"></i> <?php echo $myemail; ?>
</div>
<a class="dropdown-item" href="account">Account settings</a>
<a class="dropdown-item" href="../logout">Sign out</a>
</div>
</div>
</div>
</div>

</div>


<div class="main-content-wrap  d-flex flex-column">


<div class="row">
<div class="col-md-12">

<form action="app/submit_assessment_v2.php" class="app_form_exam" method="POST" name="quiz" id="app_frm2" >

<div id="smartwizard" style="background-color:white">
<ul>
<?php require_once('constants/draws/fetch-exam-question.php'); ?>

</ul>

<div>
<?php require_once('constants/draws/fetch-exam-list.php'); ?>

</div>

</div>
</div>
</div><br>


<div class="row">
<div class="col-md-12">
<div class="card mb-4">
<div class="card-body">

<div class="row">
<div class="col-md-12">
<button type="submit" onclick="return confirm('Are you sure you want to submit your assessment ?')"  class="btn btn-primary">Submit Assessment</button>
</div>
</div>
</form>
</div>
</div>
</div>

</div>



<div class="flex-grow-1"></div>

</div>


</div>


<script src="../assets/js/vendor/jquery-3.3.1.min.js"></script>
<script src="../assets/js/vendor/bootstrap.bundle.min.js"></script>
<script src="../assets/js/vendor/perfect-scrollbar.min.js"></script>
<script src="../assets/js/vendor/jquery.smartWizard.min.js"></script>
<script src="../assets/js/smart.wizard.script.js"></script>
<script src="../assets/js/exam.js"></script>
<script src="../assets/loader/waitMe.js"></script><script src="../assets/js/es5/script.min.js"></script>
<script type="text/javascript">
function countdownTimeStart(){
var countDownDate = new Date("<?php echo $newDateString; ?>").getTime();
var x = setInterval(function() {
var now = new Date().getTime();
var distance = countDownDate - now;
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);

if (hours < 10) {
hours = '0'+hours;
}

if (minutes < 10) {
minutes = '0'+minutes;
}

if (seconds < 10) {
seconds = '0'+seconds;
}

document.getElementById("count_down").innerHTML = ""+ hours + "h "
+ minutes + "m " + seconds + "s ";
if (distance < 0) {
clearInterval(x);
document.getElementById("count_down").innerHTML = "00h 00m 00s";

var current_effect = 'bounce';
run_waitMe(current_effect);
function run_waitMe(effect){
$('#exam___body').waitMe({

effect: 'timer',
text: 'Submitting exam',

bg: 'rgba(255,255,255,0.6)',

color: '#639',

maxSize: '',

waitTime: -1,
source: '',

textPos: 'vertical',

fontSize: '',
onClose: function() {}

});
}

$('#app_frm2').submit();

}
}, 1000);
}
countdownTimeStart()
</script>


</body>

</html>
