@extends('layouts.student_dashboard') @section('title', 'Coding Performance Report') @section('content')
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

Your Coding Performance Report

{{ $course_name }} {{ $module_name }} {{ $topic_name }}
@csrf
@php // ===== Helpers ===== if (!function_exists('formatSeconds')) { function formatSeconds($seconds) { $seconds = (int) $seconds; if ($seconds < 60) { return round($seconds) . ' sec'; } elseif ($seconds < 3600) { $minutes = floor($seconds / 60); $remainingSeconds = $seconds % 60; return $minutes . ' min ' . round($remainingSeconds) . ' sec'; } else { $hours = floor($seconds / 3600); $minutes = floor(($seconds % 3600) / 60); return $hours . ' hr ' . $minutes . ' min'; } } } $total_allocated = (int) ($total_allocated ?? 0); $completed_count = (int) ($completed_count ?? 0); $total_time_seconds = (int) ($total_time_seconds ?? 0); $average_time = (float) ($average_time ?? 0); $progressPercentage = $total_allocated > 0 ? round(($completed_count / $total_allocated) * 100) : 0; $completionRate = $progressPercentage . '%'; $totalTimeFormatted = formatSeconds($total_time_seconds); $averageTimeFormatted = formatSeconds($average_time); if ($progressPercentage >= 80) { $progressLevel = 'Excellent'; $progressColor = '#10b981'; } elseif ($progressPercentage >= 50) { $progressLevel = 'Good'; $progressColor = '#f59e0b'; } else { $progressLevel = 'Need Practice'; $progressColor = '#ef4444'; } @endphp

{{ $total_allocated }}

Total Questions

{{ $completed_count }}

Completed

{{ $completionRate }} ({{ $progressLevel }})

{{ $averageTimeFormatted }}

Avg. Time

Per Question

{{ $totalTimeFormatted }}

Total Time

Spent on Coding

Question-wise Performance

@include('student.course.partials.codingreport_table')
@include('student.course.partials.codingreport_pagination')
@if($completed_count > 0)

Performance Tips

@if($progressPercentage >= 80)

Excellent Completion Rate!

You've completed {{ $progressPercentage }}% of coding questions. Great job!

@elseif($progressPercentage >= 50)

Good Progress

You've completed {{ $progressPercentage }}% of questions. Keep going!

@else

Need More Practice

You've completed {{ $progressPercentage }}% of questions. Try to complete more.

@endif @if($average_time > 0)

Time Management

Your average time per question is {{ $averageTimeFormatted }}.

@if($average_time > 300)

Consider practicing to solve problems faster.

@else

Good time management skills!

@endif
@endif @if($progressPercentage < 100)

Complete All Questions

You have {{ max(0, $total_allocated - $completed_count) }} questions remaining.

Continue Solving
@else

All Questions Completed!

Excellent! You've completed all {{ $total_allocated }} coding questions.

@endif
@endif
@endsection