"""
quizlib True/False question type
"""

from dataclasses import dataclass, field

from quizlib.types import QuestionType


@dataclass
class TrueFalse:
    """True/False question.

    Attributes:
        name: Question identifier/title.
        text: Question text in Markdown format.
        correct_answer: True if the correct answer is "true", False otherwise.
    """

    name: str
    text: str
    correct_answer: bool
    typ: QuestionType = field(default=QuestionType.TRUE_FALSE, init=False)


# Backwards-compatible alias
TF = TrueFalse
