<?= $this->extend('Mobile/Layouts/App') ?>
<?= $this->section('content') ?>
<confirm></confirm>

<?= $this->endSection() ?>
<?= $this->section('js') ?>
<script type="text/x-template" id="vp_confirm">
  <div class="page-content-wrapper py-3">
    <div class="container">
        <div class="alert custom-alert-2 alert-info alert-dismissible fade show" role="alert"><i class="bi bi-info-circle"></i>Periksa kembali detail ujian!...
            <button class="btn btn-close btn-close-white position-relative p-1 ms-auto" type="button" data-bs-dismiss="alert" aria-label="Close"></button>
        </div>
        <?php if (session()->getFlashdata('errMsg')) : ?>
        <div class="alert custom-alert-2 alert-danger alert-dismissible fade show" role="alert"><i class="bi bi-info-circle"></i>
        <?= session()->getFlashdata('errMsg') ?>
            <button class="btn btn-close btn-close-white position-relative p-1 ms-auto" type="button" data-bs-dismiss="alert" aria-label="Close"></button>
        </div>
        <?php endif; ?>
        <div class="card">
          <div class="card-body text-center">
            <ul class="list-group">
              <li class="list-group-item d-flex align-items-center justify-content-between">Mata Pelajaran<span class="badge bg-primary rounded-pill"><?= $nama_mapel ?></span></li>
              <li class="list-group-item d-flex align-items-center justify-content-between">Guru Pengampu<span class="badge bg-success rounded-pill"><?= $guru_pengampu ?></span></li>
              <li class="list-group-item d-flex align-items-center justify-content-between">Waktu Ujian<span class="badge bg-warning rounded-pill"><?= $timeout ?> Menit</span></li>
              <li class="list-group-item d-flex align-items-center justify-content-between">Jenis Ujian<span class="badge bg-info rounded-pill"><?= $jenis_ujian ?></span></li>
              <li class="list-group-item d-flex align-items-center justify-content-between">Jumlah<span class="badge bg-danger rounded-pill"><?= $total_soal ?> Soal</span></li>
            </ul>
            <form method="POST">
              <?= csrf_field() ?>
              <?php if ($use_token == 1) : ?>
              <div class="form-group mt-3">
                <input class="form-control" name="token_ujian" required autocomplete="off" type="text" placeholder="Masukan Token Ujian">
              </div>
              <?php endif; ?>
              <button class="btn btn-success my-1" title="Mulai Ujian" type="submit">Mulai Ujian</button>
          </form>
          </div>
        </div>
        </div>  
    </div>
</script>
<script>
  let VPconfirm = {
    template: '#vp_confirm',
  }
  VAPP.component('confirm', VPconfirm);
</script>
<?= $this->endSection() ?>