<?php

namespace App\Models;

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

class Chapter extends Model
{

    use HasFactory;

    
    protected $fillable = ['id', 'libelle', 'coursFileName', 'resumeFileName', 'videoFileName', 'document_id'];

    public function document()
    {
        return $this->belongsTo(Document::class);
    }

    public function exercises()
    {
        return $this->hasMany(Exercise::class);
    }

    public function quizQuestions()
    {
        return $this->hasMany(QuizQuestion::class);
    }

    public function questions()
    {
        return $this->hasMany(Question::class);
    }
}
