@if (session('success'))
UMA Logo

¡Gracias por participar!

Tu respuesta ha sido registrada correctamente.

@else @if (session('error_obligatorias'))
⚠️ Faltan preguntas obligatorias por responder:
@foreach (session('preguntas_faltantes') as $numero) {{ $numero }} @endforeach
@endif

{{ $encuesta->titulo }}

{{ $encuesta->descripcion }}

@csrf @foreach ($encuesta->preguntas as $index => $pregunta)

{{ $index + 1 }}. {{ mb_strtoupper($pregunta->texto, 'UTF-8') }} {{ $pregunta->obligatoria ? 'Obligatoria' : 'No es obligatoria' }}

{{-- OPCIÓN MÚLTIPLE --}} @if($pregunta->tipo_pregunta === 'opcion_multiple')
@foreach ($pregunta->opciones as $opcion) @if(strtolower(trim($opcion->texto)) !== 'otra') @endif @endforeach @if ($pregunta->permite_otra || $pregunta->opciones->contains(fn($op) => strtolower(trim($op->texto)) === 'otra')) @endif
@endif {{-- RESPUESTA ABIERTA --}} @if($pregunta->tipo_pregunta === 'abierta')
@endif {{-- PREGUNTA UMA --}} @if($pregunta->tipo_pregunta === 'uma')

Datos encontrados:

@foreach ($pregunta->opciones as $campo) @php $campoNombre = strtolower(trim($campo->texto)); @endphp
@endforeach
@endif {{-- RESPUESTA GEOGRÁFICA --}} @if($pregunta->tipo_pregunta === 'geografica')
@endif {{-- ESCALA DE LIKERT --}} @if($pregunta->tipo_pregunta === 'likert' && $pregunta->items) @php $escala = ['Muy malo', 'Malo', 'Regular', 'Bueno', 'Excelente']; $items = json_decode($pregunta->items, true); @endphp @foreach ($escala as $nivel) @endforeach @foreach ($items as $i => $item) @foreach ($escala as $nivel) @endforeach @endforeach
{{ $nivel }}
{{ $item }} obligatoria ? '' : '' }}>
@endif
@endforeach
@endif