@extends('frontend.layouts.app') @php $status = \Illuminate\Support\Facades\Cookie::get('Rstatus'); $cookie = \Illuminate\Support\Facades\Cookie::get('RuserSelectedanswers'); $userSelectedAnswers = json_decode($cookie, true); $username = Auth::user()->name; $totalQuestions = count($questions); $correctCount = 0; $incorrectCount = 0; foreach ($questions as $question) { $selectedAnswer = $userSelectedAnswers[$question->id] ?? null; $correctAnswer = $question->answer->where('is_correct', '1')->first(); if ($selectedAnswer && $correctAnswer && $selectedAnswer == $correctAnswer->id) { $correctCount++; } elseif ($selectedAnswer) { $incorrectCount++; } } @endphp @push('css') @endpush @section('content')
{{-- progress bar start --}}

Final Score

{{ number_format(($correctCount / $totalQuestions) * 100, 2) }}%


{{ $correctCount }} {{ $totalQuestions }}
{{-- progress bar End --}} {{-- fileter part start --}}

FILTER QUESTIONS


MARKED
{{-- fileter part End --}}
Revision History

Date Completed: {{date('d-m-y')}}

@endsection @push('js') @endpush