MDL-33850: Assignment: Change text to "Add submission" before anything has been submitted
[moodle.git] / mod / assign / renderer.php
index 087f4fe..ab3af8a 100644 (file)
@@ -467,8 +467,13 @@ class mod_assign_renderer extends plugin_renderer_base {
 
         // 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) {