<div class="quiz-results">
    <div class="mhq-courses-details-area">
        <div class="mhq-courses-details-wrapper">
            <div class="mhq-left-content">
                <h3 class="mb-4"><?php echo e(__('student.quiz_results')); ?>: <?php echo e($quiz->title); ?></h3>

                <div class="results-summary mb-4">
                    <div class="row g-3">
                        <div class="col-md-6">
                            <div class="results-summary-card <?php echo e($attempt->passed ? 'passed' : 'failed'); ?>">
                                <h3 class="results-score-value <?php echo e($attempt->passed ? 'passed' : 'failed'); ?>">
                                    <?php echo e($attempt->score); ?>%
                                </h3>
                                <p style="margin-bottom: 5px;">
                                    <?php if($attempt->passed): ?>
                                        <span class="badge badge-passed"><?php echo e(__('student.passed')); ?></span>
                                    <?php else: ?>
                                        <span class="badge badge-failed"><?php echo e(__('student.failed')); ?></span>
                                    <?php endif; ?>
                                </p>
                                <small class="results-passing-score"><?php echo e(__('student.passing_score')); ?>: <?php echo e($quiz->passing_score); ?>%</small>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="results-summary-card theme">
                                <h3 class="results-score-value theme">
                                    <?php echo e($correctAnswersCount ?? $attempt->answers->where('is_correct', true)->count()); ?>/<?php echo e($quiz->questions->count()); ?>

                                </h3>
                                <p class="results-label"><?php echo e(__('student.correct_answers')); ?></p>
                            </div>
                        </div>
                    </div>
                    <div class="results-actions mt-4">
                        <button class="theme-btn retake-quiz-btn" data-quiz-id="<?php echo e($quiz->id); ?>"
                            data-course-id="<?php echo e($quiz->topic->course_id); ?>">
                            <i class="fas fa-redo"></i> <?php echo e(__('student.retake_quiz')); ?>

                        </button>
                    </div>
                </div>

                <div class="questions-review">
                    <h3 class="mb-4 question-review-title"><?php echo e(__('student.question_review')); ?></h3>
                    <?php $__currentLoopData = $questionsData ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $questionData): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div
                            class="question-review-item mb-4 <?php echo e($questionData['is_correct'] ? 'correct' : 'incorrect'); ?>">
                            <div class="question-review-header">
                                <h5 class="question-review-number"><?php echo e(__('student.question')); ?> <?php echo e($questionData['index'] + 1); ?></h5>
                                <?php if($questionData['is_correct']): ?>
                                    <span class="badge question-review-badge correct">
                                        <i class="fas fa-check"></i> <?php echo e(__('student.correct')); ?>

                                    </span>
                                <?php else: ?>
                                    <span class="badge question-review-badge incorrect">
                                        <i class="fas fa-times"></i> <?php echo e(__('student.incorrect')); ?>

                                    </span>
                                <?php endif; ?>
                            </div>
                            <p class="mb-3 question-review-text"><?php echo e($questionData['question']->question); ?></p>

                            <div class="options">
                                <?php $__currentLoopData = $questionData['options']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <div
                                        class="review-option-item <?php echo e($option['is_correct'] ? 'correct-answer' : ($option['is_wrong'] ? 'wrong-answer' : 'default')); ?>">
                                        <div class="review-option-content">
                                            <?php if($option['is_selected']): ?>
                                                <i class="fas fa-check-circle"
                                                    style="color: <?php echo e($questionData['is_correct'] ? '#28a745' : '#dc3545'); ?>;"></i>
                                            <?php endif; ?>
                                            <?php if($option['is_correct']): ?>
                                                <i class="fas fa-star" style="color: #28a745;"></i>
                                            <?php endif; ?>
                                            <span
                                                class="review-option-text <?php echo e($option['is_correct'] ? 'correct' : ($option['is_wrong'] ? 'wrong' : 'default')); ?>">
                                                <?php echo e($option['text']); ?>

                                            </span>
                                            <?php if($option['is_correct']): ?>
                                                <small class="review-option-label correct"><?php echo e(__('student.correct_answer_label')); ?></small>
                                            <?php endif; ?>
                                            <?php if($option['is_wrong']): ?>
                                                <small class="review-option-label wrong"><?php echo e(__('student.your_answer_label')); ?></small>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php /**PATH /Users/mahmudul/Codecanyone/edu_ex_full/Eduex_laravel/resources/views/student/course-access/partials/quiz-results.blade.php ENDPATH**/ ?>