{{ __('Question Book') }}

{{ __('Course: ') }} {{ $course->title }}

@php // Check if there are any subjective questions $hasSubjectiveQuestions = $questions->where('type', 'subjective')->isNotEmpty(); // Check if there are any objective questions $hasObjectiveQuestions = $questions->where('type', 'objective')->isNotEmpty(); @endphp @if($hasSubjectiveQuestions)

{{ __('Subjective Questions') }}

@foreach($questions->where('type', 'subjective')->values() as $index => $question) @endforeach
# {{ __('Question') }} {{ __('Answer') }}
{{ $index + 1 }} {{ $question->question }} {!! $question->answer !!}
@endif @if($hasObjectiveQuestions)

{{ __('Objective Questions') }}

@foreach($questions->where('type', 'objective')->values() as $index => $question) @endforeach
# {{ __('Question') }} {{ __('Options') }} {{ __('Correct Option') }}
{{ $index + 1 }} {{ $question->question }}
    @if($question->option_one)
  • {{ __('Option A: ') }} {{ $question->option_one }}
  • @endif @if($question->option_two)
  • {{ __('Option B: ') }} {{ $question->option_two }}
  • @endif @if($question->option_three)
  • {{ __('Option C: ') }} {{ $question->option_three }}
  • @endif @if($question->option_four)
  • {{ __('Option D: ') }} {{ $question->option_four }}
  • @endif
{{ $question->correct_option }}
@endif