2026-05-30 22:15:16 +07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2026-06-05 13:39:13 +07:00
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
2026-05-30 22:15:16 +07:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Exam extends Model
|
|
|
|
|
{
|
2026-06-05 13:39:13 +07:00
|
|
|
use HasFactory;
|
|
|
|
|
|
2026-05-30 22:15:16 +07:00
|
|
|
protected $fillable = [
|
|
|
|
|
'title',
|
2026-06-05 13:39:13 +07:00
|
|
|
'description',
|
|
|
|
|
'training_type',
|
|
|
|
|
'subject_id',
|
|
|
|
|
'duration_minutes',
|
|
|
|
|
'passing_grade',
|
|
|
|
|
'max_retakes',
|
|
|
|
|
'is_random_order',
|
|
|
|
|
'is_active'
|
2026-05-30 22:15:16 +07:00
|
|
|
];
|
|
|
|
|
|
2026-06-05 13:39:13 +07:00
|
|
|
// Relasi: Setiap Ujian pasti milik satu Materi (Subject)
|
|
|
|
|
public function subject()
|
2026-05-30 22:15:16 +07:00
|
|
|
{
|
2026-06-05 13:39:13 +07:00
|
|
|
return $this->belongsTo(Subject::class);
|
2026-05-30 22:15:16 +07:00
|
|
|
}
|
|
|
|
|
}
|