feat: lesson editor youtube and quiz components

This commit is contained in:
Jannat Patel
2023-05-02 11:09:46 +05:30
parent 7777bd02e3
commit ab8b76cada
4 changed files with 154 additions and 29 deletions

View File

@@ -1,5 +1,7 @@
import frappe
from lms.www.utils import get_current_lesson_details, get_common_context
from lms.lms.utils import is_instructor, has_course_moderator_role
from frappe import _
def get_context(context):
@@ -8,3 +10,8 @@ def get_context(context):
lesson_index = frappe.form_dict.get("lesson")
lesson_number = f"{chapter_index}.{lesson_index}"
context.lesson = get_current_lesson_details(lesson_number, context, True)
context.is_moderator = has_course_moderator_role()
instructor = is_instructor(context.course.name)
if not instructor and not has_course_moderator_role():
raise frappe.PermissionError(_("You do not have permission to access this page."))