update: models for literacy questions
This commit is contained in:
parent
1e8b343c3f
commit
49f2f23da5
|
|
@ -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');
|
||||
|
|
@ -21,4 +36,4 @@ public function options()
|
|||
{
|
||||
return $this->hasMany(LiteracyOption::class, 'question_id');
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user