fix: assignment renderer

This commit is contained in:
Jannat Patel
2023-08-31 23:32:46 +05:30
parent ffd9d56896
commit ce09f27373
2 changed files with 10 additions and 10 deletions

View File

@@ -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)

View File

@@ -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():