<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Pregunta extends Model
{
    use HasFactory;

    protected $fillable = [
        'lectura_id',
        'enunciado',
        'tipo',
        'formato',
        'puntaje',
        'estado',
    ];

    protected $casts = [
        'estado' => 'boolean',
    ];

    public function lectura()
    {
        return $this->belongsTo(Lectura::class);
    }

    public function opciones()
    {
        return $this->hasMany(Opcion::class);
    }
}
