fix: assignment renderer
This commit is contained in:
@@ -313,6 +313,7 @@ def render_html(lesson):
|
|||||||
if lesson.question:
|
if lesson.question:
|
||||||
assignment = "{{ Assignment('" + lesson.question + "-" + lesson.file_type + "') }}"
|
assignment = "{{ Assignment('" + lesson.question + "-" + lesson.file_type + "') }}"
|
||||||
text = text + assignment
|
text = text + assignment
|
||||||
|
|
||||||
return markdown_to_html(text)
|
return markdown_to_html(text)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -183,21 +183,20 @@ def video_renderer(src):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def assignment_renderer(name):
|
def assignment_renderer(detail):
|
||||||
|
supported_types = {
|
||||||
"""supported_types = {
|
"Document": ".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||||
"Document": ".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
"PDF": ".pdf",
|
||||||
"PDF": ".pdf",
|
"Image": ".png, .jpg, .jpeg",
|
||||||
"Image": ".png, .jpg, .jpeg",
|
"Video": "video/*",
|
||||||
"Video": "video/*",
|
|
||||||
}
|
}
|
||||||
question = detail.split("-")[0]
|
question = detail.split("-")[0]
|
||||||
file_type = detail.split("-")[1]
|
file_type = detail.split("-")[1]
|
||||||
accept = supported_types[file_type] if file_type else ""
|
accept = supported_types[file_type] if file_type else ""
|
||||||
return frappe.render_template(
|
return frappe.render_template(
|
||||||
"templates/assignment.html",
|
"templates/assignment.html",
|
||||||
{"question": question, "accept": accept, "file_type": file_type},
|
{"question": question, "accept": accept, "file_type": file_type},
|
||||||
)"""
|
)
|
||||||
|
|
||||||
|
|
||||||
def show_custom_signup():
|
def show_custom_signup():
|
||||||
|
|||||||
Reference in New Issue
Block a user