<?php

namespace App\Models;

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

class TopicQuestionOption extends Model
{
    use HasFactory;

    protected $fillable = [
        'topic_id',
        'question_id',
        'option',
        'is_correct'
    ];
    
    protected $casts = [
        'topic_id' => 'integer',
        'question_id' => 'integer',
    ];

    public function topic()
    {
        return $this->belongsTo(Topic::class, 'topic_id');
    }

    public function question()
    {
        return $this->belongsTo(TopicQuestion::class, 'question_id');
    }
}
