<!--**********************************
	Content body start
***********************************-->

<div class="content-body">
	<div class="container-fluid">
		<!-- 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">
						<h4 class="card-title">Exam</h4>
					</div>
					<div class="card-body">
						<div id="smartwizard" class="form-wizard order-create">
							<!-- <ul class="nav nav-wizard">
								<li><a class="nav-link" href="#wizard_Service"> 
									<span></span> 
									<p class="mt-2 mb-0">Step 1</p>
								</a></li>
								<li><a class="nav-link" href="#wizard_Time">
									<span></span>
									<p class="mt-2 mb-0">Step 2</p>
								</a></li>
								<li><a class="nav-link" href="#wizard_Details">
									<span></span>
									<p class="mt-2 mb-0">Step 3 </p>
								</a></li>
								<li><a class="nav-link" href="#wizard_Payment">
									<span></span>
									<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-12 mb-2">
											<h5><?= $row->question ?></h5>
										</div>
										<div class="col-lg-6 mb-2">
											<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="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="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">
												<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>
								</div>	
                                <div class="row">
                                    <div class="col-md-9"></div>
                                    <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>	
								<?php  } } ?>													
							</div>
							<?php } ?>
						</div>
					</div>
				</div>
			</div>			
		</div>
	</div>
</div>
<!--**********************************
	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>

