Merge pull request #1996 from pateljannat/issues-170

fix: misc issues
This commit is contained in:
Jannat Patel
2026-01-16 11:34:29 +05:30
committed by GitHub
7 changed files with 296 additions and 102 deletions

View File

@@ -2050,3 +2050,9 @@ def get_upcoming_batches():
limit=4,
pluck="name",
)
@frappe.whitelist()
def delete_programming_exercise(exercise):
frappe.db.delete("LMS Programming Exercise Submission", {"exercise": exercise})
frappe.db.delete("LMS Programming Exercise", exercise)

View File

@@ -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."))