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

@@ -77,7 +77,6 @@ const valuePropPassed = computed(() => 'value' in attrs)
const value = computed({
get: () => (valuePropPassed.value ? attrs.value : props.modelValue),
set: (val) => {
console.log(val?.value, valuePropPassed.value)
return (
val?.value &&
emit(valuePropPassed.value ? 'change' : 'update:modelValue', val?.value)

View File

@@ -0,0 +1,26 @@
<template>
<Quiz v-if="user.data" :quizName="quiz"></Quiz>
<div v-else class="border rounded-md text-center py-20">
<div>
{{ __('Please login to access the quiz.') }}
</div>
<Button @click="redirectToLogin()" class="mt-2">
<span>
{{ __('Login') }}
</span>
</Button>
</div>
</template>
<script setup>
import { inject } from 'vue'
import { Button } from 'frappe-ui'
import Quiz from '@/components/Quiz.vue'
const user = inject('$user')
const props = defineProps({
quiz: {
type: String,
required: true,
},
})
</script>