<?php

namespace App\Enums;

enum QuestionTypeEnum: string
{
    case MULTIPLE_CHOICE = 'multiple_choice';

    case SINGLE_CHOICE = 'single_choice';

    case TRUE_FALSE = 'true_false';

    case FILL_IN_THE_BLANK = 'fill_in_the_blank';

    public function label(): string
    {
        return match ($this) {
            self::MULTIPLE_CHOICE => 'Multiple Choice',
            self::SINGLE_CHOICE => 'Single Choice',
            self::TRUE_FALSE => 'True/False',
            self::FILL_IN_THE_BLANK => 'Fill in the Blank',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::MULTIPLE_CHOICE => 'success',
            self::SINGLE_CHOICE => 'info',
            self::TRUE_FALSE => 'warning',
            self::FILL_IN_THE_BLANK => 'primary',
        };
    }

    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }
}
