Merge branch 'MDL-30481_m23' of git://github.com/rwijaya/moodle into MOODLE_23_STABLE
authorAparup Banerjee <aparup@moodle.com>
Tue, 5 Mar 2013 04:56:40 +0000 (12:56 +0800)
committerAparup Banerjee <aparup@moodle.com>
Tue, 5 Mar 2013 04:56:40 +0000 (12:56 +0800)
1  2 
mod/assignment/type/upload/assignment.class.php

@@@ -256,8 -256,11 +256,11 @@@ class assignment_upload extends assignm
              echo '</form>';
              echo '</div>';
          } else if (!$this->isopen()) {
-             echo $OUTPUT->heading(get_string('nomoresubmissions','assignment'), 3);
+             if ($this->assignment->timeavailable < time()) {
+                 echo $OUTPUT->heading(get_string('closedassignment','assignment'), 3);
+             } else {
+                 echo $OUTPUT->heading(get_string('futureaassignment','assignment'), 3);
+             }
          } else if ($this->drafts_tracked() and $state = $this->is_finalized($submission)) {
              if ($state == ASSIGNMENT_STATUS_SUBMITTED) {
                  echo $OUTPUT->heading(get_string('submitedformarking','assignment'), 3);
       * @return bool                 Indicates if the submission was found to be complete
       */
      public function is_submitted_with_required_data($submission) {
 -        return ($submission->timemodified AND $submission->data2);
 +        if ($this->drafts_tracked()) {
 +            $submitted = $submission->timemodified > 0 &&
 +                         $submission->data2 == ASSIGNMENT_STATUS_SUBMITTED;
 +        } else {
 +            $submitted = $submission->numfiles > 0;
 +        }
 +        return $submitted;
      }
  }