update: models for literacy questions
This commit is contained in:
parent
84613496da
commit
de05919e72
|
|
@ -12,6 +12,21 @@ class LiteracyQuestion extends Model
|
|||
protected $table = 'literacy_questions';
|
||||
protected $fillable = ['question_text', 'type', 'essay_answer', 'essay_score'];
|
||||
|
||||
public function material()
|
||||
{
|
||||
return $this->belongsTo(LiteracyMaterial::class, 'material_id');
|
||||
}
|
||||
|
||||
public function storyTexts()
|
||||
{
|
||||
return $this->hasMany(
|
||||
LiteracyStoryText::class,
|
||||
'material_id',
|
||||
'material_id'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function answers()
|
||||
{
|
||||
return $this->hasMany(LiteracyAnswer::class, 'question_id');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user