Ana içeriğe geç

Kurs İdealleri

Akademi Eğitim Platformu Kurs İdealleri Dökümanı

  • Multi-tenant → her şeyde academy_id zorunlu
  • Versiyonlama → template’ten gelen yapı için
  • Esneklik → içerik ve ayarlar için JSON
  • İleride raporlama/analitik için kolay sorgulanabilir sütunlar

Ek tablolar (kurs / modül katmanı)

-- Kurs (bir akademi içinde birden fazla kurs olabilir)
CREATE TABLE courses (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
academy_id BIGINT NOT NULL,
template_version_id BIGINT NULL, -- bu kurs hangi template versiyonundan türetildi?

title VARCHAR(255) NOT NULL,
slug VARCHAR(150) NOT NULL, -- academy içinde unique olmalı
description TEXT,
cover_image_url VARCHAR(512),
order_index INT DEFAULT 0, -- sıralama için

status ENUM('draft','active','archived') DEFAULT 'draft',
is_published BOOLEAN DEFAULT FALSE,
published_at TIMESTAMP NULL,

-- Tamamlama koşulları (genel)
completion_criteria JSON DEFAULT NULL, -- { "min_score": 70, "required_modules": ["modul-1", "modul-3"] }

-- Esnek ayarlar
settings JSON NOT NULL DEFAULT (JSON_OBJECT()),

created_by BIGINT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
deleted_at TIMESTAMP NULL,

FOREIGN KEY (academy_id) REFERENCES academies(id) ON DELETE CASCADE,
FOREIGN KEY (template_version_id) REFERENCES academy_template_versions(id) ON DELETE SET NULL,

UNIQUE KEY uk_academy_slug (academy_id, slug),
INDEX idx_academy_status (academy_id, status),
INDEX idx_published (is_published)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- Modül (bir kursun içinde)
CREATE TABLE course_modules (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
course_id BIGINT NOT NULL,
parent_module_id BIGINT NULL, -- nested modüller için (opsiyonel)

title VARCHAR(255) NOT NULL,
slug VARCHAR(150) NOT NULL, -- course içinde unique olmalı
description TEXT,
order_index INT DEFAULT 0,

module_type ENUM(
'video', 'document', 'quiz', 'assignment',
'flashcards', 'scorm', 'external_link',
'text_content', 'survey', 'live_session'
) NOT NULL,

-- İçerik / kaynak
content JSON NOT NULL DEFAULT (JSON_OBJECT()), -- { "video_url": "...", "duration_sec": 480, ... }
estimated_duration_minutes INT DEFAULT 0,

is_required BOOLEAN DEFAULT TRUE,
passing_score DECIMAL(5,2) DEFAULT NULL, -- quiz/assignment için

settings JSON NOT NULL DEFAULT (JSON_OBJECT()), -- visibility, deadline, attempts vb.

created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

FOREIGN KEY (course_id) REFERENCES courses(id) ON DELETE CASCADE,
FOREIGN KEY (parent_module_id) REFERENCES course_modules(id) ON DELETE SET NULL,

UNIQUE KEY uk_course_slug (course_id, slug),
INDEX idx_course_order (course_id, order_index)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


-- Kullanıcının kurs ilerlemesi (en kritik tablolardan biri)
CREATE TABLE user_course_progress (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
course_id BIGINT NOT NULL,

status ENUM(
'not_started', 'in_progress', 'completed',
'failed', 'expired'
) DEFAULT 'not_started',

progress_percentage DECIMAL(5,2) DEFAULT 0.00,
started_at TIMESTAMP NULL,
completed_at TIMESTAMP NULL,
last_activity_at TIMESTAMP NULL,

-- Modül bazında detaylı ilerleme (JSON veya ayrı tablo)
module_progress JSON DEFAULT NULL, -- { "modul-slug-1": { "completed": true, "score": 85, "attempts": 2 } }

-- Certificate varsa
certificate_issued BOOLEAN DEFAULT FALSE,
certificate_url VARCHAR(512) NULL,

created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

FOREIGN KEY (course_id) REFERENCES courses(id) ON DELETE CASCADE,

UNIQUE KEY uk_user_course (user_id, course_id),
INDEX idx_user_status (user_id, status),
INDEX idx_last_activity (last_activity_at)
) ENGINE=InnoDB;


-- Modül bazında daha detaylı ilerleme (opsiyonel – büyük ölçekte ayrıştırmak için faydalı)
CREATE TABLE user_module_progress (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
user_id BIGINT NOT NULL,
module_id BIGINT NOT NULL,

completed BOOLEAN DEFAULT FALSE,
score DECIMAL(5,2) NULL,
attempts INT DEFAULT 0,
time_spent_seconds INT DEFAULT 0,
completed_at TIMESTAMP NULL,
last_attempt_at TIMESTAMP NULL,

answers JSON NULL, -- quiz cevapları, assignment dosyaları vs.

FOREIGN KEY (module_id) REFERENCES course_modules(id) ON DELETE CASCADE,

UNIQUE KEY uk_user_module (user_id, module_id),
INDEX idx_completed (completed)
) ENGINE=InnoDB;

Örnek content ve settings JSON yapıları

course_modules.content örnekleri:

-- Video
{ "type": "video", "provider": "vimeo|youtube|self-hosted", "url": "https://...", "thumbnail": "...", "duration_sec": 720 }

-- Quiz
{ "type": "quiz", "questions": [ { "id": "q1", "text": "...", "type": "multiple_choice", "options": [...], "correct": ["a","c"] } ], "max_attempts": 3 }

-- SCORM
{ "type": "scorm", "package_url": "https://...", "entry_point": "index.html" }

course_modules.settings örnek:

{
"deadline": "2026-06-30",
"visible_from": "2026-03-01",
"max_attempts": 2,
"show_answers_after": "completed",
"prerequisites": ["modul-giris", "modul-temel-kavramlar"]
}

Özet – Şu ana kadar olan katmanlar

academies
├─ academy_domains
├─ academy_templates → academy_template_versions
├─ academy_invitations
├─ academy_integrations
├─ academy_ip_restrictions
├─ courses
│ └─ course_modules (nested destekli)
└─ user_course_progress
└─ user_module_progress (detaylı takip için opsiyonel)