@extends('layouts.admin') @section('title', 'Survey Response Report') @section('page-title', 'Survey Report') @section('content')
Back to Surveys
Survey Details
Title {{ $survey->title }}
Description

{{ $survey->description ?: 'No description provided.' }}

Target Scope {{ $survey->target_type }}
RESPONSES

{{ $respondentsCount }}

PARTICIPATION

{{ $participationRate }}%

@foreach($questionsReport as $idx => $report)
Question #{{ $idx + 1 }}
{{ $report['question']->question_text }}
{{ $report['question']->type }}
@if($report['question']->type == 'MCQ')
@foreach($report['breakdown'] as $option => $votes) @php $pct = $report['total_responses'] > 0 ? round(($votes / $report['total_responses']) * 100) : 0; @endphp @endforeach
Choice Option Votes Pct %
{{ $option }} {{ $votes }} {{ $pct }}%
@elseif($report['question']->type == 'Rating')

{{ $report['average_rating'] }}

Average Rating
@for($s = 1; $s <= 5; $s++) @endfor
Based on {{ $report['total_responses'] }} responses
@for($r = 5; $r >= 1; $r--) @php $votes = $report['breakdown'][$r] ?? 0; $pct = $report['total_responses'] > 0 ? round(($votes / $report['total_responses']) * 100) : 0; @endphp
{{ $r }} Star
{{ $votes }}
@endfor
@else
    @forelse($report['breakdown'] as $textAns)
  • {{ $textAns }}
  • @empty
  • No text responses submitted yet.
  • @endforelse
@endif
@endforeach
@endsection @section('scripts') @endsection