fix: edit permission and other issues

This commit is contained in:
Jannat Patel
2024-05-17 18:03:04 +05:30
parent 36c7c10d94
commit 76ea4fc1ae
8 changed files with 58 additions and 12 deletions

View File

@@ -166,5 +166,13 @@ function enrollStudent() {
}
}
const is_instructor = () => {}
const is_instructor = () => {
let user_is_instructor = false
props.course.data.instructors.forEach((instructor) => {
if (!user_is_instructor && instructor.name == user.data?.name) {
user_is_instructor = true
}
})
return user_is_instructor
}
</script>

View File

@@ -323,7 +323,6 @@ watch(activeQuestion, (value) => {
watch(
() => props.quizName,
(newName) => {
console.log(newName)
if (newName) {
quiz.reload()
}
@@ -392,7 +391,7 @@ const addToLocalStorage = () => {
let quizData = JSON.parse(localStorage.getItem(quiz.data.title))
let questionData = {
question_index: activeQuestion.value,
answers: getAnswers().join(),
answer: getAnswers().join(),
is_correct: showAnswers.filter((answer) => {
return answer != undefined
}),

View File

@@ -26,7 +26,12 @@
"
>
<div class="text-base font-medium text-gray-900 leading-none">
<span v-if="branding.data?.brand_name">
<span
v-if="
branding.data?.brand_name &&
branding.data?.brand_name != 'Frappe'
"
>
{{ branding.data?.brand_name }}
</span>
<span v-else> Learning </span>