mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-20 13:39:18 +00:00
Modified question.py
This commit is contained in:
@@ -10,7 +10,7 @@ class Question(Document):
|
|||||||
|
|
||||||
def get_answer(self):
|
def get_answer(self):
|
||||||
options = self.get_all_children()
|
options = self.get_all_children()
|
||||||
answers = [item.option for item in options if item.is_correct == True]
|
answers = [item.name for item in options if item.is_correct == True]
|
||||||
if len(answers) == 0:
|
if len(answers) == 0:
|
||||||
frappe.throw("No correct answer is set for {0}".format(self.name))
|
frappe.throw("No correct answer is set for {0}".format(self.name))
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user