


<div class="col-md-12 column">
    
    <div class="col-md-6 column">

    <h2 >Quiz Result </h2>

<hr/>

    <h3>Status on Question </h3>
    <?php
    $correct_ans = $this->session->userdata('correct_ans');
    $wrong_ans = $this->session->userdata('wrong_ans');
    $total_question = $this->session->userdata('total_question');
    $total_marks = $this->session->userdata('total_marks');
    $receive_marks = $this->session->userdata('receive_marks');
    $this->session->unset_userdata('correct_ans');
    $this->session->unset_userdata('wrong_ans');
    $this->session->unset_userdata('total_question');
    $this->session->unset_userdata('total_marks');
    $this->session->unset_userdata('receive_marks');
    $this->session->unset_userdata('quiz_id');
    unset($_SESSION['pageload']);


    if (!$correct_ans) {
        $correct_ans = 0;
    }
    if (!$wrong_ans) {
        $wrong_ans = 0;
    }
    if (!$receive_marks) {
        $receive_marks = 0;
    }

    $unanswered = $total_question - ($correct_ans + $wrong_ans);


    if ($total_question) {
        $correct_percentage = ($correct_ans * 100) / $total_question;
    } else {
        $correct_percentage = 0;
    }
    if ($total_marks) {
        $marks_percentage = ($receive_marks * 100) / $total_marks;
    } else {
        $marks_percentage = 0;
    }





    echo 'Total question: ' . $total_question;
    echo'<br/>';
    echo 'Total correct ans: ' . $correct_ans;
    echo'<br/>';
    echo 'Total wrong ans: ' . $wrong_ans;
    echo'<br/>';
    echo 'Total Unansewerd question: ' . $unanswered;
    echo'<br/>';
    echo 'Correct Answer percentage: ' . round($correct_percentage, 2) . '' . '%';       /* round will shorten the decimal */
    echo'<br/>';
    echo '<h3>Status on Marks </h3>';
    echo 'Total Marks: ' . $total_marks;
    echo'<br/>';
    echo 'Receive Marks: ' . $receive_marks;
    echo'<br/>';
    echo 'Receive Marks percentage: ' . round($marks_percentage, 2) . '' . '%';
    ?>










    <br/><br/>
    <!--            <div class="checkbox col-sm-6" >
                    <button type="submit" id="submit" class="btn btn-success" >Submit</button>
                    <button type="reset" class="btn btn-info">Reset</button>
                </div>-->

    <br/><br/>
    </div>
    
      <div class="col-md-6 column">
      
             <br/><br/> 
          
    <div id="topLoader" style="width: 256px;
        height: 256px;
        margin-bottom: 32px;
        ">    
        
    </div>
   
             <h3>Marks Percentage Meter</h3>
        
   <script>
       
       var per =<?php echo $receive_marks / $total_marks; ?>;
      
       
        $(function() {
          var $topLoader = $("#topLoader").percentageLoader({
            width: 256, height: 256, controllable: true, progress: 0.5, onProgressUpdate: function (val) {
              this.setValue(Math.round(val * 100.0) + 'kj');
            }
          });

          var topLoaderRunning = false;

          /* Some browsers may load in assets asynchronously. If you are using the percentage
           * loader as soon as you create it (i.e. within the same execution block) you may want to
           * wrap it in the below `ready` function to ensure its correct operation
           */
          $topLoader.percentageLoader({onready: function () {
            $(function () {
              if (topLoaderRunning) {
                return;
              }
              topLoaderRunning = true;

              var kb = 100;
              var totalKb = 1000;

              var animateFunc = function () {
                kb += 1;
                
                $topLoader.percentageLoader({progress:per });
                $topLoader.percentageLoader({value: ( '100%')});

                if (kb < totalKb) {
                  setTimeout(animateFunc, 25);
                } else {
                  topLoaderRunning = false;
                }
              };

              setTimeout(animateFunc, 25);
            });

          }});
        });
      </script>
        
        



  


      </div>




</div>

<!-- progress meter js start -->



<!-- js end -->





<script language="javascript">
    //document.onmousedown=disableclick;
    //status="Right Click Disabled";
    //Function disableclick(event)
    //{
    //  if(event.button==2)
    //   {
    //     alert(status);
    //     return false;    
    //   }
    //}
</script>










