<?php

namespace Database\Seeders;

use App\Models\AnswerOption;
use Illuminate\Database\Seeder;

class AnswerOptionSeeder extends Seeder
{
    public function run()
    {
        // This seeder is kept for backward compatibility
        // Note: Answer options are now question-specific and should be created via QuestionSeeder
        // This seeder will only run if there are no answer options yet (for legacy support)
        
        $existingCount = \App\Models\AnswerOption::count();
        if ($existingCount > 0) {
            // Answer options already exist, skip seeding
            return;
        }

        $options = [
            ['label' => 'Tidak Baik', 'text' => 'Tidak Baik', 'score' => 1, 'weight' => 1.00, 'order' => 1, 'question_id' => null],
            ['label' => 'Kurang Baik', 'text' => 'Kurang Baik', 'score' => 2, 'weight' => 2.00, 'order' => 2, 'question_id' => null],
            ['label' => 'Baik', 'text' => 'Baik', 'score' => 3, 'weight' => 3.00, 'order' => 3, 'question_id' => null],
            ['label' => 'Sangat Baik', 'text' => 'Sangat Baik', 'score' => 4, 'weight' => 4.00, 'order' => 4, 'question_id' => null],
        ];

        foreach ($options as $option) {
            \App\Models\AnswerOption::create($option);
        }
    }
}

