Abiyasa_Putra_Prasetya/Penilaian Literasi/iClOP-V2/app/Models/Literacy/LiteracyQuestion.php

25 lines
550 B
PHP

<?php
namespace App\Models\Literacy;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class LiteracyQuestion extends Model
{
use HasFactory;
protected $table = 'literacy_questions';
protected $fillable = ['question_text', 'type', 'essay_answer', 'essay_score'];
public function answers()
{
return $this->hasMany(LiteracyAnswer::class, 'question_id');
}
public function options()
{
return $this->hasMany(LiteracyOption::class, 'question_id');
}
}