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/AppSidebar.vue b/frontend/src/components/AppSidebar.vue index 9a96b146..3d7ce6f2 100644 --- a/frontend/src/components/AppSidebar.vue +++ b/frontend/src/components/AppSidebar.vue @@ -225,7 +225,7 @@ import { IntermediateStepModal, } from 'frappe-ui/frappe' -const { user, sidebarSettings } = sessionStore() +const { user } = sessionStore() const { userResource } = usersStore() let sidebarStore = useSidebar() const socket = inject('$socket') @@ -236,6 +236,7 @@ const isModerator = ref(false) const isInstructor = ref(false) const pageToEdit = ref(null) const settingsStore = useSettings() +const { sidebarSettings } = settingsStore const showOnboarding = ref(false) const showIntermediateModal = ref(false) const currentStep = ref({}) diff --git a/frontend/src/components/MobileLayout.vue b/frontend/src/components/MobileLayout.vue index 1288c110..40cb3855 100644 --- a/frontend/src/components/MobileLayout.vue +++ b/frontend/src/components/MobileLayout.vue @@ -58,11 +58,13 @@ import { getSidebarLinks } from '@/utils' import { useRouter } from 'vue-router' import { watch, ref, onMounted } from 'vue' import { sessionStore } from '@/stores/session' +import { useSettings } from '@/stores/settings' import { usersStore } from '@/stores/user' import * as icons from 'lucide-vue-next' -const { logout, user, sidebarSettings } = sessionStore() +const { logout, user } = sessionStore() let { isLoggedIn } = sessionStore() +const { sidebarSettings } = useSettings() const router = useRouter() let { userResource } = usersStore() const sidebarLinks = ref(getSidebarLinks()) diff --git a/frontend/src/components/Modals/VideoStatistics.vue b/frontend/src/components/Modals/VideoStatistics.vue new file mode 100644 index 00000000..08fa28d8 --- /dev/null +++ b/frontend/src/components/Modals/VideoStatistics.vue @@ -0,0 +1,216 @@ + + + diff --git a/frontend/src/components/Settings/Settings.vue b/frontend/src/components/Settings/Settings.vue index ebfafe8d..580a649c 100644 --- a/frontend/src/components/Settings/Settings.vue +++ b/frontend/src/components/Settings/Settings.vue @@ -130,6 +130,13 @@ const tabsStructure = computed(() => { label: 'General', icon: 'Wrench', fields: [ + { + label: 'Allow Guest Access', + name: 'allow_guest_access', + description: + 'If enabled, users can access the course and batch lists without logging in.', + type: 'checkbox', + }, { label: 'Enable Learning Paths', name: 'enable_learning_paths', @@ -138,11 +145,11 @@ const tabsStructure = computed(() => { type: 'checkbox', }, { - label: 'Allow Guest Access', - name: 'allow_guest_access', - description: - 'If enabled, users can access the course and batch lists without logging in.', + label: 'Prevent Skipping Videos', + name: 'prevent_skipping_videos', type: 'checkbox', + description: + 'If enabled, users will no able to move forward in a video', }, { label: 'Send calendar invite for evaluations', @@ -154,6 +161,14 @@ const tabsStructure = computed(() => { { type: 'Column Break', }, + { + label: 'Livecode URL', + name: 'livecode_url', + doctype: 'Livecode URL', + type: 'text', + description: + 'https://docs.frappe.io/learning/falcon-self-hosting-guide', + }, { label: 'Batch Confirmation Email Template', name: 'batch_confirmation_template', @@ -166,14 +181,6 @@ const tabsStructure = computed(() => { doctype: 'Email Template', type: 'Link', }, - { - label: 'Livecode URL', - name: 'livecode_url', - doctype: 'Livecode URL', - type: 'text', - description: - 'https://docs.frappe.io/learning/falcon-self-hosting-guide', - }, { label: 'Unsplash Access Key', name: 'unsplash_access_key', diff --git a/frontend/src/components/VideoBlock.vue b/frontend/src/components/VideoBlock.vue index 3f5963b6..693d6d26 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" + >
{}, }, }) @@ -295,6 +298,11 @@ const toggleMute = () => { } const changeCurrentTime = () => { + if ( + preventSkippingVideos.data && + currentTime.value > videoRef.value.currentTime + ) + return videoRef.value.currentTime = currentTime.value updateNextQuiz() } diff --git a/frontend/src/pages/Lesson.vue b/frontend/src/pages/Lesson.vue index 430c1b28..48dbb6e4 100644 --- a/frontend/src/pages/Lesson.vue +++ b/frontend/src/pages/Lesson.vue @@ -12,6 +12,12 @@ +
@@ -100,26 +106,15 @@ - - - + + - - + + +