{{--

{{__('student.Result Sheet')}}

--}}
@php $count=1; @endphp @if(isset($questions)) @foreach($questions as $question) @php if ($quiz->show_only_wrong_ans_in_ans_sheet==1 && !$question['isWrong'] && $quiz->total_correct_ans!=count($questions) ){ continue; } @endphp @php if(isset($question['isSubmit'])){ if(isset($question['isWrong']) && $question['isWrong']){ $isWrongQus= true; }else{ $isWrongQus =false; } }else{ $isWrongQus =true; } @endphp
{{__('frontend.Question')}} : {{$count}}

@if($question['type']=="C") {!! getClozeOptions($question['qusBank'],$question['option']) !!} @else {!! @$question['qus'] !!} @endif @if(!$question['isSubmit']) ({{trans('quiz.Not Submitted')}} ) @endif

@if(!empty($question['qusBank']->explanation))

{{__('quiz.Explanation')}}: {!! $question['qusBank']->explanation !!}

@endif
@if($question['type']=="M")
    @if(!empty($question['option'])) @foreach($question['option'] as $option) @php $showRightAns =true; if ($quiz->show_correct_ans_in_ans_sheet!=1){ if(isset($option['submit']) && $option['submit']){ $showRightAns=true; }else{ $showRightAns=false; } } @endphp @if($option['right'] && $showRightAns)
  • @else @if(isset($option['wrong']) && $option['wrong'])
  • @else
  • @endif @endif @endforeach @endif
@elseif($question['type']=="X") @if(isset($question['qusBank'])) @php $qusBank= $question['qusBank'] @endphp @include(theme('partials._quiz_matching_type_preview'),compact('qusBank')) @endif @elseif($question['type']=="O")
    @if(!empty($question['option'])) @foreach($question['option'] as $option) @php $showRightAns =true; if ($quiz->show_correct_ans_in_ans_sheet!=1){ if(isset($option['submit']) && $option['submit']){ $showRightAns=true; }else{ $showRightAns=false; } } @endphp @if($option['right'] && $showRightAns)
  • @else @if(isset($option['wrong']) && $option['wrong'])
  • @else
  • @endif @endif @endforeach @endif
@elseif($question['type']=="P")
    @if(!empty($question['option'])) @foreach($question['option'] as $option)
    • @php $qusBank= $question['qusBank']; $matching_assigns =$question['matching']??[]; @endphp @foreach($question['answer'] as $answer) @php $has_answer = $matching_assigns ->where('question_id',$qusBank->id) ->where('option_id',$option['id']??'') ->where('answer_id',$answer['id']??'') ->count(); @endphp @if($has_answer>0)
    • {{$answer['title']}}
    • @endif @endforeach
    {{-- @endif--}}
  • @endforeach @endif
@elseif($question['type']=="S" || $question['type']=="L") {!! $question['answer']??"" !!} @endif
@php $count++; @endphp @endforeach @endif
@php $totalQuestions = count($questions ?? []); $correctAnswers = (int) ($quiz->total_correct_ans ?? 0); $notSubmittedAnswers = collect($questions ?? [])->where('isSubmit', false)->count(); $wrongAnswers = max($totalQuestions - $correctAnswers - $notSubmittedAnswers, 0); $obtainedScore = (float) ($quizTest->details->where('status', 1)->sum('mark') ?? 0); $totalScore = (float) totalQuizMarks($quiz->id); $achievedPercentage = $totalScore > 0 ? round(($obtainedScore * 100) / $totalScore, 2) : 0; $feedbackText = trim((string) ($quizTest->feedback ?? '')); @endphp

{{__('quiz.Result Summary')}}

{{__('quiz.Total Questions')}} : {{ $totalQuestions }}
{{__('quiz.Correct Answers')}} : {{ $correctAnswers }}
{{__('quiz.Wrong Answers')}} : {{ $wrongAnswers }}
{{__('quiz.Not Submitted')}} : {{ $notSubmittedAnswers }}
{{__('quiz.Score')}} : {{ $obtainedScore }}/{{ $totalScore }}
{{__('quiz.Percentage')}} : {{ $achievedPercentage }}%
@if($feedbackText !== '')
{{__('quiz.Feedback')}} : {{ $feedbackText }}
@endif