LMS Этап 1 MVP - Laravel 13
✅ Базовая функциональность: - Аутентификация (вход/выход/регистрация) - Роли и разрешения (Administrator, Manager, Curator, Student) - Панель управления (dashboard) для разных ролей ✅ База данных (23 миграции): - users, organizations, groups, user_groups - course_categories, courses, course_modules - tests, questions, answers, question_matching_pairs - test_attempts, test_responses - course_requests, course_request_items, course_assignments - scorm_data, user_course_progress, logs - permission tables ✅ Модели (15 моделей с отношениями): - User, Organization, Group - CourseCategory, Course, CourseModule - Test, Question, Answer, QuestionMatchingPair - TestAttempt, TestResponse - CourseRequest, CourseRequestItem, CourseAssignment - ScormData, UserCourseProgress, Log ✅ Seeders: - RoleSeeder (роли и разрешения) - UserSeeder (тестовые пользователи) ✅ Контроллеры: - LoginController, RegisterController, DashboardController ✅ Blade-шаблоны: - layouts/app.blade.php - auth/login.blade.php, auth/register.blade.php - dashboard/admin.blade.php, dashboard/curator.blade.php, dashboard/student.blade.php 📦 Пакеты: - Laravel 13 (dev-master) - spatie/laravel-permission - laravel/sanctum 🔧 Инфраструктура: - Nginx конфигурация - PHP 8.4-FPM - MariaDB Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Question extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'test_id',
|
||||
'type',
|
||||
'question_text',
|
||||
'explanation',
|
||||
'score',
|
||||
'sort_order',
|
||||
'is_required',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_required' => 'boolean',
|
||||
];
|
||||
|
||||
public function test(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Test::class);
|
||||
}
|
||||
|
||||
public function answers(): HasMany
|
||||
{
|
||||
return $this->hasMany(Answer::class);
|
||||
}
|
||||
|
||||
public function matchingPairs(): HasMany
|
||||
{
|
||||
return $this->hasMany(QuestionMatchingPair::class);
|
||||
}
|
||||
|
||||
public function responses(): HasMany
|
||||
{
|
||||
return $this->hasMany(TestResponse::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user