EVOLUTION-NINJA
Edit File: user_welcome_page.php
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <title>AMCAD MockTest</title> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/mock_test.css'); ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/bootstrap.min.css'); ?>" /> <link rel="stylesheet" type="text/css" href="<?php echo base_url('public/assets/css/font-awesome.min.css'); ?>" /> <link href='http://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'> <link rel='shortcut icon' type='image/x-icon' href='<?php echo base_url('public/assets/website_assets/images/Logo_AMCAD.png'); ?>' /> <script type="text/javascript" src="<?php echo base_url('public/assets/js/jquery-3.3.1.min.js'); ?>"></script> <script type="text/javascript" src="<?php echo base_url('public/assets/js/bootstrap.min.js'); ?>"></script> <link rel="stylesheet" href="<?php echo base_url('public/assets/toastr/toastr.min.css'); ?>"> <script type="text/javascript" src="<?php echo base_url('public/assets/toastr/toastr.min.js'); ?>"></script> </head> <body> <header> <div class="container-fluid"> <div class="col-sm-3"> <a class="logo-lg"><img src="<?php echo base_url('public/assets/images/Logo_AMCAD.png'); ?>" class="img-responsive"></a> </div> <div class="col-sm-9 header_right"> <ul> <li><?php echo $course_title; ?></li> <li>|</li> <li><?php echo $chapter->chapter_name; ?></li> <li>|</li> <li>Practice</li> </ul> </div> </div><!-- container----> </header> <section class="welcome_middle_one"> <div class="container-fluid"> <div class="col-sm-3"></div> <div class="col-sm-6 welcome_middle_one_middle"> <?php if (!empty($check)) { ?> <input type="hidden" value="<?php echo $check->id; ?>" class="check_if" /> <?php } else { ?> <input type="hidden" value="0" class="check_if" /> <?php } ?> <h4>Welcome to Practice</h4> <?php foreach ($questions as $quest) { ?> <?php if (empty($chapter)) { ?> <p>* This is a Practice Test of <?php echo $subject->sub_domain; ?> online Course which contains <?php echo $quest->number_of_questions; ?> multiple choice questions. <?php } else { ?> <p>* This is a Practice Test of <?php echo $chapter->chapter_name; ?> online Course which contains <?php echo $quest->number_of_questions; ?> multiple choice questions. <?php } ?> <?php if (empty($quest)) { ?> <p>* Test duration is <?php echo $quest->total_time; ?> minutes. <?php } else { ?> <p>* Test duration is <?php echo $quest->total_time; ?> minutes. <?php } ?> <?php } ?> <!-- <p>* Test duration is 6 in total(72 seconds per question).</p>--> <p>* There is no negative marking.</p> <p>* If you are unsure about the answer, you have an option 'Mark For Later' which marks that question to review and you can answer whenever before finishing the test.</p> <!-- <p>* Simply mark the question for the later and review at the end of the exam.</p> --> <p>* On clicking the questions on the left side of the screen it will be redirected to the particular question.</p> <p>* Marked for later questions will be highlighted in green color among the questions on left side of the screen.</p> <p>* Write down the formulas, mindmaps, brain dump and any other notes you may need to refer during the test.</p> <div class="label_mark"> <div class="radio"> <label class="round mark_checked1147"></label> <label>Mark For Later</label> </div> <!--- <div class="radio"> <label><input type="radio" name="optradio">Attempted</label> </div>---> </div> </div> <div class="col-sm-3"> <?php foreach ($details as $det) { ?> <input type="hidden" value="<?php echo $det->selected_type; ?>" class="type_value" /> <input type="hidden" value="<?php echo $det->subject_id; ?>" class="sub_val" /> <input type="hidden" value="<?php echo $det->chapter_id; ?>" class="chapter_val" /> <?php } ?> <input type="hidden" value="<?= current_url(true)->getSegment(2) ?>" class="chapter_val_url" /> </div> </div><!-- container----> </section> <!------------------------------------- middle Work END ------------------------------------------------> <footer> <div class="container-fluid"> <div class="col-sm-4"></div> <div class="col-sm-4"> <button type="button" class="btn btn-success buttonsri backbutton" onclick="previous();">Back</button> </div> <div class="col-sm-4"> <button type="button" class="btn btn-success buttonsri button" value="<?php echo $course_id; ?>" >Start Test</button> </div> </div><!-- container----> </footer> </body> </html> <script type="text/javascript"> function previous() { var mapping_id = <?= current_url(true)->getSegment(4) ?>; var subject = $('.sub_val').val(); window.location.href = "<?php echo site_url('added-course-details'); ?>/" + mapping_id; } /* $('.button').click(function(){ var selected_type = $('.type_value').val(); var subject = $('.sub_val').val(); var chapter = $('.chapter_val').val(); var chapter_val_url = $('.chapter_val_url').val(); var check_if = $('.check_if').val(); if(check_if == "0") { toastr["error"]('Test Setting Is Not Yet Done By Faculty!'); } else { toastr["success"]('You will be redirected to take test'); window.location.href = "<?php //echo site_url('get_questions_for_test_chapter_wise'); ?>/<?php //echo $this->uri->segment(2) ?>/"+chapter; } });*/ // $('.button').click(function() { // var mapping_id = <? //= current_url(true)->getSegment(4) ?>; // var selected_type = $('.type_value').val(); // var subject = $('.sub_val').val(); // var chapter = <? //= current_url(true)->getSegment(5) ?>; // var chapter_val_url = $('.chapter_val_url').val(); // var check_if = $('.check_if').val(); // if (check_if == "0") { // toastr["error"]('Test Setting Is Not Yet Done By Faculty!'); // } else { // $.ajax({ // url: "<?php //echo site_url('check_approved_materials') ?>", // type: "POST", // data: { // 'chapter_id': chapter, // 'mapping_id': mapping_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('get_questions_for_test_chapter_wise'); ?>/<? //= current_url(true)->getSegment(4) ?>/" + chapter; // } else { // toastr["error"]("Materials not available for this chapter"); // } // } // }); // } // }); $('.button').click(function() { var mapping_id = '<?= current_url(true)->getSegment(3) ?>'; // alert(mapping_id); var selected_type = $('.type_value').val(); var subject = $('.sub_val').val(); var chapter = '<?= current_url(true)->getSegment(5) ?>'; // alert(chapter); var chapter_val_url = $('.chapter_val_url').val(); var check_if = $('.check_if').val(); if (check_if == "0") { toastr["error"]('Test Setting Is Not Yet Done By Faculty!'); } else { $.ajax({ url: "<?= base_url('check_approved_materials') ?>", // Use base_url() to generate the correct URL method: "POST", // Use 'method' instead of 'type' data: { 'chapter_id': chapter, 'mapping_id': mapping_id }, async: false, success: function(response) { console.log(response); // response = JSON.parse(response); if (response.result == 1) { toastr["success"]('You will be redirected to take the test'); window.location.href = "<?= base_url('get_questions_for_test_chapter_wise') ?>/" + mapping_id + "/" + chapter; } else { console.log(response); toastr["error"]("Materials not available for this chapter"); } } }); } }); </script> <style> .round { width: 30px; height: 30px; border: 1px solid silver; text-align: center; line-height: 25px; border-radius: 50px; margin-top: -10px; margin-bottom: 0 !important; background-color: #00ff00; } .label_mark label { vertical-align: middle; } .logo-lg img { width: 33%; margin-left: 25px; } .header_links ul { padding-top: 1%; } </style>