@php $quiz = App\Models\Lesson::where('id', request()->route()->parameter('id')) ->firstOrNew(); $questions = DB::table('questions') ->where('quiz_id', $quiz->id) ->get(); $submits = DB::table('quiz_submissions') ->where('quiz_id', $quiz->id) ->where('user_id', auth()->user()->id) ->get(); @endphp

{{ $quiz->title }}

{{ get_phrase('Time left : ') }}

{!! $quiz->description !!}

@php $duration = explode(':', $quiz->duration); @endphp {{ get_phrase('Duration') }} : {{ $duration[0] ?? '0' }} {{ get_phrase('Hour') }} {{ $duration[1] ?? '0' }} {{ get_phrase('Minute') }} {{ $duration[2] ?? '0' }} {{ get_phrase('Second') }}

{{ get_phrase('Total Marks') }} : {{ $quiz->total_mark < 10 ? '0' : '' }}{{ $quiz->total_mark }}

{{ get_phrase('Pass Marks') }} : {{ $quiz->pass_mark < 10 ? '0' : '' }}{{ $quiz->pass_mark }}

{{ get_phrase('Retake') }} : {{ $quiz->retake < 10 ? '0' : '' }}{{ $quiz->retake }}

{{ get_phrase('Question Type') }} : {{ str_replace('_', ' ', implode(', ', $questions->pluck('type')->unique()->toArray())) }}

{{ get_phrase('Attempts') }} : {{ $submits->count() < 10 ? '0' : '' }}{{ $submits->count() }}

{{ get_phrase('Total Question') }} : {{ $questions->count() < 10 ? '0' : '' }}{{ $questions->count() }}

@foreach ($submits as $key => $submit) @endforeach @if ($submits->count() < $quiz->retake) @endif