From e495958b7cff57a6639013d0a1670156486ebe54 Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Mon, 19 May 2025 16:00:07 +0100 Subject: [PATCH] MDL-58001 mod_assign: Return early if no grade items are available --- public/mod/assign/locallib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/mod/assign/locallib.php b/public/mod/assign/locallib.php index 9318496d25a..66b8a9c13c2 100644 --- a/public/mod/assign/locallib.php +++ b/public/mod/assign/locallib.php @@ -8794,6 +8794,9 @@ class assign { $shouldreopen = true; break; case ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS: + if (!is_gradable($this->course->id, 'mod', 'assign', $this->get_instance()->id)) { + return false; + } // Check the gradetopass from the gradebook. $gradeitem = $this->get_grade_item(); if ($gradeitem) {