@if(count($reportData) > 0) @foreach($reportData as $index => $data) @php $percentage = $data['percentage']; $progressLevel = $data['progress_level']; $status = $data['completed'] == 0 ? 'not-attempted' : ($data['completed'] < $data['total'] ? 'partial' : 'completed'); // Time formatting $avgTimeFormatted = ''; if ($data['avg_time_per_question'] > 0) { $minutes = floor($data['avg_time_per_question'] / 60); $seconds = $data['avg_time_per_question'] % 60; $avgTimeFormatted = "{$minutes}m {$seconds}s"; } // Total time formatting $totalTimeFormatted = ''; if ($data['total_time_seconds'] > 0) { $totalHours = floor($data['total_time_seconds'] / 3600); $totalMinutes = floor(($data['total_time_seconds'] % 3600) / 60); $totalSeconds = $data['total_time_seconds'] % 60; if ($totalHours > 0) { $totalTimeFormatted = "{$totalHours}h {$totalMinutes}m"; } else { $totalTimeFormatted = "{$totalMinutes}m {$totalSeconds}s"; } } // Determine rank badge $rank = $data['rank']; $showRankBadge = $rank <= 3 && $data['completed'] > 0; $rankColors = [ 1 => ['bg' => '#fbbf24', 'text' => '#92400e', 'icon' => 'fas fa-trophy', 'label' => '1st'], 2 => ['bg' => '#d1d5db', 'text' => '#374151', 'icon' => 'fas fa-medal', 'label' => '2nd'], 3 => ['bg' => '#b45309', 'text' => '#fef3c7', 'icon' => 'fas fa-award', 'label' => '3rd'] ]; @endphp
{{ isset($search) && $search ? 'No students match your search criteria.' : 'No student data found for this topic.' }}