From 3db4e0112fef48480884f377e2d876d47287e727 Mon Sep 17 00:00:00 2001 From: aparup Date: Tue, 27 Jul 2010 08:16:40 +0000 Subject: [PATCH] assignment MDL-22609 notice when no submission yet in single upload grading. - fixed. --- mod/assignment/type/uploadsingle/assignment.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/assignment/type/uploadsingle/assignment.class.php b/mod/assignment/type/uploadsingle/assignment.class.php index 697ea93034f..a205acea51d 100644 --- a/mod/assignment/type/uploadsingle/assignment.class.php +++ b/mod/assignment/type/uploadsingle/assignment.class.php @@ -193,7 +193,10 @@ class assignment_uploadsingle extends assignment_base { } $submission = $this->get_submission($USER->id); - $filecount = $this->count_user_files($submission->id); + $filecount = 0; + if ($submission) { + $filecount = $this->count_user_files($submission->id); + } if ($this->isopen() && (!$filecount || $this->assignment->resubmit || !$submission->timemarked)) { if ($submission = $this->get_submission($USER->id)) { //TODO: change later to ">= 0", to prevent resubmission when graded 0