From 5eaae06ceb5954e8d87c791efeca9413cde0ff7a Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 30 Jun 2025 19:56:07 +0530 Subject: [PATCH] feat: video watch time tracking --- frontend/components.d.ts | 1 + .../src/components/Modals/VideoStatistics.vue | 143 +++++++++++++++ frontend/src/components/VideoBlock.vue | 9 +- frontend/src/pages/Lesson.vue | 167 ++++++++++++------ lms/lms/api.py | 35 ++++ .../lms_video_watch_duration/__init__.py | 0 .../lms_video_watch_duration.js | 8 + .../lms_video_watch_duration.json | 160 +++++++++++++++++ .../lms_video_watch_duration.py | 9 + .../test_lms_video_watch_duration.py | 21 +++ lms/lms/utils.py | 9 + 11 files changed, 507 insertions(+), 55 deletions(-) create mode 100644 frontend/src/components/Modals/VideoStatistics.vue create mode 100644 lms/lms/doctype/lms_video_watch_duration/__init__.py create mode 100644 lms/lms/doctype/lms_video_watch_duration/lms_video_watch_duration.js create mode 100644 lms/lms/doctype/lms_video_watch_duration/lms_video_watch_duration.json create mode 100644 lms/lms/doctype/lms_video_watch_duration/lms_video_watch_duration.py create mode 100644 lms/lms/doctype/lms_video_watch_duration/test_lms_video_watch_duration.py diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 98fda927..907b9153 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -102,6 +102,7 @@ declare module 'vue' { UserAvatar: typeof import('./src/components/UserAvatar.vue')['default'] UserDropdown: typeof import('./src/components/UserDropdown.vue')['default'] VideoBlock: typeof import('./src/components/VideoBlock.vue')['default'] + VideoStatistics: typeof import('./src/components/Modals/VideoStatistics.vue')['default'] ZoomAccountModal: typeof import('./src/components/Modals/ZoomAccountModal.vue')['default'] ZoomSettings: typeof import('./src/components/Settings/ZoomSettings.vue')['default'] } diff --git a/frontend/src/components/Modals/VideoStatistics.vue b/frontend/src/components/Modals/VideoStatistics.vue new file mode 100644 index 00000000..12c58625 --- /dev/null +++ b/frontend/src/components/Modals/VideoStatistics.vue @@ -0,0 +1,143 @@ + + diff --git a/frontend/src/components/VideoBlock.vue b/frontend/src/components/VideoBlock.vue index 3f5963b6..42a22cd1 100644 --- a/frontend/src/components/VideoBlock.vue +++ b/frontend/src/components/VideoBlock.vue @@ -27,9 +27,9 @@ oncontextmenu="return false" class="rounded-md border border-gray-100 cursor-pointer" ref="videoRef" - > - - + :src="fileURL" + :type="type" + >
{}, }, }) diff --git a/frontend/src/pages/Lesson.vue b/frontend/src/pages/Lesson.vue index 430c1b28..daa48934 100644 --- a/frontend/src/pages/Lesson.vue +++ b/frontend/src/pages/Lesson.vue @@ -12,6 +12,12 @@ +
@@ -100,26 +106,15 @@ - - - + + - - + + +