<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;

#[Fillable(['cbt_class_id', 'title', 'description'])]
class QuestionSet extends Model
{
    /**
     * Get the class that owns the question set.
     */
    public function cbtClass(): BelongsTo
    {
        return $this->belongsTo(CbtClass::class);
    }

    /**
     * Get the questions for the question set.
     */
    public function questions(): HasMany
    {
        return $this->hasMany(Question::class);
    }
}
