feat: quiz plugin in lesson

This commit is contained in:
Jannat Patel
2024-03-11 09:38:27 +05:30
parent 2126b4f657
commit 83a1b03bb7
10 changed files with 266 additions and 222 deletions

View File

@@ -1,6 +1,11 @@
import { toast } from 'frappe-ui'
import { useDateFormat, useTimeAgo } from '@vueuse/core'
import { BookOpen, Users, TrendingUp, Briefcase } from 'lucide-vue-next'
import { Quiz } from '@/utils/quiz'
import Header from '@editorjs/header'
import Paragraph from '@editorjs/paragraph'
import List from '@editorjs/list'
import Embed from '@editorjs/embed'
export function createToast(options) {
toast({
@@ -64,6 +69,37 @@ export function getFileSize(file_size) {
return value
}
export function getEditorTools() {
return {
header: Header,
quiz: Quiz,
paragraph: {
class: Paragraph,
inlineToolbar: true,
config: {
preserveBlank: true,
},
},
list: List,
embed: {
class: Embed,
config: {
services: {
youtube: true,
vimeo: true,
codepen: true,
slides: {
regex: /https:\/\/docs\.google\.com\/presentation\/d\/e\/([A-Za-z0-9_-]+)\/pub/,
embedUrl:
'https://docs.google.com/presentation/d/e/<%= remote_id %>/embed',
html: "<iframe width='100%' height='300' frameborder='0' allowfullscreen='true'></iframe>",
},
},
},
},
}
}
export function getTimezones() {
return [
'Pacific/Midway',