feat: text editor for lesson body
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
},
|
||||
{
|
||||
"fieldname": "body",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"fieldtype": "Text Editor",
|
||||
"ignore_xss_filter": 1,
|
||||
"label": "Body",
|
||||
"reqd": 1
|
||||
@@ -135,7 +135,7 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2022-12-28 16:01:42.191123",
|
||||
"modified": "2023-04-05 12:42:16.926753",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Course Lesson",
|
||||
|
||||
@@ -269,6 +269,7 @@ def get_progress(course, lesson):
|
||||
|
||||
|
||||
def render_html(lesson):
|
||||
print(lesson.body)
|
||||
youtube = lesson.youtube
|
||||
quiz_id = lesson.quiz_id
|
||||
body = lesson.body
|
||||
|
||||
@@ -49,4 +49,5 @@ lms.patches.v0_0.rename_community_to_users #06-01-2023
|
||||
lms.patches.v0_0.video_embed_link
|
||||
lms.patches.v0_0.rename_exercise_doctype
|
||||
lms.patches.v0_0.add_question_type
|
||||
lms.patches.v0_0.add_evaluator_to_assignment
|
||||
lms.patches.v0_0.add_evaluator_to_assignment
|
||||
lms.patches.v0_0.convert_lesson_markdown_to_html #05-04-2023
|
||||
12
lms/patches/v0_0/convert_lesson_markdown_to_html.py
Normal file
12
lms/patches/v0_0/convert_lesson_markdown_to_html.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import frappe
|
||||
from lms.lms.md import markdown_to_html
|
||||
|
||||
|
||||
def execute():
|
||||
lessons = frappe.get_all("Course Lesson", fields=["name", "body"])
|
||||
|
||||
for lesson in lessons:
|
||||
html = markdown_to_html(lesson.body)
|
||||
frappe.db.set_value("Course Lesson", lesson.name, "body", html)
|
||||
|
||||
frappe.reload_doc("lms", "doctype", "course_lesson")
|
||||
Reference in New Issue
Block a user