From b9509a1e454e00e065b473bb1415f0b40faec899 Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Tue, 26 Feb 2013 17:38:55 +0800 Subject: [PATCH] MDL-30481 Advanced upload assignment: Fixed assignment available date string to appropriately identify past or future availability --- mod/assignment/lang/en/assignment.php | 2 ++ mod/assignment/type/upload/assignment.class.php | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/assignment/lang/en/assignment.php b/mod/assignment/lang/en/assignment.php index 7aef1ae676dc4..7f6ed43cd5ca6 100644 --- a/mod/assignment/lang/en/assignment.php +++ b/mod/assignment/lang/en/assignment.php @@ -58,6 +58,7 @@ $string['cannotdeletefiles'] = 'An error occurred and files could not be deleted'; $string['cannotviewassignment'] = 'You can not view this assignment'; $string['changegradewarning'] = 'This assignment has graded submissions and changing the grade will not automatically re-calculate existing submission grades. You must re-grade all existing submissions, if you wish to change the grade.'; +$string['closedassignment'] = 'The submission date for this assignment has been closed.'; $string['comment'] = 'Comment'; $string['commentinline'] = 'Comment inline'; $string['commentinline_help'] = 'If enabled, the submission text will be copied into the feedback comment field during grading, making it easier to comment inline (using a different colour, perhaps) or to edit the original text.'; @@ -105,6 +106,7 @@ $string['feedbackupdated'] = 'Submissions feedback updated for {$a} people'; $string['finalize'] = 'Prevent submission updates'; $string['finalizeerror'] = 'An error occurred and that submission could not be finalised'; +$string['futureaassignment'] = 'This assignment is not yet available.'; $string['graded'] = 'Graded'; $string['guestnosubmit'] = 'Sorry, guests are not allowed to submit an assignment. You have to log in/ register before you can submit your answer.'; $string['guestnoupload'] = 'Sorry, guests are not allowed to upload'; diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index f9b93d4762e3a..50265d667a20c 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -184,8 +184,11 @@ function view_final_submission() { echo ''; echo ''; } 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);