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