Merge branch 'MDL-34692' of git://github.com/raymondAntonio/moodle
authorSam Hemelryk <sam@moodle.com>
Tue, 11 Sep 2012 22:22:54 +0000 (10:22 +1200)
committerSam Hemelryk <sam@moodle.com>
Tue, 11 Sep 2012 22:22:54 +0000 (10:22 +1200)
1  2 
mod/assign/locallib.php

@@@ -4006,18 -3118,14 +4008,19 @@@ class assign 
      public function add_submission_form_elements(MoodleQuickForm $mform, stdClass $data) {
          global $USER;
  
 -        $submission = $this->get_user_submission($USER->id, false);
 +        // Team submissions.
 +        if ($this->get_instance()->teamsubmission) {
 +            $submission = $this->get_group_submission($USER->id, 0, false);
 +        } else {
 +            $submission = $this->get_user_submission($USER->id, false);
 +        }
  
 -        // submission statement
 +        // Submission statement.
          $adminconfig = $this->get_admin_config();
  
-         $requiresubmissionstatement = !empty($adminconfig->requiresubmissionstatement) ||
-                                             $this->get_instance()->requiresubmissionstatement;
+         $requiresubmissionstatement = (!empty($adminconfig->requiresubmissionstatement) ||
+                                        $this->get_instance()->requiresubmissionstatement) &&
+                                        !empty($adminconfig->submissionstatement);
  
          $draftsenabled = $this->get_instance()->submissiondrafts;