<?php
if (!isset($_GET['id']) && !isset($_GET['no']) && !isset($_GET['jenis'])) :
	die("Anda tidak dizinkan mengakses langsung script ini!");
endif;
$nomor = $_GET['no'];
$jenis = $_GET['jenis'];
$id_bank = $_GET['id'];

$nom = mysqli_fetch_array(mysqli_query($koneksi, "SELECT max(nomor) AS nomer FROM soal WHERE id_bank='$id_bank'"));
if($nom['nomer']==''){
$nomor = 1;
}else{
$nomor =$nom['nomer'] + 1;
}
$mapel = mysqli_fetch_array(mysqli_query($koneksi, "SELECT * FROM banksoal WHERE id_bank='$id_bank'"));
$idmap=$mapel['kode'];

$jumsoal = mysqli_num_rows(mysqli_query($koneksi, "SELECT * FROM soal WHERE id_bank='$id_bank' AND  nomor='$nomor' AND jenis='$jenis'"));
$soalQ = mysqli_query($koneksi, "SELECT * FROM soal WHERE id_bank='$id_bank' AND  nomor='$nomor' AND jenis='$jenis'");
$soal = mysqli_fetch_array($soalQ);
($soal['jawaban'] == 'A') ? $jwbA = 'checked' : $jwbA = '';
($soal['jawaban'] == 'B') ? $jwbB = 'checked' : $jwbB = '';
($soal['jawaban'] == 'C') ? $jwbC = 'checked' : $jwbC = '';
($soal['jawaban'] == 'D') ? $jwbD = 'checked' : $jwbD = '';
if ($soal['opsi'] == 5) {
	($soal['jawaban'] == 'E') ? $jwbE = 'checked' : $jwbE = '';
}
?>
 <div class="row">
     <div class="col-md-12">
		<div class="card">
             <div class="card-header">									
					<h5 class='box-title'> 
					MENJODOHKAN</h5>
				</div>
				<div class="row">
			  <div class="card-body">
		<form id='formsoal' action='' method='post' enctype='multipart/form-data'>
			<div class="card">
             <div class="card-header">	

					<div class='btn-group' style='margin-top:-5px'>
						<a class='btn btn-sm btn-outline-primary'>Mapel </a>
						<a class='btn btn-sm btn-outline-primary'><?= $mapel['nama'] ?> </a>
						<a class='btn btn-sm btn-outline-danger'>No Soal :<b class="sandik"> <?= $nomor ?></b></a>
					
					</div>
					 <?php if($menu['opsi']==1): ?>
					   <div class='btn-group' style='margin-top:-5px'>
							<select id='opsi' name="opsi" class='btn btn-sm btn-outline-secondary' >
                            <option value=''>Tambah Opsi</option>
                            
							   <option value='2'>2 Opsi</option>
                                    <option value='3'>3 Opsi</option>                             
                            <option value='4'>4 Opsi</option>
							  <option value='5'>5 Opsi</option>
                        </select>    
						</div>
						<?php endif; ?>
						<button type='submit' name='simpansoal' onclick="tinyMCE.triggerSave(true,true);" class='btn btn-sm btn-outline-primary right' style='margin-top:-5px'> Simpan</button>
						<a href='?pg=banksoal&ac=lihat&id=<?= $id_bank ?>' class='btn btn-sm btn-outline-danger right' style='margin-top:-5px'> Kembali</a>

					</div>
				</div>
				<div class='box-body'>
					<input type='hidden' name='mapel' value='<?= $id_bank ?>'>
					<input type='hidden' name='jenis' value='<?= $jenis ?>'>
					<input type='hidden' name='nomor' value='<?= $nomor ?>'>
					<div class='row'>
						<div class='col-md-5'>
						<div class='box-body'>
									<form>
										<textarea id='editor2' name='isi_soal' class='editor1' rows='10' cols='80' style='width:100%;'><?= $soal['soal'] ?></textarea>
									</form>
								</div>
							<div class="row">
							<div class='col-md-6'>
								<div class='form-group'>
									<?php
									if ($soal['file'] <> '') {
										$audio = array('mp3', 'wav', 'ogg', 'MP3', 'WAV', 'OGG');
										$image = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'JPG', 'JPEG', 'PNG', 'GIF', 'BMP');
										$ext = explode(".", $soal['file']);
										$ext = end($ext);
										if (in_array($ext, $image)) {
											echo "
										<label>Gambar</label><br />
										<img src='$homeurl/files/$soal[file]' style='max-width:100px;' />
										";
										} elseif (in_array($ext, $audio)) {
											echo "
										<label>Audio</label><br />
										<audio controls>
											<source src='$homeurl/files/$soal[file]' type='audio/$ext'>Your browser does not support the audio tag.</audio>
										";
										} else {
											echo "File tidak didukung!";
										}
										echo "<br /><a href='#'  data-id='$soal[id_soal]'  class='hapus  text-red'><i class='fa fa-times'></i> Hapus</a>";
									} else {
										echo "
										<label>Gambar / Audio</label>
										<input type='file' class='form-control' name='file' type='file'>
										";
									}
									?>
								</div>
							</div>
							<div class='col-md-6'>
								<div class='form-group'>
									<?php
									if ($soal['file1'] <> '') {
										$audio = array('mp3', 'wav', 'ogg', 'MP3', 'WAV', 'OGG');
										$image = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'JPG', 'JPEG', 'PNG', 'GIF', 'BMP');
										$ext = explode(".", $soal['file1']);
										$ext = end($ext);
										if (in_array($ext, $image)) {
											echo "
										<label>Gambar</label><br />
										<img src='$homeurl/files/$soal[file1]' style='max-width:100px;' />
										";
										} elseif (in_array($ext, $audio)) {
											echo "
										<label>Audio</label><br />
										<audio controls>
											<source src='$homeurl/files/$soal[file1]' type='audio/$ext'>Your browser does not support the audio tag.</audio>
										";
										} else {
											echo "File tidak didukung!";
										}
											echo "<br /><a href='#'  data-id='$soal[id_soal]'  class='hapusQ  text-red'><i class='fa fa-times'></i> Hapus</a>";
									} else {
										echo "
										<label>Gambar / Audio</label>
										<input type='file' class='form-control' name='file1' type='file'>
										";
									}
									?>
								</div>
							</div>
							</div>
						</div>
					 <?php if($menu['opsi']==0): ?>
                            <div class="col-md-7">
                                <div class="card widget widget-stats">
                                    <div class="card-body">
									<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-A" role="button" aria-expanded="false" aria-controls="collapseExample-A">
                                            PERNYATAAN 1
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-A">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perA' class='editor1 pilihan form-control'><?= $soal['perA'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-A" role="button" aria-expanded="false" aria-controls="collapseExample-A">
                                            A. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-A">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilA' class='editor1 pilihan form-control'><?= $soal['pilA'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>
                                </div><p>
							<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-B" role="button" aria-expanded="false" aria-controls="collapseExample-B">
                                            PERNYATAAN 2
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-B">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perB' class='editor1 pilihan form-control'><?= $soal['perB'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-B" role="button" aria-expanded="false" aria-controls="collapseExample-B">
                                            B. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-B">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilB' class='editor1 pilihan form-control'><?= $soal['pilB'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div>
								<p>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-C" role="button" aria-expanded="false" aria-controls="collapseExample-C">
                                            PERNYATAAN 3
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-C">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perC' class='editor1 pilihan form-control'><?= $soal['perC'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-C" role="button" aria-expanded="false" aria-controls="collapseExample-C">
                                            C. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-C">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilC' class='editor1 pilihan form-control'><?= $soal['pilC'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div>
								<p>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-D" role="button" aria-expanded="false" aria-controls="collapseExample-D">
                                            PERNYATAAN 4
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-D">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perD' class='editor1 pilihan form-control'><?= $soal['perD'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-D" role="button" aria-expanded="false" aria-controls="collapseExample-D">
                                          D. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-D">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilD' class='editor1 pilihan form-control'><?= $soal['pilD'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div>
								<p>
								<?php if($setting['jenjang']=='SMA' OR $setting['jenjang']=='SMK' OR $setting['jenjang']=='PAKET-C'){ ?>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-E" role="button" aria-expanded="false" aria-controls="collapseExample-E">
                                            PERNYATAAN 5
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-E">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perE' class='editor1 pilihan form-control'><?= $soal['perE'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-E" role="button" aria-expanded="false" aria-controls="collapseExample-E">
                                            E. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-E">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilE' class='editor1 pilihan form-control'><?= $soal['pilE'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div><p>
								<?php } ?>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
								 <label style='color:red'>KUNCI PERNYATAAN 1</label>
                                         <select name='jwbA' class='form-select' >
										<option value=''> Pilih Kunci </option>	   
										<option value='A'> A </option>
										<option value='B'> B </option>
										<option value='C'> C </option>										
										<option value='D'> D </option>	
										<?php if($setting['jenjang']=='SMA' OR $setting['jenjang']=='SMK' OR $setting['jenjang']=='PAKET-C'){ ?>
										<option value='E'> E </option>
									    <?php } ?>
										</select>
                                                </div>
												 </div>
										<div class='col-md-6'>
								<div class="example-content bg-white">		 
										<label style='color:red'>KUNCI PERNYATAAN 2</label>
                                         <select name='jwbB' class='form-select' >
										<option value=''> Pilih Kunci </option>
										<option value=''> Pilih Kunci </option>	   
										<option value='A'> A </option>
										<option value='B'> B </option>
										<option value='C'> C </option>										
										<option value='D'> D </option>	
										<?php if($setting['jenjang']=='SMA' OR $setting['jenjang']=='SMK' OR $setting['jenjang']=='PAKET-C'){ ?>
										<option value='E'> E </option>
									    <?php } ?>
										</select>
                                                </div>
												 </div>		 
												 </div><p>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
								 <label style='color:red'>KUNCI PERNYATAAN 3</label>
                                    <select name='jwbC' class='form-select' >
										<option value=''> Pilih Kunci </option>
										<option value=''> Pilih Kunci </option>	   
										<option value='A'> A </option>
										<option value='B'> B </option>
										<option value='C'> C </option>										
										<option value='D'> D </option>	
										<?php if($setting['jenjang']=='SMA' OR $setting['jenjang']=='SMK' OR $setting['jenjang']=='PAKET-C'){ ?>
										<option value='E'> E </option>
									    <?php } ?>
										</select>
                                                </div>
												 </div>
										<div class='col-md-6'>
								<div class="example-content bg-white">		 
										<label style='color:red'>KUNCI PERNYATAAN 4</label>
                                        <select name='jwbD' class='form-select' >
										<option value=''> Pilih Kunci </option>	   
										<option value='A'> A </option>
										<option value='B'> B </option>
										<option value='C'> C </option>										
										<option value='D'> D </option>	
										<?php if($setting['jenjang']=='SMA' OR $setting['jenjang']=='SMK' OR $setting['jenjang']=='PAKET-C'){ ?>
										<option value='E'> E </option>
									    <?php } ?>
										</select>
                                                </div>
												 </div>		 
												 </div>	<p>	
                                  <?php if($setting['jenjang']=='SMA' OR $setting['jenjang']=='SMK' OR $setting['jenjang']=='PAKET-C'){ ?>												 
									<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
								 <label style='color:red'>KUNCI PERNYATAAN 5</label>	
                                   <select name='jwbE' class='form-select' >
										<option value=''> Pilih Kunci </option>
										<option value='A'> A </option>
										<option value='B'> B </option>
										<option value='C'> C </option>										
										<option value='D'> D </option>										
										<option value='E'> E </option>
										</select>
								 </div>
									</div>		 
										</div>
										 <?php } ?>
								<?php elseif($menu['opsi']==1): ?>
                            <div class="col-md-7">
                                <div class="card widget widget-stats">
                                    <div class="card-body">
									<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='perA' style='display: none;'>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-A" role="button" aria-expanded="false" aria-controls="collapseExample-A">
                                            PERNYATAAN 1
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-A">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perA' class='editor1 pilihan form-control'><?= $soal['perA'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='pilA' style='display: none;'>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-A" role="button" aria-expanded="false" aria-controls="collapseExample-A">
                                            A. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-A">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilA' class='editor1 pilihan form-control'><?= $soal['pilA'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>
                                </div><p>
							<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='perB' style='display: none;'>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-B" role="button" aria-expanded="false" aria-controls="collapseExample-B">
                                            PERNYATAAN 2
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-B">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perB' class='editor1 pilihan form-control'><?= $soal['perB'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='pilB' style='display: none;'>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-B" role="button" aria-expanded="false" aria-controls="collapseExample-B">
                                            B. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-B">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilB' class='editor1 pilihan form-control'><?= $soal['pilB'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div>
								<p>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='perC' style='display: none;'>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-C" role="button" aria-expanded="false" aria-controls="collapseExample-C">
                                            PERNYATAAN 3
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-C">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perC' class='editor1 pilihan form-control'><?= $soal['perC'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='pilC' style='display: none;'>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-C" role="button" aria-expanded="false" aria-controls="collapseExample-C">
                                            C. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-C">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilC' class='editor1 pilihan form-control'><?= $soal['pilC'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div>
								<p>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='perD' style='display: none;'>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-D" role="button" aria-expanded="false" aria-controls="collapseExample-D">
                                            PERNYATAAN 4
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-D">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perD' class='editor1 pilihan form-control'><?= $soal['perD'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='pilD' style='display: none;'>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-D" role="button" aria-expanded="false" aria-controls="collapseExample-D">
                                          D. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-D">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilD' class='editor1 pilihan form-control'><?= $soal['pilD'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div>
								<p>
								
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='perE' style='display: none;'>
                                      <a class="btn btn-outline-primary" data-bs-toggle="collapse" href="#collapseExample-E" role="button" aria-expanded="false" aria-controls="collapseExample-E">
                                            PERNYATAAN 5
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-E">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='perE' class='editor1 pilihan form-control'><?= $soal['perE'] ?></textarea>
												</div>
												
											</div>
										</div>   
                                    </div>
									<div class='col-md-6'>
								<div class="example-content bg-white">
                                    <p id='pilE' style='display: none;'>
                                      <a class="btn btn-outline-warning" data-bs-toggle="collapse" href="#collapseExample-E" role="button" aria-expanded="false" aria-controls="collapseExample-E">
                                            E. OPSI PILIHAN JAWABAN
                                           </a>										
											</p>
										</div>
										<div class="collapse" id="collapseExample-E">
											<div class='box-body'>
												<div class='form-group' >
													<textarea name='pilE' class='editor1 pilihan form-control'><?= $soal['pilE'] ?></textarea>
												</div>
											</div>
										</div>   
                                    </div>						
                                </div><p>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white" id='labA' style='display: none;'>
								 <label style='color:red'>KUNCI PERNYATAAN 1</label>
                                         <select name='jwbA' class='form-select' >
										<option value=''> Pilih Kunci </option>	   
										<option value='A' id='kunci1A' style='display: none;'> A </option>
										<option value='B' id='kunci1B' style='display: none;'> B </option>
										<option value='C' id='kunci1C' style='display: none;'> C </option>										
										<option value='D' id='kunci1D' style='display: none;'> D </option>										
										<option value='E' id='kunci1E' style='display: none;'> E </option>
									
										</select>
                                                </div>
												 </div>
										<div class='col-md-6'>
								<div class="example-content bg-white" id='labB' style='display: none;'>		 
										<label style='color:red'>KUNCI PERNYATAAN 2</label>
                                         <select name='jwbB' class='form-select' >
										<option value=''> Pilih Kunci </option>
										<option value='A' id='kunci2A' style='display: none;'> A </option>
										<option value='B' id='kunci2B' style='display: none;'> B </option>
										<option value='C' id='kunci2C' style='display: none;'> C </option>										
										<option value='D' id='kunci2D' style='display: none;'> D </option>										
										<option value='E' id='kunci2E' style='display: none;'> E </option>
										</select>
                                                </div>
												 </div>		 
												 </div><p>
								<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white" id='labC' style='display: none;'>
								 <label style='color:red'>KUNCI PERNYATAAN 3</label>
                                    <select name='jwbC' class='form-select' >
										<option value=''> Pilih Kunci </option>
										<option value='A' id='kunci3A' style='display: none;'> A </option>
										<option value='B' id='kunci3B' style='display: none;'> B </option>
										<option value='C' id='kunci3C' style='display: none;'> C </option>										
										<option value='D' id='kunci3D' style='display: none;'> D </option>										
										<option value='E' id='kunci3E' style='display: none;'> E </option>
										</select>
                                                </div>
												 </div>
										<div class='col-md-6'>
								<div class="example-content bg-white" id='labD' style='display: none;'>		 
										<label style='color:red'>KUNCI PERNYATAAN 4</label>
                                        <select name='jwbD' class='form-select' >
										<option value=''> Pilih Kunci </option>
										<option value='A' id='kunci4A' style='display: none;'> A </option>
										<option value='B' id='kunci4B' style='display: none;'> B </option>
										<option value='C' id='kunci4C' style='display: none;'> C </option>										
										<option value='D' id='kunci4D' style='display: none;'> D </option>										
										<option value='E' id='kunci4E' style='display: none;'> E </option>
										</select>
                                                </div>
												 </div>		 
												 </div>	<p>			 
									<div class="row">
                                     <div class='col-md-6'>
								<div class="example-content bg-white" id='labE' style='display: none;'>
								 <label style='color:red'>KUNCI PERNYATAAN 5</label>	
                                   <select name='jwbE' class='form-select' >
										<option value=''> Pilih Kunci </option>
										<option value='A'> A </option>
										<option value='B'> B </option>
										<option value='C'> C </option>										
										<option value='D'> D </option>										
										<option value='E'> E </option>
										</select>
								 </div>
									</div>		 
										</div>
							<?php endif; ?>	
                            </div>
					</div>
				</div>
			</div>
			
		</form>
	</div>
</div>

<script>
	tinymce.init({
		selector: '.editor1',
		
		plugins: [
			'advlist autolink lists link image charmap print preview hr anchor pagebreak',
			'searchreplace wordcount visualblocks visualchars code fullscreen',
			'insertdatetime media nonbreaking save table contextmenu directionality',
			'emoticons template paste textcolor colorpicker textpattern imagetools uploadimage paste formula'
		],

		toolbar: 'bold italic fontselect fontsizeselect | alignleft aligncenter alignright bullist numlist  backcolor forecolor | formula code | imagetools link image paste ',
		fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt',
		paste_data_images: true,

		images_upload_handler: function(blobInfo, success, failure) {
			success('data:' + blobInfo.blob().type + ';base64,' + blobInfo.base64());
		},
		image_class_list: [{
			title: 'Responsive',
			value: 'img-responsive'
		}],
	});
</script>


<script type="text/javascript">
    $(function () {
        $("#opsi").change(function () {
            if ($(this).val() == "1") {
                $("#pilA").show();
                $("#pilB").hide();
				 $("#pilC").hide();
				  $("#pilD").hide();
				   $("#pilE").hide();
				$("#perA").show();
                $("#perB").hide();
				 $("#perC").hide();
				  $("#perD").hide();
				   $("#perE").hide();
				    $("#labA").show();
					$("#labB").hide();
					$("#labC").hide();
					$("#labD").hide();
					$("#labE").hide();
					$("#kunci1A").show();
					
					
            } else if ($(this).val() == "2") {
                $("#pilA").show();
                $("#pilB").show();
				 $("#pilC").hide();
				  $("#pilD").hide();
				   $("#pilE").hide();
				   $("#perA").show();
                $("#perB").show();
				 $("#perC").hide();
				  $("#perD").hide();
				   $("#perE").hide();
				    $("#labA").show();
					$("#labB").show();
					$("#labC").hide();
					$("#labD").hide();
					$("#labE").hide();
					$("#kunci1A").show();
					$("#kunci1B").show();
					$("#kunci2A").show();
					$("#kunci2B").show();
					
		} else if ($(this).val() == "3") {
                $("#pilA").show();
                $("#pilB").show();
				 $("#pilC").show();
				  $("#pilD").hide();
				   $("#pilE").hide();
				  $("#perA").show();
                $("#perB").show();
				 $("#perC").show();
				  $("#perD").hide();
				   $("#perE").hide();
				    $("#labA").show();
					$("#labB").show();
					$("#labC").show();
					$("#labD").hide();
					$("#labE").hide();
					$("#kunci1A").show();
					$("#kunci1B").show();
					$("#kunci1C").show();
					$("#kunci2A").show();
					$("#kunci2B").show();
					$("#kunci2C").show();
					$("#kunci3A").show();
					$("#kunci3B").show();
					$("#kunci3C").show();
		} else if ($(this).val() == "4") {
                $("#pilA").show();
                $("#pilB").show();
				 $("#pilC").show();
				  $("#pilD").show();
				   $("#pilE").hide();
				    $("#perA").show();
                $("#perB").show();
				 $("#perC").show();
				  $("#perD").show();
				   $("#perE").hide();
				    $("#labA").show();
					$("#labB").show();
					$("#labC").show();
					$("#labD").show();
					$("#labE").hide();
					$("#kunci1A").show();
					$("#kunci1B").show();
					$("#kunci1C").show();
					$("#kunci1D").show();
					$("#kunci2A").show();
					$("#kunci2B").show();
					$("#kunci2C").show();
					$("#kunci2D").show();
					$("#kunci3A").show();
					$("#kunci3B").show();
					$("#kunci3C").show();
					$("#kunci3D").show();
					$("#kunci4A").show();
					$("#kunci4B").show();
					$("#kunci4C").show();
					$("#kunci4D").show();
	} else if ($(this).val() == "5") {
                $("#pilA").show();
                $("#pilB").show();
				 $("#pilC").show();
				  $("#pilD").show();
				   $("#pilE").show();
				    $("#perA").show();
                $("#perB").show();
				 $("#perC").show();
				  $("#perD").show();
				   $("#perE").show();
				    $("#labA").show();
					$("#labB").show();
					$("#labC").show();
					$("#labD").show();
					$("#labE").show();
					$("#kunci1A").show();
					$("#kunci1B").show();
					$("#kunci1C").show();
					$("#kunci1D").show();
					$("#kunci1E").show();
					$("#kunci2A").show();
					$("#kunci2B").show();
					$("#kunci2C").show();
					$("#kunci2D").show();
					$("#kunci2E").show();
					$("#kunci3A").show();
					$("#kunci3B").show();
					$("#kunci3C").show();
					$("#kunci3D").show();
					$("#kunci3E").show();
					$("#kunci4A").show();
					$("#kunci4B").show();
					$("#kunci4C").show();
					$("#kunci4D").show();
					$("#kunci4E").show();
            }else{
				  $("#pilA").hide();
                $("#pilB").hide();
				 $("#pilC").hide();
				  $("#pilD").hide();
				   $("#pilE").hide();
				   $("#perA").hide();
                $("#perB").hide();
				 $("#perC").hide();
				  $("#perD").hide();
				   $("#perE").hide();
				   $("#labA").hide();
					$("#labB").hide();
					$("#labC").hide();
					$("#labD").hide();
					$("#labE").hide();
			}
        });
    });
</script>
<script type="text/javascript">
    $(function () {
        $("#pernyataan").change(function () {
            if ($(this).val() == "1") {
                $("#perA").show();
                $("#perB").hide();
				 $("#perC").hide();
				  $("#perD").hide();
				   $("#perE").hide();
				    $("#labA").show();
                $("#labB").hide();
				 $("#labC").hide();
				  $("#labD").hide();
				   $("#labE").hide();
            } else if ($(this).val() == "2") {
                $("#perA").show();
                $("#perB").show();
				 $("#perC").hide();
				  $("#perD").hide();
				   $("#perE").hide();
				    $("#labA").show();
                $("#labB").show();
				 $("#labC").hide();
				  $("#labD").hide();
				   $("#labE").hide();
		} else if ($(this).val() == "3") {
                $("#perA").show();
                $("#perB").show();
				 $("#perC").show();
				  $("#perD").hide();
				   $("#perE").hide();
		} else if ($(this).val() == "4") {
                $("#perA").show();
                $("#perB").show();
				 $("#perC").show();
				  $("#perD").show();
				   $("#perE").hide();
	} else if ($(this).val() == "5") {
                $("#perA").show();
                $("#perB").show();
				 $("#perC").show();
				  $("#perD").show();
				   $("#perE").show();
            }else{
				  $("#perA").hide();
                $("#perB").hide();
				 $("#perC").hide();
				  $("#perD").hide();
				   $("#perE").hide();
				     $("#labA").hide();
                $("#labB").hide();
				 $("#labC").hide();
				  $("#labD").hide();
				   $("#labE").hide();
				   $("#kunci1A").hide();
				    $("#kunci1B").hide();
					 $("#kunci1C").hide();
					  $("#kunci1D").hide();
					   $("#kunci1E").hide();
					    $("#kunci2A").hide();
				    $("#kunci2B").hide();
					 $("#kunci2C").hide();
					  $("#kunci2D").hide();
					   $("#kunci2E").hide();
			}
        });
    });
</script>

