From 0968c90717af7d506d5247de22e30137d779582a Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 15 Jan 2026 15:09:59 +0530 Subject: [PATCH] fix: quiz shuffle and limit conditions --- lms/lms/doctype/lms_quiz/lms_quiz.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lms/lms/doctype/lms_quiz/lms_quiz.py b/lms/lms/doctype/lms_quiz/lms_quiz.py index f9cccd68..32fb0c8f 100644 --- a/lms/lms/doctype/lms_quiz/lms_quiz.py +++ b/lms/lms/doctype/lms_quiz/lms_quiz.py @@ -33,6 +33,9 @@ class LMSQuiz(Document): frappe.throw(_("Rows {0} have the duplicate questions.").format(frappe.bold(comma_and(rows)))) def validate_limit(self): + if not self.shuffle_questions and self.limit_questions_to: + self.limit_questions_to = 0 + if self.limit_questions_to and cint(self.limit_questions_to) >= len(self.questions): frappe.throw(_("Limit cannot be greater than or equal to the number of questions in the quiz."))