feat: added image to exercise submission

This commit is contained in:
Anand Chitipothu
2021-05-21 13:10:54 +05:30
parent 632693c9f8
commit a2b856aaf8
2 changed files with 12 additions and 2 deletions

View File

@@ -43,6 +43,8 @@ class Exercise(Document):
course = frappe.get_doc("LMS Course", self.course)
batch = course.get_student_batch(user)
image = livecode_to_svg(None, code)
doc = frappe.get_doc(
doctype="Exercise Submission",
exercise=self.name,
@@ -50,6 +52,7 @@ class Exercise(Document):
course=self.course,
lesson=self.lesson,
batch=batch and batch.name,
image=image,
solution=code)
doc.insert(ignore_permissions=True)
return doc

View File

@@ -10,7 +10,8 @@
"exercise_title",
"course",
"batch",
"lesson"
"lesson",
"image"
],
"fields": [
{
@@ -54,11 +55,17 @@
"fieldtype": "Link",
"label": "Lesson",
"options": "Lesson"
},
{
"fieldname": "image",
"fieldtype": "Code",
"label": "Image",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-05-20 13:30:16.349278",
"modified": "2021-05-21 11:28:45.833018",
"modified_by": "Administrator",
"module": "LMS",
"name": "Exercise Submission",