Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-38254 Assignment Module: add avaialble message to all assignment …

…types
  • Loading branch information...
commit 2612e21bd4450bf94b7e5ac259e2d0b0b3bbcf7b 1 parent d8201d4
rwijaya rwijaya authored
6 mod/assignment/lib.php
@@ -165,6 +165,12 @@ function view() {
165 165
166 166 $this->view_dates();
167 167
  168 + if ($this->isopen() && $this->assignment->timedue > 0 && $this->assignment->timedue < time()) {
  169 + echo $OUTPUT->heading(get_string('closedassignment','assignment'), 3);
  170 + } else if ($this->assignment->timeavailable > time()) {
  171 + echo $OUTPUT->heading(get_string('futureaassignment','assignment'), 3);
  172 + }
  173 +
168 174 $this->view_feedback();
169 175
170 176 $this->view_footer();
4 mod/assignment/type/online/assignment.class.php
@@ -127,7 +127,9 @@ function view() {
127 127 $button->render();
128 128 }
129 129 } else if ($this->isopen()){ //fix for #4206
130   - echo '<div style="text-align:center">'.get_string('emptysubmission', 'assignment').'</div>';
  130 + echo $OUTPUT->heading(get_string('emptysubmission','assignment'), 3);
  131 + } else if ($this->assignment->timeavailable > time()) {
  132 + echo $OUTPUT->heading(get_string('futureaassignment','assignment'), 3);
131 133 }
132 134 }
133 135 echo $OUTPUT->box_end();
8 mod/assignment/type/uploadsingle/assignment.class.php
@@ -85,8 +85,12 @@ function view() {
85 85 }
86 86 }
87 87
88   - if (is_enrolled($this->context, $USER, 'mod/assignment:submit') && $this->isopen() && (!$filecount || $this->assignment->resubmit || !$submission->timemarked)) {
89   - $this->view_upload_form();
  88 + if (is_enrolled($this->context, $USER, 'mod/assignment:submit') && (!$filecount || $this->assignment->resubmit || !$submission->timemarked)) {
  89 + if ($this->isopen()) {
  90 + $this->view_upload_form();
  91 + } else if ($this->assignment->timeavailable > time()) {
  92 + echo $OUTPUT->heading(get_string('futureaassignment','assignment'), 3);
  93 + }
90 94 }
91 95
92 96 $this->view_footer();

0 comments on commit 2612e21

Please sign in to comment.
Something went wrong with that request. Please try again.