LMS: Saving Course Activity
diff --git a/erpnext/www/academy.py b/erpnext/www/academy.py
index 66874c6..9162b71 100644
--- a/erpnext/www/academy.py
+++ b/erpnext/www/academy.py
@@ -170,4 +170,16 @@
student = frappe.get_doc("Student", get_student_id(email))
return student.get_course_enrollments()
except:
- return None
\ No newline at end of file
+ return None
+
+@frappe.whitelist()
+def add_activity(enrollment, content_type, content):
+ activity = frappe.get_doc({
+ "doctype": "Course Activity",
+ "enrollment": enrollment,
+ "content_type": content_type,
+ "content": content,
+ "activity_date": frappe.utils.datetime.datetime.now()
+ })
+ activity.save()
+ frappe.db.commit()
\ No newline at end of file