MDL-29400 Update the upload and uploadsingle assignment classes to so
authorGerard (Gerry) Caulfield <gerry@moodle.com>
Tue, 13 Dec 2011 21:54:10 +0000 (05:54 +0800)
committerGerard (Gerry) Caulfield <gerry@moodle.com>
Tue, 13 Dec 2011 21:54:10 +0000 (05:54 +0800)
that they only display the assignment submitted status when it has
actually been submitted.

mod/assignment/type/upload/assignment.class.php
mod/assignment/type/uploadsingle/assignment.class.php

index 6e24785..5c993f9 100644 (file)
@@ -1051,8 +1051,8 @@ class assignment_upload extends assignment_base {
             $editable = false;
         }
 
-        // If the user has submitted something add a bit more stuff
-        if ($submission) {
+        // If the user has submitted something add some related links and data
+        if ($submission->data2 == 'submitted') {
             // Add a view link to the settings nav
             $link = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id));
             $node->add(get_string('viewmysubmission', 'assignment'), $link, navigation_node::TYPE_SETTING);
index d0278ac..73ad517 100644 (file)
@@ -318,8 +318,8 @@ class assignment_uploadsingle extends assignment_base {
             $editable = false;
         }
 
-        // If the user has submitted something add a bit more stuff
-        if ($submission) {
+        // If the user has submitted something add some related links and data
+        if ($submission->numfiles) {
             // Add a view link to the settings nav
             $link = new moodle_url('/mod/assignment/view.php', array('id'=>$this->cm->id));
             $node->add(get_string('viewmysubmission', 'assignment'), $link, navigation_node::TYPE_SETTING);