This commit is contained in:
silverpro89
2026-01-26 20:23:08 +07:00
parent 53d97ba5db
commit 2c7b4675a7
49 changed files with 12668 additions and 1 deletions

View File

@@ -37,9 +37,21 @@ const Lesson = sequelize.define('lessons', {
},
// Dạng 1: JSON Content - Nội dung học tập dạng JSON
// Cấu trúc content_json phụ thuộc vào lesson_content_type:
// - vocabulary: { type: "vocabulary", vocabulary_ids: [uuid1, uuid2, ...], exercises: [...] }
// - grammar: { type: "grammar", grammar_ids: [uuid1, uuid2, ...], examples: [...], exercises: [...] }
// - phonics: { type: "phonics", phonics_rules: [{ipa: "/æ/", words: [...]}], exercises: [...] }
// - review: { type: "review", sections: [{type: "vocabulary", ...}, {type: "grammar", ...}, {type: "phonics", ...}] }
content_json: {
type: DataTypes.JSON,
comment: 'Nội dung học tập dạng JSON: text, quiz, interactive, assignment, etc.'
comment: 'Nội dung học tập dạng JSON: vocabulary, grammar, phonics, review'
},
// Loại nội dung của bài học (để query dễ dàng)
lesson_content_type: {
type: DataTypes.ENUM('vocabulary', 'grammar', 'phonics', 'review', 'mixed'),
allowNull: true,
comment: 'Loại nội dung: vocabulary, grammar, phonics, review, mixed'
},
// Dạng 2: URL Content - Chứa link external