<?php

namespace Database\Seeders;

use App\Models\Siswa;
use App\Models\Sertifikat;
use App\Models\Classification;
use App\Models\Nilai;
use App\Models\User;
use App\Models\Placement;
use App\Models\Quiz;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        // Seed admin
        User::create([
            "email" => "admin@seiza.edu",
            "username" => "admin",
            "password" => bcrypt("admin"),
            "role" => "Admin",
            "active" => 1,
            "email_verified_at" => "2024-06-04"
        ]);
        // User::create([
        //     "email" => "siswa@seiza.edu",
        //     "username" => "siswa",
        //     "password" => bcrypt("siswa"),
        //     "role" => "Siswa",
        //     "active" => 1,
        //     "email_verified_at" => "2024-06-04"
        // ]);

        // Siswa::create([
        //     "user_id" => 2,
        //     "nama" => "Siswa",
        //     "nik" => 3510,
        //     "tgl_lahir" => "2002-05-07",
        //     "jenkel" => "Perempuan",
        //     "alamat" => "Banyuwangi",
        //     "agama" => "Islam",
        //     "nama_ortu" => "Budi",
        //     "no_telp" => "0811",
        //     "kerja_ortu" => "Kuli",
        //     "jenjang" => "SMP",
        // ]);

        // Classification::create([
        //     "user_id" => 2,
        //     "nilai" => 60,
        //     "hasil_kelas" => "Intermediate",
        // ]);

        // Sertifikat::create([
        //     "user_id" => 2,
        // ]);

        // Nilai::create([
        //     "user_id" => 2,
        //     "writing" => 0,
        //     "reading" => 0,
        //     "listening" => 0,
        //     "speaking" => 0
        // ]);

        // Seed 10
        // foreach (range(1, 50) as $index) {
        //     Placement::create([
        //         "soal" => "What is the color of an Apple?",
        //         "jawaban" => "Red|Blue|Yellow",
        //         "jawaban_benar" => "Red",
        //     ]);

        //     Quiz::create([
        //         "jenjang" => "Intermediate",
        //         "jenis" => "Writing",
        //         "soal" => "What is the color of an Apple?",
        //         "jawaban" => "Red|Blue|Yellow",
        //         "jawaban_benar" => "Red",
        //     ]);

        // Quiz::create([
        //     "jenjang" => "Intermediate",
        //     "jenis" => "Reading",
        //     "soal" => "What is the color of a Banana?",
        //     "jawaban" => "Red|Blue|Yellow",
        //     "jawaban_benar" => "Red",
        // ]);
        // }
    }
}
