diff --git a/erpnext/education/doctype/course_enrollment/course_enrollment.py b/erpnext/education/doctype/course_enrollment/course_enrollment.py
index b57745f..9508636 100644
--- a/erpnext/education/doctype/course_enrollment/course_enrollment.py
+++ b/erpnext/education/doctype/course_enrollment/course_enrollment.py
@@ -30,4 +30,47 @@
 			"program_enrollment": self.program_enrollment
 		})
 		if enrollment:
-			frappe.throw(_("Student is already enrolled."))
\ No newline at end of file
+			frappe.throw(_("Student is already enrolled."))
+
+	def add_quiz_activity(self, quiz_name, quiz_response,answers, score, status):
+		result = {k: ('Correct' if v else 'Wrong') for k,v in answers.items()}
+		result_data = []
+		for key in answers:
+			item = {}
+			item['question'] = key
+			item['quiz_result'] = result[key]
+			try:
+				if isinstance(quiz_response[key], list):
+					item['selected_option'] = ', '.join(frappe.get_value('Options', res, 'option') for res in quiz_response[key])
+				else:
+					item['selected_option'] = frappe.get_value('Options', quiz_response[key], 'option')
+			except KeyError:
+				item['selected_option'] = "Unattempted"
+			result_data.append(item)
+
+		quiz_activity = frappe.get_doc({
+			"doctype": "Quiz Activity",
+			"enrollment": self.name,
+			"quiz": quiz_name,
+			"activity_date": frappe.utils.datetime.datetime.now(),
+			"result": result_data,
+			"score": score,
+			"status": status
+			}).insert()
+
+	def add_activity(self, content_type, content):
+		if check_activity_exists(self.name, content_type, content):
+			pass
+		else:
+			activity = frappe.get_doc({
+				"doctype": "Course Activity",
+				"enrollment": self.name,
+				"content_type": content_type,
+				"content": content,
+				"activity_date": frappe.utils.datetime.datetime.now()
+				})
+			activity.insert()
+
+def check_activity_exists(enrollment, content_type, content):
+	activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment, 'content_type': content_type, 'content': content})
+	return bool(activity)
\ No newline at end of file
diff --git a/erpnext/education/utils.py b/erpnext/education/utils.py
index 93b44e9..d7b768e 100644
--- a/erpnext/education/utils.py
+++ b/erpnext/education/utils.py
@@ -121,10 +121,6 @@
 	student = get_current_student()
 	return student.enroll_in_course(course_name=course_name, program_enrollment=get_program_enrollment(program_name))
 
-def check_activity_exists(enrollment, content_type, content):
-	activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment, 'content_type': content_type, 'content': content})
-	return bool(activity)
-
 def check_content_completion(content_name, content_type, enrollment_name):
 	activity = frappe.get_all("Course Activity", filters={'enrollment': enrollment_name, 'content_type': content_type, 'content': content_name})
 	if activity:
diff --git a/erpnext/www/lms.py b/erpnext/www/lms.py
index f669543..69424e1 100644
--- a/erpnext/www/lms.py
+++ b/erpnext/www/lms.py
@@ -107,38 +107,13 @@
 	quiz_response = json.loads(quiz_response)
 	quiz = frappe.get_doc("Quiz", quiz_name)
 	answers, score, status = quiz.evaluate(quiz_response, quiz_name)
+	print(answers)
 
-	result = {k: ('Correct' if v else 'Wrong') for k,v in answers.items()}
-	result_data = []
-	for key in answers:
-		item = {}
-		item['question'] = key
-		item['quiz_result'] = result[key]
-		try:
-			if isinstance(quiz_response[key], list):
-				item['selected_option'] = ', '.join(frappe.get_value('Options', res, 'option') for res in quiz_response[key])
-			else:
-				item['selected_option'] = frappe.get_value('Options', quiz_response[key], 'option')
-		except:
-			item['selected_option'] = "Unattempted"
-		result_data.append(item)
+	course_enrollment = utils.get_course_enrollment(course)
+	if course_enrollment:
+		course_enrollment.add_quiz_activity(quiz_name, quiz_response, answers, score, status)
 
-	add_quiz_activity(course, quiz_name, result_data, score, status)
-	return(score)
-
-def add_quiz_activity(course, quiz_name, result_data, score, status):
-	if not utils.get_current_student():
-		return None
-	enrollment = utils.get_course_enrollment(course).name
-	quiz_activity = frappe.get_doc({
-		"doctype": "Quiz Activity",
-		"enrollment": enrollment,
-		"quiz": quiz_name,
-		"activity_date": frappe.utils.datetime.datetime.now(),
-		"result": result_data,
-		"score": score,
-		"status": status
-		}).insert()
+	return score
 
 @frappe.whitelist()
 def enroll_in_program(program_name):
@@ -148,24 +123,13 @@
 	program_enrollment = student.enroll_in_program(program_name)
 	return program_name
 
-# Academty Activity
+# Academdy Activity
 @frappe.whitelist()
 def add_activity(course, content_type, content):
 	if not utils.get_current_student():
 		return
 	enrollment = utils.get_course_enrollment(course)
-	if(utils.check_activity_exists(enrollment.name, content_type, content)):
-		pass
-	else:
-		activity = frappe.get_doc({
-			"doctype": "Course Activity",
-			"enrollment": enrollment.name,
-			"content_type": content_type,
-			"content": content,
-			"activity_date": frappe.utils.datetime.datetime.now()
-			})
-		activity.save()
-		frappe.db.commit()
+	enrollment.add_activity(content_type, content)
 
 @frappe.whitelist()
 def get_student_course_details(course_name, program_name):
