<?php
if ($quiz_info) {
    $quiz_id = $quiz_info->quiz_id;
    $quiz_status = $quiz_info->quiz_status;
    $url = $quiz_info->url;
    $quiz_pulication_status = $quiz_info->quiz_pulication_status;

    $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;
    }
    ?>
    <div class="col-sm-12 gray text-center" >
        <div class="col-sm-3" style="padding:10px 0">
            <a href="<?php echo base_url() . 'quiz/' . $quiz_info->quiz_public_id; ?>"><?php echo $quiz_info->quiz_name; ?>
            </a>
        </div>
        <div class="col-sm-3" style="padding:10px 0">
            <?php
            $status_array = array('', 'Public', 'TT Users', 'My Link', 'Group', 'Course', 'Video Course');
            echo $status_array[$quiz_pulication_status];
            ?>
        </div>
        <div class="col-sm-1" style="padding:10px 0"><?php echo count($quiz_questions); ?></div>
        <div class="col-sm-2" style="padding:10px 0"><?php echo $this->cf->sec2view($quiz_total_time); ?></div>

        <div class="col-sm-3" style="padding:10px 0">

                                                <!--            <a href="<?php // echo base_url() . 'quiz/' . $url . '/add-grade';    ?>"><i class="fa fa-plus-square-o" title="Add Grade"></i></a>
                                                            <span>&nbsp;&nbsp;</span>-->


                                                <!--            <a href="<?php // echo base_url() . 'quiz/' . $url . '/grade-details'             ?>"><i class="fa  fa-sun-o" title="View Grade"></i></a>
                                                            <span>&nbsp;&nbsp;</span>-->

            <?php // if ($quiz_info->certificate_id == NULL || $quiz_info->certificate_id == 0 || $quiz_info->certificate_id == '') {  ?>
                                                                <!--<a href="javascript:void(0)" data-toggle="modal" data-target="#assign_certificate" onclick="set_quiz_url(<?php echo $url; ?>);"><i class="fa  fa-certificate">&nbsp;&nbsp;</i></a>-->
            <?php // }  ?>

            <!--<br>-->

            <a href="<?php echo base_url() . 'quiz/' . $url . '/add-quiz-question'; ?>">
                <i class="fa fa-question-circle" title="Add question"></i>
            </a><span>&nbsp;&nbsp;</span>

            <a href="<?php echo base_url() . 'quiz/' . $url . '/question' ?>"><i class="fa  fa-th" title="View Question"></i>
            </a><span>&nbsp;&nbsp;</span>

            <a href="<?php echo base_url() . 'quiz/' . $url . '/edit-quiz'; ?>"><i class="fa fa-edit" title="Edit"></i>
            </a><span>&nbsp;&nbsp;</span>

            <?php
            if ($quiz_status == 0) {
                ?>
                <a href="javascript:void(0)" onclick="return checkForAction('<?php echo base_url() . 'change-quiz-status/' . $url . '/1'; ?>', 'Publish', '<?php echo $quiz_id; ?>')">
                    <i class="fa  fa-user-plus" title="Publish"></i>
                </a>&nbsp;&nbsp;
            <?php } else if ($quiz_status == 1) { ?>
                <a href="javascript:void(0)" onclick="return checkForAction('<?php echo base_url() . 'change-quiz-status/' . $url . '/0'; ?>', 'Unpublish', '<?php echo $quiz_id; ?>')">
                    <i class="fa  fa-user-times" title="Unpublish"></i>
                </a>&nbsp;&nbsp;
            <?php } else if ($quiz_status == 2) { ?>
                <a href="javascript:void(0)" onclick="return checkForAction('<?php echo base_url() . 'change-quiz-status/' . $url . '/1'; ?>', 'Publish', '<?php echo $quiz_id; ?>')">
                    <i class="fa  fa-user-plus" title="Publish"></i>
                </a>&nbsp;&nbsp;
            <?php } ?>

            <?php if ($quiz_status != 2) { ?>
                <a  href="javascript:void(0)" onclick="return checkForAction('<?php echo base_url() . 'change-quiz-status/' . $url . '/2'; ?>', 'Delete', '<?php echo $quiz_id; ?>')">
                    <i class="fa fa-trash-o" title="Delete"></i>
                </a>&nbsp;&nbsp;
            <?php } ?>
        </div>
    </div>
    <div class="col-sm-12"><br></div> 
<?php } ?>
