        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3> Create Paper</h3>
                </div>
            </div>
            <div class="clearfix"></div>
            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Selection</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
           <form class="form-horizontal form-label-left enter" action="<?php echo $base_url;?>CBT/get_question_print" method="post" >
               <?php
               if($this->user_model->is_super()){?>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Branch <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="branch" name="branch" class="form-control select2" required="true">
                            <option value="">Select Branch</option>
                          <?php       
                              foreach ($branch as $value) {
                          ?>
                    <option value="<?php echo $value->id; ?>"><?php echo $value->name?></option>
                  <?php } ?>
                          </select>
                        </div>
                      </div>
                    <?php }else{?>
                      <input type="hidden" id="branch" name="branch" value="<?php echo $this->user_model->getbranch();?>">
                   <?php } ?>  
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Class <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="class" name="class" class="form-control select2" required>
                            <option value="">Select Class</option>
                          </select>
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Subject <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="subject" name="subject" class="form-control sub select2" required>
                            <option value="">Select Subject</option>
                          </select>
                        </div>
                      </div>
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Chapter<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <div id="chapterpast" class="ch[]">

                          </div>
                       
                        </div>
                      </div>
                       <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Level<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          
                          <select id="level" name="level" class="form-control" required>
                            <option value="">Select Level</option>
                            <option value="Easy">Easy</option>
                            <option value="Medium">Medium</option>
                            <option value="Difficult">Difficult</option>
                          </select>
                        </div>
                      </div>
                       
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-10" for="name">Date of Paper<span class="required">*</span>
                        </label>
                        <div class="col-md-2 col-sm-2 col-xs-10">
                                <input type="date" name="dateofpaper" class="form-control "  >
                        </div>
                        <label class="control-label col-md-2 col-sm-2 col-xs-5" for="name">Time in minutes<span class=" ">*</span>
                        </label>
                        <div class="col-md-2 col-sm-3 col-xs-2">
                                <input type="number" min="0" name="time" class="form-control only-numeric" placeholder="Time in minutes">
                        </div>
                      </div>
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-10" for="name">Total Marks<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-2 col-xs-10">
                                <input type="number" min="0" name="totalmarks" class="form-control only-numeric" placeholder="Total Marks of this paper">
                        </div>
                      </div>
<!--start of mcq-->
                       <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Tag Line for Mcqs<span class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                           <input type="text" name="mcq_tag" class="form-control" id="mcqtag" readonly>                       
                        </div>
                        <div class="col-md-2 col-sm-2 col-xs-12">
                           <span class="mcqtype">0</span>                       
                        </div>
                      </div>
                      <div class="item form-group row1">
                        <label class="control-label col-md-3 col-sm-3 col-xs-10" for="name">Mcq's<span class="required">*</span></label>
                        <div class="col-md-2 col-sm-2 col-xs-10">
                                <input type="number" min="0" name="mcq" class="form-control q q0 mcqqty only-numeric" readonly>
                        </div>
                        <label class="control-label col-md-2 col-sm-2 col-xs-5" for="name">Mcq Marks<span class=" ">*</span></label>

                        <div class="col-md-2 col-sm-3 col-xs-2">
                                <input type="number" min="0" name="mcq_marks" class="form-control m m0 mcqmarks only-numeric"  readonly>
                        </div>
                      </div>
<!---end of mcqs-->

<!--true false-->
                      <div class="item form-group"   >
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Tag Line for True/False<span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                           <input type="text" name="tf_tag" class="form-control" id="typee19" readonly>                       
                        </div>
                        <div class="col-md-2 col-sm-2 col-xs-12">
                           <span id="type19">0</span>                       
                        </div>
                      </div>

                      <div class="item form-group row1">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">True False<span class=" ">*</span>
                        </label>

                        <div class="col-md-2 col-sm-2 col-xs-5">
                                <input type="number" name="truefalse"  class="form-control q q18 typeee19"  readonly>
                        </div>

                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="name">Marks<span class=" ">*</span></label>

                        <div class="col-md-2 col-sm-2 col-xs-5">
                                <input type="number" name="truefalse_marks"  class="form-control  m m18 typeeemarks19"  readonly >
                        </div>
                      </div>
<!--true false end-->

                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          <button id="send" type="submit" class="btn btn-success pull-right" disabled>Add</button>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>
            
                
            </div>
          </div>
        </div>
        <!-- /page content -->
        <!-- footer content -->
        <footer>
          <div class="pull-right">
            EduSolutions
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>

    <!-- Custom JS -->
    <script src="<?php echo base_url(); ?>assets/js/main.js"></script>
    <!-- Bootstrap -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo base_url(); ?>assets/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="<?php echo base_url(); ?>assets/vendors/nprogress/nprogress.js"></script>
    <!-- Chart.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/Chart.js/dist/Chart.min.js"></script>
    <!-- gauge.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/gauge.js/dist/gauge.min.js"></script>
    <!-- bootstrap-progressbar -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
    <!-- iCheck -->
    <script src="<?php echo base_url(); ?>assets/vendors/iCheck/icheck.min.js"></script>
    <!-- Skycons -->
    <script src="<?php echo base_url(); ?>assets/vendors/skycons/skycons.js"></script>
    <!-- Flot -->
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.pie.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.time.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.stack.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.resize.js"></script>
    <!-- Flot plugins -->
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.orderBars.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/date.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.spline.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/curvedLines.js"></script>
    <!-- jVectorMap -->
    <script src="<?php echo base_url(); ?>assets/js/maps/jquery-jvectormap-2.0.3.min.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/js/moment/moment.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/datepicker/daterangepicker.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.min.js"></script>
    
    <script src="<?php echo base_url()?>assets/select/js/select2.min.js"></script> 
    
    <script>
 
     $('.select2').select2({
       allowClear:true
      });
    </script>
    
    <script type="text/javascript">
    
    $(document).ready(function() {
      $(".only-numeric").bind("keypress", function (e) {
          var keyCode = e.which ? e.which : e.keyCode
               
          if (!(keyCode >= 48 && keyCode <= 57)) {
            return false;
          }
      });
    });
     
</script>

<script>
        $(document).ready(function(){
     
            $(document).on("change","#branch",function(){
                var value = $(this).val();
                $.get("<?php echo base_url(); ?>load/classs/role/"+value,{},function(d){
                    var pre = '<option value="">Select Class</opiton>';
                    $("#class").html(pre+d);
                });
            });
            
             
                var value = $("#branch").val();
                $.get("<?php echo base_url(); ?>load/classs/role/"+value,{},function(d){
                    var pre = '<option value="">Select Class</opiton>';
                    $("#class").html(pre+d);
                });
            
            
        });
    </script>
<script>
        $(document).ready(function(){
             
            $(document).on("change","#class",function(){
                var value = $(this).val();
                $.get("<?php echo base_url(); ?>load/subjectforpaper/"+value,{},function(d){
                    var pre = '<option value="">Select Subject</opiton>';
                    $("#subject").html(pre+d);
                });
            });
            
        });                             
</script>
<script type="text/javascript">
 
        $('#subject').change(function(){
          var id=$('#class').val();
          var idsub=$('#subject').val();
          $.ajax({
                    url: "<?php echo base_url(); ?>load/questionagainstchpter_checkbox/"+id+"/"+idsub,
                    data: {},
                      success: function( result ) {
                    
                    $( "#chapterpast" ).html(result);
                    if(result==''){
                      $('#send').prop('disabled',true);
                    }else{
                      $('#send').prop('disabled',false);
                    }
  }
});

        });
         
</script>
<!-- //=======================================Function for the total of Marks here=======================-->
<script type="text/javascript">
      $('document').ready(function(){
        $('.enter').submit(function(e){
          e.preventDefault();
          var sum = parseInt(0);
          var b =parseInt(0);
        $('.q').each(function(i,v){
          if($('.q'+i).val()!='' && $('.m'+i).val()!='' ) {
            sum = parseInt($('.q'+i).val())*parseInt($('.m'+i).val());
            b+=sum;
          }          
      });
    $('.marks').val(b);
     $('.enter').unbind("submit").submit();
    });
}); 
</script>
<!-- //=======================================Validation=================================-->
<script type="text/javascript">
        $('#level').change(function(){
            
          $('.mcqtype').html(0);
          $('#mcqtag').attr('readonly',true);
          $('.mcqqty').attr('readonly',true);
          $('.mcqmarks').attr('readonly',true);
          $('.shorttype').html(0);
          $('#shorttag').attr('readonly',true);
          $('.shortqty').attr('readonly',true);
          $('.shortmarks').attr('readonly',true);
          $('#longtype').html(0);
          $('#longtag').attr('readonly',true);
          $('.longqty').attr('readonly',true);
          $('.longmarks').attr('readonly',true);
          for ( var t =19; t >=4; t-- ) {
            $('#type'+t).html(0);
            $('#typee'+t).attr('readonly',true);
            $('.typeee'+t).attr('readonly',true);
            $('.typeeemarks'+t).attr('readonly',true);
          }
          var cl=$('#class').val();
          var branch=$('#branch').val();
          var subject=$('#subject').val();
          var level=$('#level').val();
          var ch_checked=new Array();
         $( ".ch:checked" ).each(function() {
              ch_checked.push($(this).val());
          });
          $.get("<?php echo base_url(); ?>load/questions_checked/"+cl+"/"+branch+"/"+subject+"/"+level,{ch_checked:ch_checked},function(d){
                    var res=jQuery.parseJSON(d);
                    console.log(res);
                      $.each( res[3], function( i, v ){
                          $('#type'+v.type).html(v.total);
                          $('#typee'+v.type).removeAttr("readonly");
                          $('.typeee'+v.type).removeAttr("readonly");
                          $('.typeeemarks'+v.type).removeAttr("readonly");
                          $('.typeee'+v.type).attr("max",v.total);
                    });
                    //======================mcq=====================
                    if(res[0].total_mcq>0){
                     $('.mcqtype').html(res[0].total_mcq);
                     $('#mcqtag').removeAttr("readonly");
                     $('.mcqqty').removeAttr("readonly");
                     $('.mcqmarks').removeAttr("readonly");
                     $('.mcqqty').attr("max",res[0].total_mcq);
                    }
                     
                });
        });
</script>
  </body>
</html>