{{-- ENCABEZADO --}}

{{ $evaluacion->titulo }}

Tipo: {{ $evaluacion->tipo?->nombre }}  |  Estado: {{ ucfirst($evaluacion->status) }}  |  Participantes: {{ $totalSubmissions }}  |  Generado: {{ now()->format('d/m/Y H:i') }} @if($evaluacion->fecha_inicio || $evaluacion->fecha_fin)  |  Vigencia: {{ $evaluacion->fecha_inicio?->format('d/m/Y') ?? '—' }} al {{ $evaluacion->fecha_fin?->format('d/m/Y') ?? '—' }} @endif
@if($evaluacion->descripcion)
{{ $evaluacion->descripcion }}
@endif
{{-- RESUMEN --}}
Participantes {{ $totalSubmissions }} Preguntas {{ count($datos) }} Estado {{ ucfirst($evaluacion->status) }} Tipo {{ $evaluacion->tipo?->nombre }}
@if($totalSubmissions === 0)

Esta evaluación aún no tiene respuestas registradas.

@endif {{-- PREGUNTAS --}} @foreach($datos as $i => $item) @php $pregunta = $item['pregunta']; @endphp
{{ $i + 1 }}. {{ $pregunta->texto }} @if($pregunta->es_docente)  Por docente @endif {{ $pregunta->tipo?->nombre }}
{{-- Texto libre --}} @if($item['tipo'] === 'texto_libre') @if(!$item['es_docente']) @forelse($item['textos'] as $txt)
{{ $txt }}
@empty

Sin respuestas registradas.

@endforelse @else @foreach($item['por_docente'] as $pd)
{{ $pd['docente_nombre'] }} — {{ $pd['total'] }} respuesta(s)
@forelse($pd['textos'] as $txt)
{{ $txt }}
@empty

Sin respuestas.

@endforelse
@endforeach @endif {{-- Gráfica única --}} @elseif(!$item['es_docente']) @if($item['total'] > 0)
@if(isset($item['chart_img'])) Gráfica @else
Gráfica no disponible
@endif
Respuestas
{{ $item['total'] }}
@if(isset($item['promedio']))
Promedio
{{ $item['promedio'] }}
/ {{ str_contains($item['tipo'], '10') ? '10' : '5' }}
@endif
@else

Sin respuestas registradas.

@endif {{-- Gráficas por docente (tabla 2 columnas) --}} @else @if(empty($item['por_docente']))

Sin respuestas registradas.

@else @php $chunks = array_chunk($item['por_docente'], 2); @endphp @foreach($chunks as $pair) @foreach($pair as $pd) @endforeach @if(count($pair) === 1) @endif
{{ $pd['docente_nombre'] }} @if(isset($pd['promedio']))  ·  Prom: {{ $pd['promedio'] }} @endif
@if($pd['total'] > 0) @if(isset($pd['chart_img'])) Gráfica @else
Gráfica no disponible
@endif

{{ $pd['total'] }} respuesta(s)

@else

Sin respuestas.

@endif
@endforeach @endif @endif
@endforeach