Feat: Модули курса (контент)
✅ CourseModuleController (store, update, destroy) ✅ Маршруты для модулей ✅ UI добавления/редактирования модулей ✅ Типы: section, lesson, video, file, link, test ✅ Тесты как тип модуля (выбор из существующих) ✅ Загрузка файлов ✅ Иерархия (родитель/потомки) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -16,11 +16,15 @@ class CourseModule extends Model
|
||||
'parent_id',
|
||||
'title',
|
||||
'content',
|
||||
'type',
|
||||
'type', // section, lesson, video, file, link, test
|
||||
'sort_order',
|
||||
'duration_minutes',
|
||||
'is_required',
|
||||
'is_active',
|
||||
'video_url',
|
||||
'file_path',
|
||||
'external_url',
|
||||
'test_id', // Связь с тестом
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
@@ -48,6 +52,11 @@ class CourseModule extends Model
|
||||
return $this->hasMany(Test::class);
|
||||
}
|
||||
|
||||
public function test(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Test::class);
|
||||
}
|
||||
|
||||
public function userProgress(): HasMany
|
||||
{
|
||||
return $this->hasMany(UserCourseProgress::class);
|
||||
|
||||
Reference in New Issue
Block a user