From f23463f8d60765f82ccd1a027bb89c2426869147 Mon Sep 17 00:00:00 2001 From: Anastasios Bithas Date: Sat, 4 Feb 2023 18:36:19 +0200 Subject: [PATCH] MDL-73642 mod_assign: Disable draft option if submission already made --- mod/assign/mod_form.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/assign/mod_form.php b/mod/assign/mod_form.php index 64fdde4b2fd..1ec86488d28 100644 --- a/mod/assign/mod_form.php +++ b/mod/assign/mod_form.php @@ -127,6 +127,9 @@ class mod_assign_mod_form extends moodleform_mod { $name = get_string('submissiondrafts', 'assign'); $mform->addElement('selectyesno', 'submissiondrafts', $name); $mform->addHelpButton('submissiondrafts', 'submissiondrafts', 'assign'); + if ($assignment->has_submissions_or_grades()) { + $mform->freeze('submissiondrafts'); + } $name = get_string('requiresubmissionstatement', 'assign'); $mform->addElement('selectyesno', 'requiresubmissionstatement', $name);