MDL-50523 mod_assign: Conditionally disable activity setting
authorAndrew Hancox <andrewdchancox@googlemail.com>
Wed, 1 Jul 2015 14:47:42 +0000 (15:47 +0100)
committerAndrew Hancox <andrewdchancox@googlemail.com>
Mon, 20 Jul 2015 18:45:02 +0000 (19:45 +0100)
On activity settings form if "Students submit in groups" is set to no then
disable "Require group to make submission" setting.

mod/assign/mod_form.php

index b5c2757..412f72f 100644 (file)
@@ -144,6 +144,7 @@ class mod_assign_mod_form extends moodleform_mod {
             'preventsubmissionnotingroup',
             'assign');
         $mform->setType('preventsubmissionnotingroup', PARAM_BOOL);
+        $mform->disabledIf('preventsubmissionnotingroup', 'teamsubmission', 'eq', 0);
 
         $name = get_string('requireallteammemberssubmit', 'assign');
         $mform->addElement('selectyesno', 'requireallteammemberssubmit', $name);