feat: quiz creation from lesson form

This commit is contained in:
Jannat Patel
2024-08-12 12:47:17 +05:30
parent 62ab853605
commit 2994144718
3 changed files with 20 additions and 9 deletions

View File

@@ -91,7 +91,8 @@
<div> <div>
{{ option.label }} {{ option.label }}
</div> </div>
<div v-if="option.label != option.description" <div
v-if="option.label != option.description"
class="text-xs text-gray-700" class="text-xs text-gray-700"
v-html="option.description" v-html="option.description"
></div> ></div>

View File

@@ -26,12 +26,15 @@
:label="__('Add an existing quiz')" :label="__('Add an existing quiz')"
@change="(option) => addQuiz(option)" @change="(option) => addQuiz(option)"
/> />
<router-link :to="{ <router-link
name: 'QuizCreation', :to="{
params: { name: 'QuizCreation',
quizID: 'new', params: {
} quizID: 'new',
}" class="self-end ml-2"> },
}"
class="self-end ml-2"
>
<Button> <Button>
<template #icon> <template #icon>
<Plus class="h-4 w-4 stroke-1.5" /> <Plus class="h-4 w-4 stroke-1.5" />
@@ -121,7 +124,7 @@ const props = defineProps({
}) })
const addQuiz = (value) => { const addQuiz = (value) => {
console.log("here") console.log('here')
console.log(value) console.log(value)
getCurrentEditor().caret.setToLastBlock('end', 0) getCurrentEditor().caret.setToLastBlock('end', 0)
if (value) { if (value) {

View File

@@ -70,7 +70,14 @@
</template> </template>
<script setup> <script setup>
import { Breadcrumbs, FormControl, createResource, Button } from 'frappe-ui' import { Breadcrumbs, FormControl, createResource, Button } from 'frappe-ui'
import { computed, reactive, onMounted, inject, ref, onBeforeUnmount } from 'vue' import {
computed,
reactive,
onMounted,
inject,
ref,
onBeforeUnmount,
} from 'vue'
import EditorJS from '@editorjs/editorjs' import EditorJS from '@editorjs/editorjs'
import LessonPlugins from '@/components/LessonPlugins.vue' import LessonPlugins from '@/components/LessonPlugins.vue'
import { ChevronRight } from 'lucide-vue-next' import { ChevronRight } from 'lucide-vue-next'