@extends('front_end.layouts.home') @php $showLeftSidebar = false; $showRightSidebar = false; @endphp @section('title', $course->title . ' - Learning') @section('content')
{{ $course->title }}
{{ $enrollment->getProgressPercentage() }}%
@foreach($course->sections as $section)

@endforeach

{{ $currentLesson->title }}

@if(isset($lessonProgress[$currentLesson->id]) && $lessonProgress[$currentLesson->id]->is_completed) @else @endif
@if($currentLesson->video_url)
@endif
{!! nl2br(e($currentLesson->content)) !!}
@if($currentLesson->attachment)
Downloadable Resources
Download Attachment
@endif
@php $prevLesson = null; $nextLesson = null; $foundCurrent = false; $lessonIndex = 0; foreach($course->sections as $section) { foreach($section->lessons as $lesson) { if($foundCurrent) { $nextLesson = $lesson; break 2; } if($lesson->id == $currentLesson->id) { $foundCurrent = true; } else { $prevLesson = $lesson; } $lessonIndex++; } if($foundCurrent && $nextLesson) { break; } } @endphp @if($prevLesson) Previous Lesson @else
@endif @if($nextLesson) Next Lesson @else @endif

Course Overview

{!! nl2br(e($course->description)) !!}
@if($course->what_you_will_learn)
What You'll Learn
@foreach(explode("\n", $course->what_you_will_learn) as $point) @if(trim($point))
{{ trim($point) }}
@endif @endforeach
@endif
Your Progress
Completed: {{ $enrollment->getCompletedLessonsCount() }} / {{ $course->sections->flatMap->lessons->count() }} lessons
{{ $enrollment->getProgressPercentage() }}% complete

Questions & Answers

@if($questions->count() > 0) @foreach($questions as $question)
{{ $question->user->name }}
{{ $question->user->name }}
{{ $question->created_at->diffForHumans() }}
{{ $question->is_resolved ? 'Resolved' : 'Open' }}
{{ Str::limit(strip_tags($question->question), 100) }}

{{ $question->question }}

@if($question->answers->count() > 0)
@foreach($question->answers as $answer)
{{ $answer->user->name }}
{{ $answer->user->name }}
{{ $answer->created_at->diffForHumans() }}
@if($answer->is_best_answer)
Best Answer
@elseif($question->user_id == Auth::id())
@csrf
@endif
{{ $answer->answer }}
@endforeach
@endif
@endforeach @else
No Questions Yet

Be the first to ask a question about this course

@endif

Course Announcements

@if($course->announcements->count() > 0) @foreach($course->announcements as $announcement)
{{ $announcement->title }}
{{ $announcement->created_at->format('M d, Y') }}
{!! nl2br(e($announcement->content)) !!}
@endforeach @else
No Announcements

There are no announcements for this course yet.

@endif
@push('scripts') @endpush @endsection