MDL-36587 Assignment: Hide Download All links when no submission have been made
authorKirill Astashov <kirill.astashov@netspot.com.au>
Wed, 28 Nov 2012 02:23:05 +0000 (12:53 +1030)
committerDamyon Wiese <damyon@moodle.com>
Tue, 11 Dec 2012 03:25:05 +0000 (11:25 +0800)
mod/assign/locallib.php

index d5db942..269c4c5 100644 (file)
@@ -2303,7 +2303,7 @@ class assign {
             $gradebookurl = '/grade/report/grader/index.php?id=' . $this->get_course()->id;
             $links[$gradebookurl] = get_string('viewgradebook', 'assign');
         }
-        if ($this->is_any_submission_plugin_enabled()) {
+        if ($this->is_any_submission_plugin_enabled() && $this->count_submissions()) {
             $downloadurl = '/mod/assign/view.php?id=' . $this->get_course_module()->id . '&action=downloadall';
             $links[$downloadurl] = get_string('downloadall', 'assign');
         }