ESMT Berlin

{{ $survey->title }}

Survey Results Dashboard

@if (empty($grouped))
📊

No responses yet

Survey responses will appear here once students start participating.

@else

Session Overview

@foreach ($grouped as $label => $data) @php $totalResponses = count($data['rows']); $avgScore = 0; $questionCount = 0; foreach ($data['likertAverages'] as $avg) { if ($avg !== null) { $avgScore += $avg; $questionCount++; } } $avgScore = $questionCount > 0 ? $avgScore / $questionCount : 0; @endphp
{{ $label }}

Session {{ $label }}

{{ $totalResponses }} response{{ $totalResponses !== 1 ? 's' : '' }}

{{ number_format($avgScore, 1) }}
Avg
@endforeach

All Sessions Summary

@foreach ($questions as $idx => $q) @if (($q['type'] ?? 'likert') === 'likert') @php $allAverages = []; $allDistributions = []; foreach ($grouped as $label => $data) { $allAverages[$label] = $data['likertAverages'][$idx] ?? null; $allDistributions[$label] = $data['likertDistributions'][$idx] ?? []; } $chartId = 'overview_chart_' . $idx; @endphp

{{ $q['text'] }}

@endif @endforeach
@endif