EVOLUTION-NINJA
Edit File: final_test_result.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 Final Test</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/images/favicon.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> <!--<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> --> <script type="text/javascript" src="<?php echo base_url('public/assets/js/piechart.js'); ?>"></script> <!-- <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> --> <link rel="stylesheet" href="<?php echo base_url('public/assets/datatables/jquery.dataTables.css'); ?>"> </head> <body> <header> <?php $uri_id = current_url(true)->getSegment(3) ?> <div class="container-fluid"> <div class="col-sm-3"> <a href="<?php echo site_url('/'); ?>" class="logo-lg"><img src="<?php echo base_url('public/assets/images/Logo_AMCAD.png'); ?>" class="img-responsive"></a> </div> <div class="col-sm-4 header_right"> <ul> <input type="hidden" value="<?= current_url(true)->getSegment(3) ?>" class="sub_domain_id" /> <input type="hidden" value="<?php echo $mapping_id; ?>" class="mapping_id" /> <?php if ($course_title != "") { ?> <li><?php echo $course_title; ?></li> <?php } else { ?> <li><?php echo ""; ?></li> <?php } ?> <li>|</li> <li>Final Test</li> </ul> </div> <div class="col-sm-5 header_links"> <ul class="nav navbar-top-links navbar-right"> <li><a href="#">Home</a></li> <li><a href="#">Join Class</a></li> <li><a href="<?php echo site_url('added-course-details'); ?>/<?= current_url(true)->getSegment(4) ?>">Dashboard</a></li> <li><a href="<?php echo site_url('user-dashboard'); ?>">MyCourses</a></li> <li><a href="#">Lessons</a></li> <li> <a href="<?php echo site_url('user-reports'); ?>/<?php echo $mapping_id; ?>"> Reports </a> </li> <li class="dropdown"> <a href="" class="dropdown-toggle menuacolor" data-toggle="dropdown"><?php echo session()->get('user_username'); ?> <span class="glyphicon glyphicon-chevron-down"></span></a> <!--- <ul class="dropdown-menu header_links_dropdown"> <li> <a href="<?php //echo site_url('user-dashboard'); ?>"> My Courses </a> </li> <li><a href="<?php //echo site_url('user-logout'); ?>" class="menuacolor">Logout</a></li> </ul>---> <ul class="dropdown-menu header_links_dropdown"> <li class="dropdown-submenu"> <a class="test" href="#"><i class="fa fa-cog" aria-hidden="true"></i> <b>Setting</b> <span class="caret"></span></a> <ul class="dropdown-menu"> <li> <?php if (current_url(true)->getSegment(1) == 'chapter-wise-materials') { ?> <a href="<?php echo site_url('edit-user-prifile/' . current_url(true)->getSegment(3)); ?>"><i class="fa fa-user fa-fw"></i> <b>User Profile</b></a> <?php } else { ?> <a href="<?php echo site_url('edit-user-prifile/' . current_url(true)->getSegment(2)); ?>"><i class="fa fa-user fa-fw"></i> <b>User Profile</b></a> <?php } ?> </li> <li class="divider"></li> <!--<li><a href="<?php echo site_url('update-password-user/' . current_url(true)->getSegment(2)); ?>/<?php echo md5(session()->get('user_login_id')); ?>"><i class="fa fa-user fa-fw"></i>Update Password</a></li>--> <?php if (current_url(true)->getSegment(1) == 'chapter-wise-materials') { ?> <li><a href="<?php echo site_url('update-password-user/' . current_url(true)->getSegment(3)); ?>/<?php echo md5(session()->get('user_login_id')); ?>"><i class="fa fa-user fa-fw"></i><b>Update Password</b></a></li> <?php } else { ?> <li><a href="<?php echo site_url('update-password-user/' . current_url(true)->getSegment(2)); ?>/<?php echo md5(session()->get('user_login_id')); ?>"><i class="fa fa-user fa-fw"></i><b>Update Password</b></a></li> <?php } ?> </ul> </li> <li> <a href="<?php echo site_url('user-logout'); ?>"><i class="fa fa-sign-out fa-fw"></i> Logout</a> </li> </ul> </li> </ul> </div> <div class="col-sm-3 header_right_div"> <!--<ul> <li onclick="instruction(<?php //echo $uri_id; ?>);" class="instruction"><i class="fa fa-info-circle" aria-hidden="true"></i> Instructions</li> <li>Timer</li> </ul> --> </div> </div><!-- container----> </header> <section class="result_middle"> <div class="container"> <div class="row"> <div class="col-sm-4 result_middle_row1_left"> <h4>Final Test | Test Result & Analysis</h4> <?php if ($finals_score < $finals_result->passing_criteria) { ?> <h4 style="color: red"> Result : Fail </h4> <?php } else { ?> <h4 style="color: #89b21c;"> Result : Pass </h4> <?php } ?> </div> </div> <div class="row"> <div class="col-sm-8 result_middle_row1"> <!-- <div id="chart_div"></div> --> <div id="chartContainer" style="height: 370px; max-width: 920px; margin: 0px auto;"></div> </div> <div class="col-sm-4 result_middle_row1_right"> <h1 class="result-one"><?php echo $correct_answer; ?></h1> <p class="corretext">Correct</p> <br> <hr> <h1 class="result-two"><?php echo $incorrect_answer; ?></h1> <p class="corretext">Incorrect</p> <br> <hr> <h1 class="result-three"><?php echo $not_attempted_answer; ?></h1> <p class="corretext">Not Attempted</p> <br> </div> </div><!-- row 1 --> <div class="row result_middle_row_two"> <table class="table table-striped table-hover list_table" style="width:100%;" id="myTable"> <thead> <tr class=""> <th style="width:10%;" class="col-xs-2">Sl No</th> <th style="width:20%;" class="col-xs-1">Result</th> <th style="width:50%;" class="col-xs-6">Question</th> <th style="width:10%;" class="col-xs-1">Score</th> <!-- <th class="col-xs-1">Difficulty</th> --> <th style="width:10%;" class="col-xs-2">Review</th> </tr> </thead> <tbody id="table_body"> <?php $count = 1; foreach ($questions as $question) { ?> <tr class=""> <td> <pre><code><?php echo $count; ?></code></pre> </td> <?php if ($question->ans == $question->correct_answer) { ?> <td> <pre><code><?php echo "Correct"; ?></code></pre> </td> <?php } elseif ($question->correct_answer == "0") { ?> <td> <pre><code><?php echo "Not Answered"; ?></code></pre> </td> <?php } else { ?> <td> <pre><code><?php echo "Wrong"; ?></code></pre> </td> <?php } ?> <td> <pre><code><?php echo $question->questions; ?></code></pre> </td> <?php if ($question->ans == $question->correct_answer) { ?> <td> <pre><code><?php echo "1"; ?></code></pre> </td> <?php } else { ?> <td> <pre><code><?php echo "0"; ?></code></pre> </td> <?php } ?> <td><button type="button" class="btn btn-success col-sm-6" style="background-color: grey;border-color: grey;" onclick="view_questions(<?php echo $question->qid; ?>)">Review</button></td> </tr> <?php $count++; } ?> </tbody> </table> </div><!-- row 2 --> </div><!-- container --> </section> <!-- Modal --> <div class="modal fade" id="review_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Review Question</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="row land_owner_a"> <div class="form-group col-xs-8 col-sm-10 col-md-10"> <label class="col-sm-4 hidden-xs">Question</label> <textarea type="text" class="form-control col-md-10 questions" rows="5" cols="80" readonly></textarea> </div> <label class="col-sm-4 hidden-xs">Answer</label> <section id="first" class="form-group col-xs-8 col-sm-10 col-md-10"> <div class="qustion_option1 question" style="display: none;"> <div class="one"> <label for="radio-1">A</label> <input type="radio" name="ans" id="radio-1" value="1"> </div> <div class="two"> <!--<input type="text" class="form-control" name="ans" id="radio1" style="border: none" readonly>--> <textarea type="text" class="form-control" name="ans" id="radio1"></textarea> </div> </div> <div class="qustion_option2 question" style="display: none;"> <div class="one"> <label for="radio-2">B</label> <input type="radio" name="ans" id="radio-2" value="2"> </div> <div class="two"> <textarea type="text" class="form-control" name="ans" id="radio2"></textarea> </div> </div> <div class="qustion_option3 question" style="display: none;"> <div class="one"> <label for="radio-3">C</label> <input type="radio" name="ans" id="radio-3" value="3"> </div> <div class="two"> <textarea type="text" class="form-control" name="ans" id="radio3"></textarea> </div> </div> <div class="qustion_option4 question" style="display: none;"> <div class="one"> <label for="radio-1">D</label> <input type="radio" name="ans" id="radio-4" value="41"> </div> <div class="two"> <textarea type="text" class="form-control" name="ans" id="radio4"></textarea> </div> </div> </section> <div class="form-group col-xs-8 col-sm-10 col-md-10"> <label class="col-sm-4 hidden-xs">Explanation</label> <textarea type="text" class="form-control col-md-10 explanation" rows="5" cols="80" readonly></textarea> </div> <div class="form-group col-xs-12 col-sm-10 col-md-10" id="user_answer"></div> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div> </body> </html> <script type="text/javascript"> // $(document).ready( function () { // $(document)[0].oncontextmenu = function() { return false; } // $(document).mousedown(function(e) { // if( e.button == 2 ) { // alert('Sorry, this functionality is disabled!'); // return false; // } else { // return true; // } // }); // }); function back() { var sub_domain_id = $('.sub_domain_id').val(); var mapping_id = $('.mapping_id').val(); window.location.href = "<?php echo site_url('added-course-details'); ?>/" + mapping_id; } function instruction(str) { window.location.href = "<?php echo site_url('test-welcome-page'); ?>/" + str; } function view_questions(str) { var sub_domain_id = $('.sub_domain_id').val(); var question_id = str; $.ajax({ type: 'post', // url : '<?php //echo site_url("get_subject_chapter_wise_questions") ?>', url: '<?php echo site_url("get_subject_wise_questions") ?>', data: { question_id: question_id, sub_domain_id: sub_domain_id }, async: false, success: function(response) { // response=jQuery.parseJSON(response); console.log(response); if (response.result == 1) { $('#review_modal').modal('show'); var answer1 = response.details.ans1; var answer2 = response.details.ans2; var answer3 = response.details.ans3; var answer4 = response.details.ans4; if (answer1 != "" && answer2 != "" && answer3 != "" && answer4 != "") { $('.qustion_option1').show(); $('.qustion_option2').show(); $('.qustion_option3').show(); $('.qustion_option4').show(); $('#radio1').val(response.details.ans1); $('#radio2').val(response.details.ans2); $('#radio3').val(response.details.ans3); $('#radio4').val(response.details.ans4); } else if (answer1 != "" && answer2 != "" && answer3 != "") { $('.qustion_option1').show(); $('.qustion_option2').show(); $('.qustion_option3').show(); $('.qustion_option4').hide(); $('#radio1').val(response.details.ans1); $('#radio2').val(response.details.ans2); $('#radio3').val(response.details.ans3); } else if (answer1 != "" && answer2 != "" && answer4 != "") { $('.qustion_option1').show(); $('.qustion_option2').show(); $('.qustion_option3').hide(); $('.qustion_option4').show(); $('#radio1').val(response.details.ans1); $('#radio2').val(response.details.ans2); $('#radio4').val(response.details.ans4); } else if (answer1 != "" && answer3 != "" && answer4 != "") { $('.qustion_option1').show(); $('.qustion_option2').hide(); $('.qustion_option3').show(); $('.qustion_option4').show(); $('#radio1').val(response.details.ans1); $('#radio3').val(response.details.ans3); $('#radio4').val(response.details.ans4); } else if (answer2 != "" && answer3 != "" && answer4 != "") { $('.qustion_option2').show(); $('.qustion_option3').show(); $('.qustion_option3').hide(); $('.qustion_option4').show(); $('#radio2').val(response.details.ans2); $('#radio3').val(response.details.ans3); $('#radio4').val(response.details.ans4); } else if (answer1 != "" && answer2 != "") { $('.qustion_option1').show(); $('.qustion_option2').show(); $('.qustion_option3').hide(); $('.qustion_option4').hide(); $('#radio1').val(response.details.ans1); $('#radio2').val(response.details.ans2); $('#radio4').val(response.details.ans4); } else if (answer1 != "" && answer3 != "") { $('.qustion_option1').show(); $('.qustion_option2').hide(); $('.qustion_option3').show(); $('.qustion_option4').hide(); $('#radio1').val(response.details.ans1); $('#radio3').val(response.details.ans3); } else if (answer1 != "" && answer4 != "") { $('.qustion_option1').show(); $('.qustion_option2').hide(); $('.qustion_option3').hide(); $('.qustion_option4').show(); $('#radio1').val(response.details.ans1); $('#radio4').val(response.details.ans4); } else if (answer2 != "" && answer3 != "") { $('.qustion_option1').hide(); $('.qustion_option2').show(); $('.qustion_option3').show(); $('.qustion_option4').hide(); $('#radio2').val(response.details.ans2); $('#radio3').val(response.details.ans3); } else if (answer2 != "" && answer4 != "") { $('.qustion_option1').hide(); $('.qustion_option2').show(); $('.qustion_option3').hide(); $('.qustion_option4').show(); $('#radio2').val(response.details.ans2); $('#radio4').val(response.details.ans4); } else if (answer3 != "" && answer4 != "") { $('.qustion_option1').hide(); $('.qustion_option2').hide(); $('.qustion_option3').show(); $('.qustion_option4').show(); $('#radio3').val(response.details.ans3); $('#radio4').val(response.details.ans4); } $('.questions').val(response.details.questions); //alert(response.details.ans); if (response.details.ans == "1") { $("#radio-1").prop("checked", true); } else if (response.details.ans == "2") { $("#radio-2").prop("checked", true); } else if (response.details.ans == "3") { $("#radio-3").prop("checked", true); } else { $("#radio-4").prop("checked", true); } $('.explanation').val(response.details.explanation); if (response.user_answer.correct_answer == '1') { $("#user_answer").html('<p>Your answer : ' + response.user_answer.ans1 + '</p>'); } else if (response.user_answer.correct_answer == '2') { $("#user_answer").html('<p>Your answer : ' + response.user_answer.ans2 + '</p>'); } else if (response.user_answer.correct_answer == '3') { $("#user_answer").html('<p>Your answer : ' + response.user_answer.ans3 + '</p>'); } else if (response.user_answer.correct_answer == '4') { $("#user_answer").html('<p>Your answer : ' + response.user_answer.ans4 + '</p>'); } else { $("#user_answer").html('<p>Not answered</p>'); } } else { } } }); } </script> < <script type="text/javascript" src="<?php echo base_url('public/assets/js/jquery.canvasjs.min.js'); ?>"> </script> <script type="text/javascript"> window.onload = function() { var var1; var var2; var var3; var sub_domain_id = $('.sub_domain_id').val(); var jsonData = $.ajax({ url: "<?php echo site_url('get_final_test_result'); ?>/" + sub_domain_id, dataType: "json", async: false }).responseText; response = jQuery.parseJSON(jsonData); console.log(response); $.each(response, function(idx, vx) { var1 = vx.correct_answer; var2 = vx.incorrect_answer; var3 = vx.not_attempted_answer; }); var options = { exportEnabled: true, animationEnabled: true, title: { text: "" }, legend: { horizontalAlign: "right", verticalAlign: "center" }, data: [{ type: "pie", showInLegend: true, toolTipContent: "<b>{name}</b>:#percent%", indexLabel: "#percent%", legendText: "{name} (#percent%)", indexLabelPlacement: "inside", dataPoints: [{ y: var1, name: "Correct Answer", color: "#89b21c" }, { y: var2, name: "Incorrect Answer", color: "#ff4d4d" }, { y: var3, name: "Not Attempted Answer", color: "#4f81bc" }, ] }] }; $("#chartContainer").CanvasJSChart(options); } </script> <script src="<?php echo base_url('public/assets/datatables/jquery.dataTables.js'); ?>"></script> <script type="text/javascript"> $(document).ready(function() { $('#myTable').DataTable(); }); </script> <style> .canvasjs-chart-toolbar, .canvasjs-chart-credit { display: none; } </style> <style type="text/css"> .modal-dialog { margin: 60px auto; } table, th, td { border: 1px solid grey; } .instruction { cursor: pointer; } pre { background-color: transparent !important; border: 1px solid transparent !important; font-size: 15px !important; } /* pre code { white-space: pre-line; text-align: justify; line-height: 1.8; } */ .header_links ul { padding-top: 2%; } .header_links ul li { float: left; list-style-type: none; } .header_links ul li a { color: white; padding: 10px 10px !important; } .header_links ul li a:hover { text-decoration: none; border-bottom: 1px solid white !important; background-color: transparent; } .header_links ul li a:focus { text-decoration: none; } .header_links_dropdown { background-color: #89b21c; } .header_links_dropdown>li>a:hover { background-color: transparent; } .one { display: table-cell; width: 40px; vertical-align: middle; } .two { display: table-cell; width: 330px; } .question { margin-bottom: 10px; } .chart { width: 100%; } .nav .open>a, .nav .open>a:focus, .nav .open>a:hover { background-color: transparent; } @media only screen and (min-width:320px) and (max-width:640px) { .one { display: table-cell; width: 40px; vertical-align: middle; } .result_middle_row_two { width: 900px; } .two { display: table-cell; width: 330px; } .question { margin-bottom: 10px; } /* #_ABSTRACT_RENDERER_ID_0 + rect + g > g > g > text { // x: 90 !important; } */ /* ellipse { cx: 160; cy: 200; } */ text { background-color: red; } /* circle { //cx: 70; } */ #chart_div>div>div { width: 320px !important; } #chart_div>div>div>div>svg { width: 320px !important; } #_ABSTRACT_RENDERER_ID_0+rect { width: 320px !important; } } header { height: 50px; } .logo-lg img { width: 33%; margin-left: 25px; } .header_links ul { padding-top: 1%; } .dropdown-submenu { position: relative; } .dropdown-submenu .dropdown-menu { top: 0; right: 100%; margin-top: -1px; } .nav .open>a, .nav .open>a:focus, .nav .open>a:hover { background-color: transparent !important; } .dropdown-menu>.active>a, .dropdown-menu>.active>a:focus, .dropdown-menu>.active>a:hover { background-color: transparent !important; } .dropdown-menu>li>a { color: #000 !important; } .dropdown-menu { background: #fff !important; } .nav a { font-weight: bold !important; } </style> <script> $(document).ready(function() { $('.dropdown-submenu a.test').on("click", function(e) { $(this).next('ul').toggle(); e.stopPropagation(); e.preventDefault(); }); }); </script>