{{ $course->title }}

{{ $course->modules->count() }} Modules {{ $course->duration }}
Progress {{ $progress }}%
@foreach($course->modules as $module)
{{ $module->title }}
@foreach($module->lessons as $lesson) @php $isActive = $currentLesson && $currentLesson->id === $lesson->id; $isCompleted = $this->isLessonCompleted($lesson->id); @endphp @endforeach
@endforeach
@if($currentLesson)
{{ ucfirst($currentLesson->type) }}

{{ $currentLesson->title }}

@if(!$this->isLessonCompleted($currentLesson->id)) Mark as Complete @else
Completed
@endif
@php // Prefer content_url_text if available (for external links), otherwise use content_url (uploaded file) $rawUrl = $currentLesson->content_url_text ?: $currentLesson->content_url; $contentUrl = $rawUrl; if ($contentUrl && !str_starts_with($contentUrl, 'http')) { $contentUrl = route('student.lesson.content', $currentLesson); } @endphp @if($currentLesson->type === 'video')
@if(str_contains($rawUrl, 'youtube.com') || str_contains($rawUrl, 'youtu.be')) @else @endif
@elseif($currentLesson->type === 'pdf') @elseif($currentLesson->type === 'text')
{!! $currentLesson->content_body !!}
@if($contentUrl)
@if(str_starts_with($rawUrl, 'http')) @else @endif

{{ str_starts_with($rawUrl, 'http') ? 'External Resource' : 'Download Material' }}

{{ str_starts_with($rawUrl, 'http') ? 'Click to visit the external link.' : 'Click to download the attached resource.' }}

{{ str_starts_with($rawUrl, 'http') ? 'Open Link' : 'Download' }}
@endif @else

Download Material

Click the button to download this resource.

Download
@endif @if($isCourseCompleted)

Course Completed!

You have successfully tested your skills in this module.

@if($course->exams->isNotEmpty())
@foreach($course->exams as $exam) @php $attempts = \App\Models\ExamAttempt::where('user_id', auth()->id()) ->where('exam_id', $exam->id) ->count(); $remaining = max(0, $exam->max_attempts - $attempts); @endphp
Take Final Certification Exam Remaining Attempts: {{ $remaining }} / {{ $exam->max_attempts }}
@endforeach
@endif
@endif
@else

Ready to start?

Select a lesson from the sidebar to begin.

@endif