update: add relation on model literacy answer
This commit is contained in:
parent
135f50ec3d
commit
6259a33b9c
|
|
@ -9,13 +9,18 @@ class LiteracyAnswer extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = ['question_id', 'assessment_id', 'answer_text', 'submitted_at'];
|
protected $fillable = ['question_id', 'option_id', 'assessment_id', 'answer_text', 'submitted_at', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
public function question()
|
public function question()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(LiteracyQuestion::class, 'question_id');
|
return $this->belongsTo(LiteracyQuestion::class, 'question_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function option()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(LiteracyOption::class, 'option_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function assessment()
|
public function assessment()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(LiteracyAssessment::class, 'assessment_id');
|
return $this->belongsTo(LiteracyAssessment::class, 'assessment_id');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user