MDL-33850: Assignment: Change text to "Add submission" before anything has been submitted
authorDamyon Wiese <damyon.wiese@netspot.com.au>
Wed, 20 Jun 2012 02:19:31 +0000 (10:19 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 21 Jun 2012 06:48:53 +0000 (14:48 +0800)
AMOS BEGIN
 CPY [addsubmission,mod_assignment],[addsubmission,mod_assign]
AMOS END

mod/assign/lang/en/assign.php
mod/assign/renderer.php

index bfe387b..0e19bf4 100644 (file)
@@ -22,6 +22,7 @@
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  */
 
+$string['addsubmission'] = 'Add submission';
 $string['allowsubmissions'] = 'Allow the user to continue making submissions to this assignment.';
 $string['allowsubmissionsshort'] = 'Allow submission changes';
 $string['allowsubmissionsfromdate'] = 'Allow submissions from';
 $string['allowsubmissions'] = 'Allow the user to continue making submissions to this assignment.';
 $string['allowsubmissionsshort'] = 'Allow submission changes';
 $string['allowsubmissionsfromdate'] = 'Allow submissions from';
index 087f4fe..ab3af8a 100644 (file)
@@ -467,8 +467,13 @@ class mod_assign_renderer extends plugin_renderer_base {
 
         // links
         if ($status->canedit) {
 
         // links
         if ($status->canedit) {
-            $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php',
-                array('id' => $status->coursemoduleid, 'action' => 'editsubmission')), get_string('editsubmission', 'assign'), 'get');
+            if (!$status->submission) {
+                $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php',
+                    array('id' => $status->coursemoduleid, 'action' => 'editsubmission')), get_string('addsubmission', 'assign'), 'get');
+            } else {
+                $o .= $this->output->single_button(new moodle_url('/mod/assign/view.php',
+                    array('id' => $status->coursemoduleid, 'action' => 'editsubmission')), get_string('editsubmission', 'assign'), 'get');
+            }
         }
 
         if ($status->cansubmit) {
         }
 
         if ($status->cansubmit) {