fix: added livecode editor in community

This commit is contained in:
pateljannat
2021-06-24 16:38:02 +05:30
parent 56d8a72a7d
commit 5a7afb3092
6 changed files with 265 additions and 28 deletions

View File

@@ -67,6 +67,25 @@ class ProfileTab:
"""
raise NotImplementedError()
class LiveCodeExtension(PageExtension):
def render_header(self):
livecode_url = frappe.get_value("LMS Settings", None, "livecode_url")
context = {
"livecode_url": livecode_url
}
return frappe.render_template(
"templates/livecode/extension_header.html",
context)
def render_footer(self):
livecode_url = frappe.get_value("LMS Settings", None, "livecode_url")
context = {
"livecode_url": livecode_url
}
return frappe.render_template(
"templates/livecode/extension_footer.html",
context)
def quiz_renderer(quiz_name):
quiz = frappe.get_doc("LMS Quiz", quiz_name)
context = dict(quiz=quiz)