<?php
$quiz_total_time = 0;
foreach ($quiz_questions as $value) {
    $quiz_total_time += $value->time_limit;
}
$quiz_total_time = $quiz_total_time / 60;
$taken_time = $taken_time / 60;
?>
<div class="col-sm-10 ">
        <div class="col-sm-12 gray_ttc" style="padding: 0">
            <div class="col-sm-8" style="padding: 0">
                <div class="col-sm-12 " style="padding: 20px">
                    <div class="col-sm-3 text-left" style="padding: 0"> 
                        Test
                    </div>
                    <div class="col-sm-9 text-left" style="padding-left: 30px">
                        <?php echo $quiz_info->quiz_name; ?>
                        <br>
                        <a href="<?php echo base_url() . 'quiz/' . $quiz_info->url; ?>">view quiz</a>
                        <br> 
                        Taken By 
                        <a href='<?php echo base_url() . $person_info->url . '/profile'; ?>'>
                            <?php echo $person_info->person_first_name . ' ' . $person_info->person_last_name; ?>
                        </a> 
                        <br>
                        on 
                        <?php echo date('Y-m-d'); ?>
                    </div>
                </div>

                <div class="col-sm-12 text-center" style="padding: 20px">
                    <div class="col-sm-3 text-left" style="padding: 0"> Score (Out of <?php echo $quiz_result->quiz_total_marks; ?>)</div>
                    <div class="col-sm-9 text-left" style="padding-left: 30px"> 
                        <?php echo $quiz_result->quiz_receive_marks . '&nbsp;(Out of ' . $quiz_result->quiz_total_marks . ')&nbsp;'; ?>
                        <?php
                        if ($person_rank <= 5) {
                            echo "<button class='btn btn-success'>  Top " . 5 . "</button>";
                        } else if ($person_rank <= 10) {
                            echo "<button class='btn btn-success'>  Top " . 10 . "</button>";
                        } else if ($person_rank <= 25) {
                            echo "<button class='btn btn-success'>  Top " . 25 . "</button>";
                        }
                        ?>                         
                    </div>
                </div>


                <div class="col-sm-12 text-center" style="padding: 20px">
                    <div class="col-sm-3 text-left" style="padding: 0"> Rank</div>
                    <div class="col-sm-9 text-left" style="padding-left: 30px"> <?php echo $person_rank; ?> Out of all <?php echo count($quiz_total_participant); ?> test takers</div>
                </div>


                <div class="col-sm-12 text-center" style="padding: 20px">
                    <div class="col-sm-3 text-left" style="padding: 0"> Time to Complete</div>
                    <div class="col-sm-9 text-left" style="padding-left: 30px"> 
                        <?php
                        $quiz_total_time = 0;                       
                        if ($quiz_result->quiz_random_static == 1) {
                            $quiz_total_time = ($quiz_questions[0]->time_limit * 60) * $quiz_result->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($quiz_result->quiz_finish_time) . ' / ' . $this->cf->sec2view($quiz_total_time);
                        ?>
                        <!--(40 Minutes Allowed)-->
                    </div>
                </div>
            </div>

            <div class="col-sm-4" style="padding: 0">
                <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>
            </div>

            <div class="col-sm-12 text-justify" style="padding: 20px">

                <?php echo $quiz_info->quiz_description; ?>

            </div>

        </div>
    </div>
