41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
|
||
|
|
return new class extends Migration
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Run the migrations.
|
||
|
|
*/
|
||
|
|
public function up()
|
||
|
|
{
|
||
|
|
Schema::create('exams', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
$table->string('title');
|
||
|
|
$table->text('description')->nullable();
|
||
|
|
|
||
|
|
// Mengakomodasi 3 jenis training sesuai permintaan Anda
|
||
|
|
$table->enum('training_type', ['matrix_plant', 'product', 'external']);
|
||
|
|
|
||
|
|
// Relasi ke Materi/Subject (Satu ujian bisa mewakili satu materi SOP)
|
||
|
|
$table->foreignId('subject_id')->constrained()->onDelete('cascade');
|
||
|
|
|
||
|
|
// Aturan CBT
|
||
|
|
$table->integer('duration_minutes')->default(60); // Durasi ujian
|
||
|
|
$table->integer('passing_grade')->default(80); // Nilai standar kelulusan
|
||
|
|
$table->integer('max_retakes')->default(1); // Kesempatan remedial (1 = bisa remedial 1x)
|
||
|
|
$table->boolean('is_random_order')->default(true); // Opsi acak soal antar peserta
|
||
|
|
$table->boolean('is_active')->default(true);
|
||
|
|
|
||
|
|
$table->timestamps();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down()
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('exams');
|
||
|
|
}
|
||
|
|
};
|