diff --git a/frontend/public/Quiz.mp4 b/frontend/public/Quiz.mp4
new file mode 100644
index 00000000..7046b163
Binary files /dev/null and b/frontend/public/Quiz.mp4 differ
diff --git a/frontend/public/Upload.mp4 b/frontend/public/Upload.mp4
new file mode 100644
index 00000000..d3d106d9
Binary files /dev/null and b/frontend/public/Upload.mp4 differ
diff --git a/frontend/public/Youtube.mov b/frontend/public/Youtube.mov
deleted file mode 100644
index ca6b75a2..00000000
Binary files a/frontend/public/Youtube.mov and /dev/null differ
diff --git a/frontend/public/Youtube.mp4 b/frontend/public/Youtube.mp4
new file mode 100644
index 00000000..d03cf7ce
Binary files /dev/null and b/frontend/public/Youtube.mp4 differ
diff --git a/frontend/src/components/LessonHelp.vue b/frontend/src/components/LessonHelp.vue
new file mode 100644
index 00000000..f850e350
--- /dev/null
+++ b/frontend/src/components/LessonHelp.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
+ {{ __('How to add a Quiz?') }}
+
+
+
+
+ {{
+ __(
+ 'Click on the add icon in the editor and select Quiz from the menu. It opens up a dialog, where you can either select a quiz from the list or create a new quiz. When you select the Create New option it redirects you to the quiz creation page.'
+ )
+ }}
+
+
+
+
+
+
+ {{ __('How to upload content from your system?') }}
+
+
+
+
+ {{
+ __(
+ 'To upload Image, Video, Audio or PDF from your system, click on the add icon and select upload from the menu. Then choose the file you want to add to the lesson and it gets added to your lesson.'
+ )
+ }}
+
+
+
+
+
+
+ {{ __('How to add a YouTube Video?') }}
+
+
+
+
+ {{
+ __(
+ 'Copy the URL of the video from YouTube and paste it in the editor.'
+ )
+ }}
+
+
+
+
+
+
diff --git a/frontend/src/components/LessonPlugins.vue b/frontend/src/components/LessonPlugins.vue
deleted file mode 100644
index 773fc259..00000000
--- a/frontend/src/components/LessonPlugins.vue
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
- {{ __('Components') }}
-
-
-
-
-
- {{ __('Select an Editor') }}
-
-
-
-
-
-
addQuiz(option)"
- />
-
-
-
-
-
-
-
-
-
-
- {{ __('Add an image, video, pdf or audio.') }}
-
-
-
addFile(data)"
- >
-
-
-
- {{
- uploading
- ? __('Uploading {0}%').format(progress)
- : __('Upload a File')
- }}
-
-
-
-
-
-
-
-
-
-
-
- {{ file.file_name }}
-
-
-
-
-
-
-
-
- {{
- __(
- 'To add a YouTube video, paste the URL of the video in the editor.'
- )
- }}
-
-
-
-
-
- {{ __('Learn More') }}
-
-
-
-
-
-
-
diff --git a/frontend/src/components/Modals/ExplanationVideos.vue b/frontend/src/components/Modals/ExplanationVideos.vue
new file mode 100644
index 00000000..35c0cfb3
--- /dev/null
+++ b/frontend/src/components/Modals/ExplanationVideos.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/Modals/YouTubeExplanation.vue b/frontend/src/components/Modals/YouTubeExplanation.vue
deleted file mode 100644
index baec794c..00000000
--- a/frontend/src/components/Modals/YouTubeExplanation.vue
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/components/QuizPlugin.vue b/frontend/src/components/QuizPlugin.vue
new file mode 100644
index 00000000..ae2e53fd
--- /dev/null
+++ b/frontend/src/components/QuizPlugin.vue
@@ -0,0 +1,58 @@
+
+
+
+
+
+ {{ __('Add a quiz to your lesson') }}
+
+
+
+
+
+
+ {{ __('Save') }}
+
+
+
+
+
+
+
diff --git a/frontend/src/components/UploadPlugin.vue b/frontend/src/components/UploadPlugin.vue
index 49e18908..bb225e37 100644
--- a/frontend/src/components/UploadPlugin.vue
+++ b/frontend/src/components/UploadPlugin.vue
@@ -15,10 +15,6 @@ const fileUploader = ref(null)
const emit = defineEmits(['fileUploaded'])
const props = defineProps({
- wrapper: {
- type: Object,
- required: true,
- },
onFileUploaded: {
type: Function,
required: true,
diff --git a/frontend/src/components/VideoBlock.vue b/frontend/src/components/VideoBlock.vue
index 2d4705e9..5026edfe 100644
--- a/frontend/src/components/VideoBlock.vue
+++ b/frontend/src/components/VideoBlock.vue
@@ -4,6 +4,7 @@
@timeupdate="updateTime"
@ended="videoEnded"
class="rounded-lg border border-gray-100"
+ ref="videoRef"
>
@@ -71,7 +72,6 @@ const props = defineProps({
onMounted(() => {
setTimeout(() => {
- videoRef.value = document.querySelector('video')
videoRef.value.onloadedmetadata = () => {
duration.value = videoRef.value.duration
}
diff --git a/frontend/src/pages/Lesson.vue b/frontend/src/pages/Lesson.vue
index 6a5af22e..f0727d3c 100644
--- a/frontend/src/pages/Lesson.vue
+++ b/frontend/src/pages/Lesson.vue
@@ -120,7 +120,7 @@
@@ -79,7 +79,7 @@ import {
onBeforeUnmount,
} from 'vue'
import EditorJS from '@editorjs/editorjs'
-import LessonPlugins from '@/components/LessonPlugins.vue'
+import LessonHelp from '@/components/LessonHelp.vue'
import { ChevronRight } from 'lucide-vue-next'
import { updateDocumentTitle, createToast, getEditorTools } from '@/utils'
import { capture } from '@/telemetry'
@@ -473,6 +473,10 @@ updateDocumentTitle(pageMeta)
max-width: none;
}
+.codex-editor--narrow .ce-toolbar__actions {
+ right: 100%;
+}
+
.ce-toolbar__content {
max-width: none;
}
diff --git a/frontend/src/utils/quiz.js b/frontend/src/utils/quiz.js
index d0c0f80f..285f4a78 100644
--- a/frontend/src/utils/quiz.js
+++ b/frontend/src/utils/quiz.js
@@ -1,7 +1,9 @@
import QuizBlock from '@/components/QuizBlock.vue'
-import { createApp } from 'vue'
+import QuizPlugin from '@/components/QuizPlugin.vue'
+import { createApp, h } from 'vue'
import { usersStore } from '../stores/user'
import translationPlugin from '../translation'
+import { CircleHelp } from 'lucide-vue-next'
export class Quiz {
constructor({ data, api, readOnly }) {
@@ -9,17 +11,31 @@ export class Quiz {
this.readOnly = readOnly
}
+ static get toolbox() {
+ const app = createApp({
+ render: () =>
+ h(CircleHelp, { size: 18, strokeWidth: 1.5, color: 'black' }),
+ })
+
+ const div = document.createElement('div')
+ app.mount(div)
+
+ return {
+ title: __('Quiz'),
+ icon: div.innerHTML,
+ }
+ }
+
static get isReadOnlySupported() {
return true
}
render() {
this.wrapper = document.createElement('div')
- if (this.data) {
- let renderedQuiz = this.renderQuiz(this.data.quiz)
- if (!this.readOnly) {
- this.wrapper.innerHTML = renderedQuiz
- }
+ if (Object.keys(this.data).length) {
+ this.renderQuiz(this.data.quiz)
+ } else {
+ this.renderQuizModal()
}
return this.wrapper
}
@@ -27,7 +43,7 @@ export class Quiz {
renderQuiz(quiz) {
if (this.readOnly) {
const app = createApp(QuizBlock, {
- quiz: quiz, // Pass quiz content as prop
+ quiz: quiz,
})
app.use(translationPlugin)
const { userResource } = usersStore()
@@ -35,11 +51,23 @@ export class Quiz {
app.mount(this.wrapper)
return
}
- return `
+ this.wrapper.innerHTML = `
Quiz: ${quiz}
`
+ return
+ }
+
+ renderQuizModal() {
+ const app = createApp(QuizPlugin, {
+ onQuizAddition: (quiz) => {
+ this.data.quiz = quiz
+ this.renderQuiz(quiz)
+ },
+ })
+ app.use(translationPlugin)
+ app.mount(this.wrapper)
}
save(blockContent) {
diff --git a/frontend/src/utils/upload.js b/frontend/src/utils/upload.js
index 951768e5..3ceb5ec8 100644
--- a/frontend/src/utils/upload.js
+++ b/frontend/src/utils/upload.js
@@ -1,7 +1,7 @@
import AudioBlock from '@/components/AudioBlock.vue'
import VideoBlock from '@/components/VideoBlock.vue'
import UploadPlugin from '@/components/UploadPlugin.vue'
-import { h, createApp, inject } from 'vue'
+import { h, createApp } from 'vue'
import { Upload as UploadIcon } from 'lucide-vue-next'
import translationPlugin from '../translation'
@@ -70,7 +70,6 @@ export class Upload {
renderFileUploader() {
const app = createApp(UploadPlugin, {
- wrapper: this.wrapper,
onFileUploaded: (file) => {
this.data.file_url = file.file_url
this.data.file_type = file.file_type