<?php
$quiz_total_time = 0;
foreach ($quiz_questions as $value) {
    $quiz_total_time += $value->time_limit;
}
?>
<section class="course">
    <div class="container-fluid">
        <div class="col-sm-12 ">            
            <div class="col-sm-12 form-group">
                        <div class="col-sm-6 form-group">
                            <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                            <!-- TT one -->
                            <ins class="adsbygoogle"
                                 style="display:block"
                                 data-ad-client="ca-pub-3140114751019908"
                                 data-ad-slot="5137628623"
                                 data-ad-format="auto"></ins>
                            <script>
                            (adsbygoogle = window.adsbygoogle || []).push({});
                            </script>
                        </div>

                        <div class="col-sm-6 form-group">
                            <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                                        <!-- TT two -->
                                        <ins class="adsbygoogle"
                                             style="display:block"
                                             data-ad-client="ca-pub-3140114751019908"
                                             data-ad-slot="9567828225"
                                             data-ad-format="auto"></ins>
                                        <script>
                                                                (adsbygoogle = window.adsbygoogle || []).push({});
                                        </script>
                        </div>
                 </div>
            <div class="row ">
                <div class="col-sm-12 padding-zero text-left"><h3>Quiz Result</h3></div>

                <div class="col-sm-12 padding-zero"><br></div>
                <div class="col-sm-12 gray">
                    <form action="quiz_test_multiple_choice_question.html" method="post">
                        <div class="col-sm-8  padding-zero text-left">
                            <div class="col-sm-12 text-left" style="padding: 0 0 5px 20px;">                                                                
                                <h3>Status On Questions</h3>  
                                <p>Total question : <?php echo $total_question; ?></p>
                                <p>Total correct answer : <?php echo $correct_ans; ?></p>
                                <p>Total  wrong answer : <?php echo $wrong_ans; ?></p>
                                <p>Total unanswer question: <?php echo $unanswered; ?></p>
                                <p>Taken Time: 
                                    <?php
                                    $quiz_total_time = 0;
                                    if ($quiz_info->quiz_random_static == 1) {
                                        $quiz_total_time = ($quiz_questions[0]->time_limit * 60) * $quiz_info->total_number_of_question;
                                    } else {
                                        foreach ($quiz_questions as $value) {
                                            $quiz_total_time += $value->time_limit;
                                        }
                                        $quiz_total_time = $quiz_total_time * 60;
                                    }
                                    echo $this->cf->sec2view($taken_time) . ' / ' . $this->cf->sec2view($quiz_total_time);
                                    ?>
                                </p>
                                <p>Correct answer percentage: <span id="skillP"><?php echo round($correct_percentage, 2); ?>%</span></p>                                                                                        
                            </div>                            
                            <div class="col-sm-12">  <hr><br>  </div>
                            
                            <div class="col-sm-12"><br></div>
                             <!----------- 03-09-2016 View Details Quiz Result--------------->
                             <?php if($this->session->userdata('sess_ques_id')){?>
                             <div class="col-sm-12 text-left" style="padding:10px 0 10px 15px;">   
                                <a target = "_blank" href="<?php echo base_url() . 'view-details-quiz-result/'.$quiz_info->quiz_public_id?>"> 
                                    <span class="btn btn-success" >View Details Quiz Result</span>
                                </a>
                            </div>
                             <?php } ?> 
                             <!----------- end View Details Quiz Result--------------->
                            
                            
                            <div class="col-sm-12" >
                                <?php if ($this->session->userdata('quiz_result_id')) { ?>
                                    <a href="<?php echo base_url() . 'quiz/' . $quiz_info->quiz_public_id . '/publish-result/' . $this->session->userdata('quiz_result_id'); ?>" 
                                       class="btn btn-success"> Publish Result </a>
                                   <?php } //else { ?>
                                    <!--<a href="<?php echo base_url() . 'quiz/' . $quiz_info->quiz_public_id . '/publish-result'; ?>"--> 
                                       <!--class="btn btn-success"> Publish Result </a>-->
                                   <?php //} ?>
                            </div>

                            <div class="col-sm-12 text-left" style="padding:10px 0 10px 15px;">
                                <a href="<?php echo base_url() . 'quiz/' . $quiz_info->quiz_public_id . '/start-quiz'; ?>"> <span class="btn btn-success" >Start Test</span></a>
                            </div>
                             
                        </div>
                    </form>    
                    <div class="col-sm-4 padding-zero">

                        <div class="row">
                            <div class="col-sm-12"><br><br><br></div>
                            <div class="col-sm-12" style="padding: 0">

                                <!--<div style="width: 200px;" id="testPercentage" class="circlestat  circliful" data-dimension="200" data-text="80%" data-width="30" data-fontsize="38" data-fgcolor="#32cd32" data-percent="80" data-bgcolor="#eee" data-fill="#ddd"><span style="line-height: 200px; font-size: 38px;" class="circle-text">80%</span><canvas height="200" width="200"></canvas></div>-->
                                <div id="testPercentage" class="circlestat " data-dimension="200" data-text="" data-width="30" data-fontsize="38" data-fgcolor="" data-percent=""  data-bgcolor="#eee" data-fill="#ddd"></div>
                                <script type="text/javascript">
                                    $(function () {
                                        var Skillpercentage = document.getElementById('skillP').innerHTML;
                                        var SkiilValue = Skillpercentage.replace("%", "");

                                        if (SkiilValue <= 50) {
                                            var testPercentage = document.getElementById('testPercentage');
                                            testPercentage.setAttribute("data-fgcolor", "#fc0a0a");
                                        }
                                        else if (SkiilValue <= 70) {
                                            var testPercentage = document.getElementById('testPercentage');
                                            testPercentage.setAttribute("data-fgcolor", "#f7ea5b");
                                        }
                                        else if (SkiilValue <= 85) {
                                            var testPercentage = document.getElementById('testPercentage');
                                            testPercentage.setAttribute("data-fgcolor", "#32cd32");
                                        }
                                        else if (SkiilValue <= 100) {
                                            var testPercentage = document.getElementById('testPercentage');
                                            testPercentage.setAttribute("data-fgcolor", "#8CC73F");
                                        }

                                        var testPercentage = document.getElementById('testPercentage');
                                        testPercentage.setAttribute("data-percent", SkiilValue);
                                        testPercentage.setAttribute("data-text", Skillpercentage);
                                        $('.circlestat').circliful();
                                    });</script>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-12"><br></div>
            </div>
            
                    <div class="col-sm-12 form-group">
                            <div class="col-sm-6 form-group">
                                <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                                    <!-- TT three -->
                                    <ins class="adsbygoogle"
                                         style="display:block"
                                         data-ad-client="ca-pub-3140114751019908"
                                         data-ad-slot="2044561420"
                                         data-ad-format="auto"></ins>
                                    <script>
                                        (adsbygoogle = window.adsbygoogle || []).push({});
                                    </script>
                            </div>
                            <div class="col-sm-6 form-group">
                                <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                                    <!-- TT four -->
                                    <ins class="adsbygoogle"
                                         style="display:block"
                                         data-ad-client="ca-pub-3140114751019908"
                                         data-ad-slot="8060742220"></ins>
                                    <script>
                                                            (adsbygoogle = window.adsbygoogle || []).push({});
                                    </script>
                            </div>
                        </div>           
        </div>
    </div> 
</section>