ajoute les devoirs maison (chantier vrai cockpit, étape 3) : rendu en texte libre, suivi des rendus, notation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
bd74eaf20f
commit
33531de44d
17 changed files with 582 additions and 2 deletions
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Chantier « vrai cockpit », étape 3 : Devoirs maison. Rendu en texte libre
|
||||
* pour la version 1 (pas de dépôt de fichier : ça demande le stockage S3
|
||||
* prévu au bloc B, pas construit).
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('devoirs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('classe_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('titre');
|
||||
$table->text('consigne');
|
||||
$table->timestamp('echeance');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('devoirs');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Un seul rendu par élève et par devoir (contrainte unique) : un nouvel
|
||||
* envoi avant l'échéance remplace le précédent, il n'y a pas d'historique.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('rendus_devoirs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('devoir_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('eleve_id')->constrained()->cascadeOnDelete();
|
||||
$table->text('reponse');
|
||||
$table->unsignedTinyInteger('note')->nullable();
|
||||
$table->timestamp('rendu_a');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['devoir_id', 'eleve_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('rendus_devoirs');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue