MDL-37707 mod_assign: Prevent user from changing grouping in team submissions
authorFrederic Massart <fred@moodle.com>
Wed, 1 Oct 2014 03:23:46 +0000 (11:23 +0800)
committerFrederic Massart <fred@moodle.com>
Wed, 1 Oct 2014 03:27:44 +0000 (11:27 +0800)
mod/assign/mod_form.php

index 77f5567..d60896b 100644 (file)
@@ -155,6 +155,9 @@ class mod_assign_mod_form extends moodleform_mod {
         $mform->addElement('select', 'teamsubmissiongroupingid', $name, $options);
         $mform->addHelpButton('teamsubmissiongroupingid', 'teamsubmissiongroupingid', 'assign');
         $mform->disabledIf('teamsubmissiongroupingid', 'teamsubmission', 'eq', 0);
+        if ($assignment->has_submissions_or_grades()) {
+            $mform->freeze('teamsubmissiongroupingid');
+        }
 
         $mform->addElement('header', 'notifications', get_string('notifications', 'assign'));