<?php 
session_start();
include"../../../../inc/conn.php";
$id         = $_POST['id'];
$unit       = $_POST['unit'];
$q=mysqli_query($connect,"select * from tb_essai where id_essai='".$id."'");
$r=mysqli_fetch_array($q);
?>
    <link href="assets/plugins/summernote/summernote.css" rel="stylesheet">

    <form action="updateessai" method="POST">
            
        <input type="hidden" name="id_essai" value="<?php echo $r['id_essai'];?>">
        <input type="hidden" name="id_unit" value="<?php echo $unit;?>">


   

        <div class="form-group">
            <label for="exampleInputEmail1">Soal</label>
            <textarea name="soal" class="summernote form-control" required="required"><?php echo $r['soal'];?></textarea>
        </div>

        <hr>

        <div class="form-group">
            <label for="exampleInputEmail1">Opsi Jawaban A</label>
            <textarea name="opsi_a" class="form-control" required="required"><?php echo $r['opsi_a'];?></textarea>
        </div>

        <div class="form-group">
            <label for="exampleInputEmail1">Opsi Jawaban B</label>
            <textarea name="opsi_b" class="form-control" required="required"><?php echo $r['opsi_b'];?></textarea>
        </div>

        <div class="form-group">
            <label for="exampleInputEmail1">Opsi Jawaban C</label>
            <textarea name="opsi_c" class="form-control" required="required"><?php echo $r['opsi_c'];?></textarea>
        </div>        

        <div class="form-group">
            <label for="exampleInputEmail1">Opsi Jawaban D</label>
            <textarea name="opsi_d" class="form-control" required="required"><?php echo $r['opsi_d'];?></textarea>
        </div>

        <div class="form-group">
            <label for="exampleInputEmail1">Opsi Jawaban E</label>
            <textarea name="opsi_e" class="form-control" required="required"><?php echo $r['opsi_e'];?></textarea>
        </div>


    
        <div class="modal-footer justify-content-between">
              
              <button type="submit" class="btn btn-primary">Simpan</button>
              <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        
        </div>

       
        </form>        


        <script src="assets/plugins/summernote/summernote-bs4.min.js" defer></script>
        <script>
          $(document).ready(function() {
                $('.summernote').summernote({
                    height: 130,
                    toolbar: [
                        ['style', ['bold', 'italic', 'underline', 'clear']],
                        ['list', ['ul', 'ol']],
                        ['para', ['paragraph']],

                        ['insert', ['link','picture','video','table']],
        
                  ]
                });

           });

        </script>