From 6b5ddcd54a1f71da3c6eb9563041436670dfe4f9 Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Fri, 11 Jun 2021 13:57:42 +0530 Subject: [PATCH] fix: fixed error on saving exercises Removed the image generation when exercise is saved. The library used for exercises has changed and generating the image doesn't work any more. --- community/lms/doctype/exercise/exercise.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/community/lms/doctype/exercise/exercise.py b/community/lms/doctype/exercise/exercise.py index 98da02f4..9fb83621 100644 --- a/community/lms/doctype/exercise/exercise.py +++ b/community/lms/doctype/exercise/exercise.py @@ -3,12 +3,9 @@ import frappe from frappe.model.document import Document -from ..lms_sketch.livecode import livecode_to_svg +# from ..lms_sketch.livecode import livecode_to_svg class Exercise(Document): - def before_save(self): - self.image = livecode_to_svg(None, self.answer) - def get_user_submission(self): """Returns the latest submission for this user. """ @@ -42,8 +39,6 @@ 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, @@ -51,7 +46,6 @@ class Exercise(Document): course=self.course, lesson=self.lesson, batch=batch and batch.name, - image=image, solution=code) doc.insert(ignore_permissions=True)