EVOLUTION-NINJA
Edit File: end_of_module.php
<?php echo view('includes/user_header'); ?> <div id="page-wrapper" style="padding-top: 2%; padding-bottom: 2%;"> <!-- /.row --> <!--- <div class="row user_head_tab_row"> <ul class="user_head_tab"> <li><a href=""><i class="fa fa-home" aria-hidden="true"></i></a></li> <li> > </li> <li><a href=""><i class="fa fa-book" aria-hidden="true"></i></a></li> <li> / </li> <li><a href="">Dashboard</a></li> </ul> </div> <hr>---> <div class="row user_head_tab_row"> <ul class="user_head_tab"> <li><a href="<?php echo site_url('/'); ?>"><i class="fa fa-home" aria-hidden="true"></i></a></li> <li> > </li> <li><a href=""><i class="fa fa-book" aria-hidden="true"></i></a></li> <li> / </li> <!-- <li><a href="#">chapter name</a></li> <li> / </li> --> <li><a href="#"><?php echo $chapter_name->chapter_name; ?> - End Of Module Test Summary</a></li> </ul> </div> <hr> <section class="end_of_module"> <div class="container"> <div class="feedback_div"> <input type="hidden" value="<?php echo $finals; ?>" class="check_final" /> <h3><?php echo $chapter_name->chapter_name; ?> - End of Module test</h3> <input type="hidden" value="<?php echo $chapter_name->sub_domain_id; ?>" id="sub_domain_id" /> <input type="hidden" value="<?= current_url(true)->getSegment(2) ?>" id="mapping_id" /> <input type="hidden" value="<?= current_url(true)->getSegment(4) ?>" id="chapter_id" /> <!-- <button type="button" class="btn btn-default" id=""><i class="fa fa-hand-o-right" aria-hidden="true"></i> No Of Attempts</button>--> <i class="" aria-hidden="true"></i> No Of Attempts: <?php echo $practices_count; ?> <button type="button" class="btn btn-primary start_test" id=""><i class="fa fa-hand-o-right" aria-hidden="true"></i> Start Test</button> </div> </div> </section> <style> .end_of_module h3 { text-transform: uppercase; font-weight: 600; } .user_head_tab li { float: left; list-style-type: none; margin-right: 6px; } .user_head_tab li a:hover { text-decoration: none; } @media only screen and (min-width:992px) and (max-width:1258px) { .end_of_module h3 { font-size: 18px; } } </style> <!-- /.row --> </div> <script> $(document).ready(function() { var check = $('.check_final').val(); if (check == 1) { $('.start_test').prop('disabled', true); } else { $('.start_test').prop('disabled', true); } }); $(document).ready(function() { $('.start_test').click(function() { var mapping_id = $('#mapping_id').val(); var chapter_id = $('#chapter_id').val(); var sub_domain_id = $('#sub_domain_id').val(); var selected_type = 'chapter_wise'; $.ajax({ url: "<?php echo site_url('check_approved_materials') ?>", type: "POST", data: { 'chapter_id': chapter_id, 'subject_id': sub_domain_id, 'mapping_id': mapping_id }, async: false, success: function(response) { // response = jQuery.parseJSON(response); console.log(response); if (response.result == 1) { $.ajax({ url: "<?php echo site_url('subject_chapter_wise_questions') ?>", type: "POST", data: { 'selected_type': selected_type, 'subject': sub_domain_id, 'chapter': chapter_id }, async: false, success: function(response) { // response = jQuery.parseJSON(response); console.log(response); if (response.result == 1) { toastr["success"]('You will be redirected to take test'); window.location.href = "<?php echo site_url('test-welcome-page'); ?>/" + mapping_id + "/" + sub_domain_id + "/" + chapter_id; } else { toastr["error"](response.message); } } }); } else { toastr["error"]("Materials not available for this chapter"); } } }); }); }); </script> <?php echo view('includes/user_footer'); ?>