Skip to content
Browse files

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

…types
  • Loading branch information...
1 parent d8201d4 commit 2612e21bd4450bf94b7e5ac259e2d0b0b3bbcf7b @rwijaya rwijaya committed Apr 4, 2013
View
6 mod/assignment/lib.php
@@ -165,6 +165,12 @@ function view() {
$this->view_dates();
+ if ($this->isopen() && $this->assignment->timedue > 0 && $this->assignment->timedue < time()) {
+ echo $OUTPUT->heading(get_string('closedassignment','assignment'), 3);
+ } else if ($this->assignment->timeavailable > time()) {
+ echo $OUTPUT->heading(get_string('futureaassignment','assignment'), 3);
+ }
+
$this->view_feedback();
$this->view_footer();
View
4 mod/assignment/type/online/assignment.class.php
@@ -127,7 +127,9 @@ function view() {
$button->render();
}
} else if ($this->isopen()){ //fix for #4206
- echo '<div style="text-align:center">'.get_string('emptysubmission', 'assignment').'</div>';
+ echo $OUTPUT->heading(get_string('emptysubmission','assignment'), 3);
+ } else if ($this->assignment->timeavailable > time()) {
+ echo $OUTPUT->heading(get_string('futureaassignment','assignment'), 3);
}
}
echo $OUTPUT->box_end();
View
8 mod/assignment/type/uploadsingle/assignment.class.php
@@ -85,8 +85,12 @@ function view() {
}
}
- if (is_enrolled($this->context, $USER, 'mod/assignment:submit') && $this->isopen() && (!$filecount || $this->assignment->resubmit || !$submission->timemarked)) {
- $this->view_upload_form();
+ if (is_enrolled($this->context, $USER, 'mod/assignment:submit') && (!$filecount || $this->assignment->resubmit || !$submission->timemarked)) {
+ if ($this->isopen()) {
+ $this->view_upload_form();
+ } else if ($this->assignment->timeavailable > time()) {
+ echo $OUTPUT->heading(get_string('futureaassignment','assignment'), 3);
+ }
}
$this->view_footer();

0 comments on commit 2612e21

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