feat: módulo de evaluaciones para admin con constructor dinámico
- Modelos completos: Evaluacion, EvaluacionTipo, Pregunta, PreguntaTipo,
PreguntaOpcion, EvaluacionSubmission, Respuesta (con $table explícito
para nombres en español que Laravel pluraliza incorrectamente)
- Relaciones evaluaciones() añadidas a Plantel y Nivel
- EvaluacionBuilder (Livewire): constructor interactivo con preguntas
de tipo texto libre, opción múltiple, escala 1-5/1-10 y sí/no;
reorden con flechas, vista previa por tipo, selección de planteles
y niveles, configuración de estado, fechas y flag de anónima
- EvaluacionController: CRUD completo + toggleStatus
- Vistas: index, create/edit (con Livewire builder), show con detalle
de preguntas y cambio de estado
- Rutas resource /evaluacion + PATCH /evaluacion/{id}/status
- Migraciones: evaluaciones, preguntas, pregunta_opciones,
evaluacion_submissions, respuestas, evaluacion_plantel, evaluacion_nivel
- Menú: enlace Evaluaciones en panel de Administrador
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
public function up(): void {
|
||||
Schema::create('preguntas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('evaluacion_id');
|
||||
$table->unsignedBigInteger('pregunta_tipo_id');
|
||||
$table->text('texto');
|
||||
$table->unsignedSmallInteger('orden')->default(0);
|
||||
$table->boolean('requerida')->default(true);
|
||||
$table->timestamps();
|
||||
$table->foreign('evaluacion_id')->references('id')->on('evaluaciones')->onDelete('cascade');
|
||||
$table->foreign('pregunta_tipo_id')->references('id')->on('pregunta_tipos');
|
||||
});
|
||||
}
|
||||
public function down(): void { Schema::dropIfExists('preguntas'); }
|
||||
};
|
||||
Reference in New Issue
Block a user