MDL-36655: Assignment - do not add empty group to grading form when there is only...
authorDamyon Wiese <damyon.wiese@netspot.com.au>
Fri, 16 Nov 2012 03:00:05 +0000 (11:00 +0800)
committerDamyon Wiese <damyon.wiese@netspot.com.au>
Fri, 16 Nov 2012 03:00:05 +0000 (11:00 +0800)
mod/assign/locallib.php

index 1e24886..3d44847 100644 (file)
@@ -3050,7 +3050,9 @@ class assign {
         if (!$last){
             $buttonarray[] = $mform->createElement('submit', 'nosaveandnext', get_string('nosavebutnext', 'assign'));
         }
-        $mform->addGroup($buttonarray, 'navar', '', array(' '), false);
+        if (!empty($buttonarray)) {
+            $mform->addGroup($buttonarray, 'navar', '', array(' '), false);
+        }
     }