From c63f019a3f79de4234af10631e09117577eb91e1 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Fri, 27 Dec 2024 14:35:14 +0100 Subject: [PATCH] feat: video lesson (#311) Co-authored-by: wielopolski --- apps/api/src/courses/course.service.ts | 2 +- apps/api/src/lesson/lesson.controller.ts | 12 +- apps/api/src/scorm/services/scorm.service.ts | 2 +- apps/api/src/seed/nice-data-seeds.ts | 2 +- ...se_lesson_description_characters_count.sql | 1 + .../migrations/meta/0006_snapshot.json | 1874 +++++++++++++++++ .../src/storage/migrations/meta/_journal.json | 9 +- .../studentLessonProgress.service.ts | 4 +- apps/web/app/api/generated-api.ts | 30 +- .../components/SortableList/SortableList.tsx | 2 +- .../components/VideoPlayer/VideoPlayer.tsx | 129 ++ .../components/FillInTheBlanksQuestion.tsx | 2 +- .../components/QuestionWrapper.tsx | 2 +- .../modules/Courses/Lesson/LessonContent.tsx | 18 +- .../Courses/Lesson/LessonItems/File/Video.tsx | 4 +- .../modules/Courses/Lesson/OldLesson.page.tsx | 161 ++ apps/web/app/modules/Courses/Lesson/img.png | Bin 0 -> 2084153 bytes .../Courses/NewCourseView/CourseChapter.tsx | 7 +- .../NewCourseView/NewCourseView.page.tsx | 4 +- apps/web/tailwind.config.ts | 4 + 20 files changed, 2241 insertions(+), 28 deletions(-) create mode 100644 apps/api/src/storage/migrations/0006_incerase_lesson_description_characters_count.sql create mode 100644 apps/api/src/storage/migrations/meta/0006_snapshot.json create mode 100644 apps/web/app/components/VideoPlayer/VideoPlayer.tsx create mode 100644 apps/web/app/modules/Courses/Lesson/OldLesson.page.tsx create mode 100644 apps/web/app/modules/Courses/Lesson/img.png diff --git a/apps/api/src/courses/course.service.ts b/apps/api/src/courses/course.service.ts index 6173a1a3..81c9916d 100644 --- a/apps/api/src/courses/course.service.ts +++ b/apps/api/src/courses/course.service.ts @@ -427,7 +427,7 @@ export class CourseService { ) .orderBy(chapters.displayOrder); - // TODO: temporary firx + // TODO: temporary fix const getImageUrl = async (url: string) => { if (!url || url.startsWith("https://")) return url ?? ""; return await this.fileService.getFileUrl(url); diff --git a/apps/api/src/lesson/lesson.controller.ts b/apps/api/src/lesson/lesson.controller.ts index 17b473fb..046a44e2 100644 --- a/apps/api/src/lesson/lesson.controller.ts +++ b/apps/api/src/lesson/lesson.controller.ts @@ -1,4 +1,14 @@ -import { Body, Controller, Delete, Get, Param, Patch, Post, Query, UseGuards } from "@nestjs/common"; +import { + Body, + Controller, + Delete, + Get, + Param, + Patch, + Post, + Query, + UseGuards, +} from "@nestjs/common"; import { Type } from "@sinclair/typebox"; import { Validate } from "nestjs-typebox"; diff --git a/apps/api/src/scorm/services/scorm.service.ts b/apps/api/src/scorm/services/scorm.service.ts index 438454d6..7315a61e 100644 --- a/apps/api/src/scorm/services/scorm.service.ts +++ b/apps/api/src/scorm/services/scorm.service.ts @@ -1,7 +1,7 @@ import { randomUUID } from "crypto"; import path from "path"; -import { Injectable, Inject, BadRequestException, NotFoundException } from "@nestjs/common"; +import { BadRequestException, Inject, Injectable, NotFoundException } from "@nestjs/common"; import AdmZip from "adm-zip"; import { JSDOM } from "jsdom"; import { match } from "ts-pattern"; diff --git a/apps/api/src/seed/nice-data-seeds.ts b/apps/api/src/seed/nice-data-seeds.ts index 70dcfd26..61832851 100644 --- a/apps/api/src/seed/nice-data-seeds.ts +++ b/apps/api/src/seed/nice-data-seeds.ts @@ -1607,7 +1607,7 @@ export const niceCourses: NiceCourseData[] = [ type: LESSON_TYPES.TEXT, title: "Key Concepts and Terminologies in AI", description: - "

Artificial Intelligence (AI) refers to the simulation of human intelligence in machines programmed to think, learn, and make decisions. Below are some key concepts and terminologies essential to understanding AI: