@extends('admin.layouts.master') @section('title','Report') @section('maincontent') @component('components.breadcumb',['secondaryactive' => 'active']) @slot('heading') {{ __('Report') }} @endslot @slot('menu1') {{ __(' Quiz Report') }} @endslot @endcomponent
{{ __('All Quiz Report') }}
@foreach($quiz as $q) @php $course = App\Course::where('id',$q['course_id'])->first(); $user = App\User::where('email',$q['useremail'])->first(); $ans = App\QuizAnswer::where('topic_id',$q['topicid'])->where('user_id',$user->id)->get(); if(isset($course)){ if(Auth::user()->role == "instructor") { $check = $course->user_id == Auth::user()->id; } else{ $check = $ans; } } @endphp @if(isset($check)) @endif @endforeach
{{ __('User') }} {{ __('Email') }} {{ __('Quiz') }} {{ __('Marks Get') }} {{ __('Total Marks') }}
{{ $q['fname'] }} {{$q['lname']}} {{ $q['useremail'] }} {{ $q['topictitle'] }} @php $mark=0; $correct = collect(); foreach($ans as $answer){ if($answer->type != 1){ if($answer->user_answer == $answer->answer){ $mark++; } }else{ if($answer->txt_approved == 1){ $mark++; } } } $correct = $mark*$q['per_q_mark']; @endphp {{$correct}} {{ $q['quizquestion_count'] * $q['per_q_mark'] }}
@endsection