{{$user->name}}

{{$user->name}} ANSWER REPORT

Quiz: {{$topic->title}}

@php $questions = App\Question::where('topic_id', $topic->id)->get(); $count_questions = $questions->count(); $x = $count_questions; $y = 1; @endphp @foreach($answers as $key=> $a) @if($a->user_answer != "0" && $topic->id == $a->topic_id) @php $y++; if($y > $x){ break; } @endphp @endif @endforeach
Question Correct Answer {{$user->name}} Answer Answer Explnation
{{ $a->question->question }} {{ $a->answer }} {{ $a->user_answer }} {{ $a->question->answer_exp }}
Total Questions {{$user->name}}'s Marks Per Question Mark Total Marks
{{$count_questions}} @php $mark = 0; $correct = collect(); @endphp @foreach ($answers as $answer) @if ($answer->answer == $answer->user_answer) @php $mark++; @endphp @endif @endforeach @php $correct = $mark*$topic->per_q_mark; @endphp {{$correct}} {{$topic->per_q_mark}} {{$topic->per_q_mark*$count_questions}}