@php $defaultOpciones = $pregunta->opciones->map(fn ($o) => [ 'contenido' => $o->contenido, 'porcentaje' => $o->porcentajeParaSelector(), ])->values()->all(); if (count($defaultOpciones) < 2) { $defaultOpciones = [ ['contenido' => '', 'porcentaje' => '100'], ['contenido' => '', 'porcentaje' => '0'], ]; } $opcionesOld = old('opciones', $defaultOpciones); $respuestaVf = old('respuesta_vf', optional($pregunta->opciones->firstWhere('es_correcta', true))->contenido === 'Falso' ? 'falso' : 'verdadero'); $porcentajeCorrectaVf = old('porcentaje_correcta_vf', (string) (0 + (float) optional($pregunta->opciones->firstWhere('es_correcta', true))->porcentaje ?? 100)); $porcentajeIncorrectaVf = old('porcentaje_incorrecta_vf', (string) (0 + (float) optional($pregunta->opciones->firstWhere('es_correcta', false))->porcentaje ?? 0)); @endphp
@csrf @method('PUT') @include('preguntas._configuracion_curricular') @if($pregunta->tipo === 'seleccion_unica')
@endif @if($cuestionario->esSaber() && $pregunta->tipo !== 'descripcion')
@endif
@if($pregunta->tipo === 'likert')

Los enunciados de la matriz se editan en la sección inferior.

@endif
@if($pregunta->tipo !== 'descripcion')
@endif @if(in_array($pregunta->tipo, ['seleccion_unica', 'seleccion_multiple'])) @include('preguntas._opciones_porcentaje', [ 'opcionesOld' => $opcionesOld, 'unica' => $pregunta->tipo === 'seleccion_unica', 'porcentajes' => $porcentajes, ]) @endif @if($pregunta->tipo === 'likert') @include('preguntas._likert_criterios', [ 'plantillasLikert' => $plantillasLikert, 'porcentajes' => $porcentajes, 'criteriosIniciales' => $opcionesOld, 'enunciadosIniciales' => $pregunta->likertItems->map(fn ($item) => [ 'id' => $item->id, 'contenido' => $item->contenido, ])->values()->all() ?: [['contenido' => ''], ['contenido' => '']], ]) @endif @if($pregunta->tipo === 'verdadero_falso')
@endif
Actualizar pregunta Cancelar
@push('scripts') @endpush