<?php

namespace Database\Seeders;

use App\Models\Exam;
use App\Models\Classroom;
use App\Models\Lesson;
use Illuminate\Database\Seeder;

class ExamsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $classroom = Classroom::first();
        $lesson = Lesson::first();

        if ($classroom && $lesson) {
            Exam::create([
                'title' => 'Ujian Akhir Semester',
                'lesson_id' => $lesson->id,
                'classroom_id' => $classroom->id,
                'duration' => 60,
                'description' => 'Ujian akhir semester ganjil',
                'random_question' => 'Y',
                'random_answer' => 'Y',
                'show_answer' => 'N',
            ]);
        }
    }
}
