feat: Introduce new interactive content blocks including Fill-in-the-Blanks, Short Answer, Ordering, and Matching, with corresponding API, database, and UI integration.

This commit is contained in:
2025-12-19 17:03:26 -03:00
parent 0988213eb7
commit 57b8d7c0a1
17 changed files with 1513 additions and 32 deletions
@@ -0,0 +1,32 @@
-- Mirrored schema for courses, modules, and lessons in the LMS
-- This table stores the published version of the content
CREATE TABLE courses (
id UUID PRIMARY KEY, -- Using the same ID as CMS
title TEXT NOT NULL,
description TEXT,
instructor_id UUID NOT NULL,
start_date TIMESTAMPTZ,
end_date TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE TABLE modules (
id UUID PRIMARY KEY,
course_id UUID NOT NULL REFERENCES courses(id) ON DELETE CASCADE,
title TEXT NOT NULL,
position INT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE TABLE lessons (
id UUID PRIMARY KEY,
module_id UUID NOT NULL REFERENCES modules(id) ON DELETE CASCADE,
title TEXT NOT NULL,
content_type TEXT NOT NULL,
content_url TEXT,
transcription JSONB,
metadata JSONB,
position INT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);