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

@@ -70,7 +70,10 @@ class LMSBatch(Document):
def send_confirmation_mail(self):
for student in self.students:
if not student.confirmation_email_sent:
outgoing_email_account = frappe.get_cached_value(
"Email Account", {"default_outgoing": 1, "enable_outgoing": 1}, "name"
)
if not student.confirmation_email_sent and outgoing_email_account:
self.send_mail(student)
student.confirmation_email_sent = 1

View File

@@ -1758,12 +1758,17 @@ def get_lesson_creation_details(course, chapter, lesson):
)
if lesson_name:
lesson_details = frappe.db.get_value("Course Lesson", lesson_name, [""])
lesson_details = frappe.db.get_value(
"Course Lesson",
lesson_name,
["name", "title", "include_in_preview", "body", "content", "instructor_notes"],
as_dict=1,
)
return {
"course_title": frappe.db.get_value("LMS Course", course, "title"),
"chapter": frappe.db.get_value(
"Course Chapter", chapter_name, ["title", "name"], as_dict=True
),
"lesson": lesson_name if lesson_name else None,
"lesson": lesson_details if lesson_name else None,
}