feat: quiz creation from lesson form

This commit is contained in:
Jannat Patel
2024-08-12 12:46:38 +05:30
parent 7f7986d77a
commit 62ab853605
5 changed files with 34 additions and 19 deletions

View File

@@ -70,7 +70,7 @@
</template>
<script setup>
import { Breadcrumbs, FormControl, createResource, Button } from 'frappe-ui'
import { computed, reactive, onMounted, inject, ref, watch } from 'vue'
import { computed, reactive, onMounted, inject, ref, onBeforeUnmount } from 'vue'
import EditorJS from '@editorjs/editorjs'
import LessonPlugins from '@/components/LessonPlugins.vue'
import { ChevronRight } from 'lucide-vue-next'
@@ -171,9 +171,13 @@ const addInstructorNotes = (data) => {
const enableAutoSave = () => {
autoSaveInterval = setInterval(() => {
saveLesson()
}, 10000)
}, 5000)
}
onBeforeUnmount(() => {
clearInterval(autoSaveInterval)
})
const newLessonResource = createResource({
url: 'frappe.client.insert',
makeParams(values) {