@extends('student-panel.partials.master') @section('title') {{ ___('common.Online Exam Result View') }} @endsection @section('content')

{{ setting('application_name') }}

{{ setting('address') }}

@if (@$data['exam']->type)
{{___('online-examination.Exam Type')}} :
{{ @$data['exam']->type->name }}
@endif
{{___('online-examination.Exam Name')}} :
{{ @$data['exam']->name }}
@if (@$data['exam']->subject)
{{___('online-examination.Subject Name')}} :
{{ @$data['exam']->subject->name }}
{{___('online-examination.Subject Code')}} :
{{ @$data['exam']->subject->code }}
@endif
{{___('online-examination.Exam result sheet')}}
@php $answers = @$data['answer']->allAnswers->pluck('question_bank_id')->toArray(); @endphp
@foreach (@$data['exam']->examQuestions as $key=>$item)
{{ ++$key }}. {{ @$item->question->question }}
@if (in_array(@$item->question->id, $answers) && @$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->evaluation_mark != 0) @else @endif   {{ @$item->question->mark }}
@if (@$item->question->type == 1) @for($i = 0; $i < @$item->question->total_option; $i++)
{{++$i}}. {{@$item->question->questionOptions[--$i]->option}}
@endfor @if (in_array(@$item->question->id, $answers)) {{ ___('online-examination.Answer') }}: {{ @$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->answer }}. @endif @if (!in_array(@$item->question->id, $answers) || @$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->evaluation_mark == 0) {{ ___('online-examination.Correct Answer') }}: {{@$item->question->answer}}. @endif @elseif (@$item->question->type == 2) @for($i = 0; $i < @$item->question->total_option; $i++)
{{++$i}}. {{@$item->question->questionOptions[--$i]->option}}
@endfor @if (in_array(@$item->question->id, $answers)) {{ ___('online-examination.Answer') }}: @foreach (@$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->answer as $ans) {{$ans}}. @endforeach
@endif @if (!in_array(@$item->question->id, $answers) || @$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->evaluation_mark == 0) {{ ___('online-examination.Correct Answer') }}: @foreach (@$item->question->answer ?? [] as $ans) {{$ans}}. @endforeach @endif @elseif(@$item->question->type == 3)
{{ ___('online-examination.1') }}. {{ ___('online-examination.True') }}
{{ ___('online-examination.2') }}. {{ ___('online-examination.False') }}
@if (in_array(@$item->question->id, $answers)) {{ ___('online-examination.Answer') }}: @if ((int)@$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->answer == 1) {{ ___('online-examination.1') }} @else {{ ___('online-examination.2') }} @endif
@endif @if (!in_array(@$item->question->id, $answers) || @$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->evaluation_mark == 0) {{ ___('online-examination.Correct Answer') }}: {{@$item->question->answer}}. @endif @else @if (in_array(@$item->question->id, $answers)) {{ ___('online-examination.Answer') }}: {{ @$data['answer']->allAnswers->where('question_bank_id', @$item->question->id)->first()->answer}} @endif @endif @endforeach
@endsection @push('script') @endpush