@php use Illuminate\Support\Carbon;use Modules\BunnyStorage\Http\Controllers\BunnyStreamController; @endphp
@extends(theme('layouts.full_screen_master'))
@section('title')
{{Settings('site_title') ? Settings('site_title') : 'Infix LMS'}} | {{ $course->title}}
@endsection
@section('css')
{{-- --}}
@if(isModuleActive("WhatsappSupport"))
@endif
@endsection
@section('mainContent')
@php
$video_lesson_hosts=['Iframe','Image','PDF','Word','Excel','PowerPoint','Text','Zip','GoogleDrive','H5P','Editor','VdoCipher'];
@endphp
@push('js')
@endpush
@php
if ($lesson->lessonQuiz->random_question==1){
$questions =$lesson->lessonQuiz->assignRand;
}else{
$questions =$lesson->lessonQuiz->assign;
}
@endphp
@if ($lesson->is_quiz == 1)
@if (count($result) != 0)
@if (!isset($_GET['done']))
{{--
{{ __('student.Congratulations! You’ve completed') }} {{ $course->quiz->title }}
--}}
@if ($result['publish'] == 1)
@if ($result['status'] != 'Failed')
{{__('student.Congratulations!')}}
@else
{{__('frontend.You have failed')}}. {{__('frontend.Wishing you luck the next time')}}
@endif
{{__('frontend.You have completed')}} {{$lesson->lessonQuiz->title}}
{{--
{{ __('student.Exam Score') }}:
--}}
{{__('student.Exam Score')}}: {{ $result['score'] }}
Out of {{ $result['totalScore'] }}
{{__('frontend.Result')}}:
@if ($result['status'] != 'Failed')
{{ __('frontend.Passed') }}
@else
{{ __('frontend.Failed') }}
@endif
@else
{{ __('quiz.Please wait till completion marking process') }}
@endif
@if (count($preResult) != 0)
| {{ __('common.Date') }} |
{{ __('quiz.Marks') }} |
{{ __('quiz.Percentage') }} |
{{ __('common.Rating') }} |
{{__('quiz.Feedback')}} |
{{ __('common.Details') }} |
@foreach ($preResult as $pre)
| {{ $pre['date'] }} |
{{ $pre['score'] }}/{{ $pre['totalScore'] }} |
{{ $pre['mark'] }}% |
@if ($pre['status'] != 'Failed')
{{ __('frontend.Passed') }}
@else
{{ __('frontend.Failed') }}
@endif
|
{{$pre['feedback']??trans('common.N/A')}} |
{{ __('student.See Answer Sheet') }}
|
@endforeach
@endif
@if ($lesson->lessonQuiz->show_ans_with_explanation == 1)
@endif
@else
{{ __('student.Congratulations! You’ve completed') }}
{{ $lesson->lessonQuiz->title }}
@endif
@else
@if ($alreadyJoin != 0 && $lesson->lessonQuiz->multiple_attend == 0)
@else
@endif
@include(theme('partials._quiz_submit_confirm_modal'))
@include(theme('partials._quiz_start_confirm_modal'))
@endif
@elseif($lesson->is_assignment == 1)
@if (isModuleActive('Assignment'))
@php
$assignment_info = $lesson->assignmentInfo;
if (Auth::check()) {
$submit_info = Modules\Assignment\Entities\InfixSubmitAssignment::assignmentLastSubmitted($assignment_info->id, Auth::user()->id);
if (Auth::user()->role_id == 1) {
$sty = '-150px';
} else {
if ($submit_info != null) {
$sty = '50px';
} else {
$sty = '280px';
}
}
} else {
$submit_info = null;
if ($submit_info != null) {
$sty = '50px';
} else {
$sty = '280px';
}
}
@endphp
{{ __('assignment.Assignment') }} {{ __('common.Details') }}
|
{{ __('common.Title') }}
|
: {{ @$assignment_info->title }}
|
{{ __('courses.Course') }}
|
@if ($assignment_info->course->title)
: {{ @$assignment_info->course->title }}
@else
: {{ __('frontend.Not Assigned') }}
@endif
|
|
{{ __('assignment.Marks') }}
|
: {{ @$assignment_info->marks }}
|
{{ __('assignment.Min Percentage') }}
|
: {{ @$assignment_info->min_parcentage }}%
|
@if ($submit_info != null)
|
{{ __('assignment.Obtain Marks') }}
|
: {{ @$submit_info->marks }}
|
{{ __('common.Status') }}
|
:
@if ($submit_info->assigned->pass_status == 1)
{{ __('frontend.Pass') }}
@elseif($submit_info->assigned->pass_status == 2)
{{ __('frontend.Fail') }}
@else
{{ __('frontend.Not Marked') }}
@endif
|
@endif
|
{{ __('assignment.Submit Date') }}
|
: {{ showDate(@$assignment_info->last_date_submission) }}
|
{{ __('assignment.Attachment') }}
|
@if (fileExists($assignment_info->attachment))
: {{ __('common.Download') }}
@endif
|
{{ __('assignment.Description') }}
{!! @$assignment_info->description !!}
@php
$todate = today()->format('Y-m-d');
@endphp
@if (empty($submit_info))
@if (isset($assignment_info->last_date_submission) && Auth::user()->role_id == 3)
@if (
$todate <= $assignment_info->last_date_submission ||
(isset($submit_info) && $submit_info->assigned->pass_status == 0))
@include(theme('partials._assignment_submit_section'))
@endif
@else
@if (isset($submit_info) && $submit_info->assigned->pass_status == 0 && Auth::user()->role_id == 3)
@include(theme('partials._assignment_submit_section'))
@endif
@endif
@endif
@endif
@else
@push('js')
@endpush
@if ($lesson->host == 'Vimeo')
@php
if (Str::contains($lesson->video_url, '&')) {
$video_id = explode('=', $lesson->video_url);
$video_id = youtubeVideo($video_id[1]);
} else {
$video_id = getVideoId(showPicName(@$lesson->video_url));
}
@endphp
@endif
@if ($lesson->host == 'VdoCipher')
@endif
@if (isModuleActive('BunnyStorage') && $lesson->host == 'BunnyStorage')
@php
$time = Carbon::now()
->addDay(1)
->unix();
if ($lesson->bunnyLesson && $lesson->bunnyLesson->service_type == 'stream') {
$url = 'https://iframe.mediadelivery.net/embed/' . $lesson->bunnyLesson->library_id . '/' . $lesson->bunnyLesson->video_id;
$sha256 = hash('sha256', $lesson->bunnyLesson->token_authentication_key . $lesson->bunnyLesson->video_id . $time);
$url .= '?token=' . $sha256 . '&expires=' . $time . '&autoplay=true&preload=true';
$lesson_src = $url;
} elseif ($lesson->bunnyLesson && $lesson->bunnyLesson->service_type == 'storage') {
$bunnyStreamController = new BunnyStreamController();
$path = 'https://' . $lesson->bunnyLesson->zone_name . '.b-cdn.net/' . $lesson->bunnyLesson->name;
$url = $bunnyStreamController->sign_bcdn_url($path, $lesson->bunnyLesson->token_authentication_key, $time);
$lesson_src = $url;
} else {
$lesson_src = $lesson->video_url;
}
@endphp
@endif
@if ($lesson->host == 'Self' || $lesson->host == 'Storage')
@endif
@if ($lesson->host == 'Editor')
{!! $lesson->editor !!}
@endif
@if ($lesson->host == 'm3u8')
@endif
@if ($lesson->host == 'URL')
@endif
@if ($lesson->host == 'AmazonS3')
@endif
@if ($lesson->host == 'H5P' && isModuleActive('H5P'))
@include('h5p::player', ['course' => $course, 'lesson' => $lesson])
@endif
@if ($lesson->host == 'XAPI' || $lesson->host == 'XAPI-AwsS3')
@endif
@if ($lesson->host == 'SCORM' || $lesson->host == 'SCORM-AwsS3')
@if (!empty($lesson->video_url))
@endif
@endif
@if ($lesson->host == 'Iframe' || $lesson->host =='Youtube')
@if (!empty($lesson->video_url))
@php
$embedUrl = $lesson->video_url;
// Convert YouTube watch URL to embed URL
if ($lesson->host == 'Youtube') {
// Handle youtube.com/watch?v=VIDEO_ID format
if (preg_match('/youtube\.com\/watch\?v=([a-zA-Z0-9_-]+)/', $embedUrl, $matches)) {
$embedUrl = 'https://www.youtube.com/embed/' . $matches[1];
}
// Handle youtu.be/VIDEO_ID format
elseif (preg_match('/youtu\.be\/([a-zA-Z0-9_-]+)/', $embedUrl, $matches)) {
$embedUrl = 'https://www.youtube.com/embed/' . $matches[1];
}
// Handle youtube.com/embed/VIDEO_ID format (already correct)
elseif (!str_contains($embedUrl, 'youtube.com/embed/')) {
// If it's just a video ID
$embedUrl = 'https://www.youtube.com/embed/' . $embedUrl;
}
}
@endphp
@endif
@endif
@if ($lesson->host == 'Image')
 }})
@endif
@if ($lesson->host == 'PDF')
@endif
@if ($lesson->host == 'Word')
@endif
@if ($lesson->host == 'Excel' || $lesson->host == 'PowerPoint')
@endif
@if ($lesson->host == 'GoogleDrive')
@if(!empty($secureGoogleDrivePreviewUrl))
@else
{{ __('common.Something Went Wrong') }}
@endif
@endif
@if ($lesson->host == 'Text')
@endif
{{-- Iframe video --}}
{{-- @push('js')--}}
{{-- @if ($lesson->host == 'Iframe')--}}
{{-- --}}
{{-- @endif--}}
{{-- @endpush--}}
@if ($lesson->host == 'Zip')
@endif
@endif
{{--
--}}