@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
@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() }}