mirror of
https://github.com/robonen/education-project.git
synced 2026-03-20 02:44:31 +00:00
Модуль Задания
This commit is contained in:
@@ -11,4 +11,5 @@ class AnswerToTask extends Model
|
||||
|
||||
protected $table = 'answers_to_task';
|
||||
protected $fillable = ['description', 'student_id', 'task_id', 'class_id', 'checked', 'mark', 'comment_by_teacher'];
|
||||
|
||||
}
|
||||
|
||||
@@ -28,4 +28,9 @@ class BankTask extends Model
|
||||
return $this->belongsTo(Theme::class);
|
||||
}
|
||||
|
||||
public function tasks() {
|
||||
return $this->hasMany(Task::class);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class BankTaskFile extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'bank_tasks_files';
|
||||
protected $table = 'bank_task_files';
|
||||
protected $fillable = ['name', 'type', 'extension', 'url', 'banktask_id'];
|
||||
|
||||
public function task() {
|
||||
$this->belongsTo(Task::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Task extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable = ['name', 'description', 'deadline', 'teacher_id', 'subject_id'];
|
||||
protected $fillable = ['banktask_id', 'deadline', 'teacher_id', 'class_id'];
|
||||
|
||||
public function banktask() {
|
||||
return $this->hasMany(BankTask::class, 'class_task');
|
||||
return $this->belongsTo(BankTask::class);
|
||||
}
|
||||
|
||||
public function teacher(){
|
||||
|
||||
@@ -9,5 +9,6 @@ class TaskFile extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'task_files';
|
||||
protected $fillable = ['name', 'type', 'extension', 'url', 'task_id'];
|
||||
protected $fillable = ['name', 'type', 'extension', 'url', 'task_id', 'user_id'];
|
||||
protected $hidden = ['review'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user