Merge branch 'wip-mdl-27521-master' of git://github.com/phalacee/moodle
authorAparup Banerjee <aparup@moodle.com>
Tue, 8 Nov 2011 07:18:22 +0000 (15:18 +0800)
committerAparup Banerjee <aparup@moodle.com>
Tue, 8 Nov 2011 07:18:22 +0000 (15:18 +0800)
mod/assignment/type/upload/assignment.class.php

index c1d4ffd..6e24785 100644 (file)
@@ -918,9 +918,14 @@ class assignment_upload extends assignment_base {
     }
 
     function can_unfinalize($submission) {
+        if(is_bool($submission)) {
+            return false;
+        }
+
         if (!$this->drafts_tracked()) {
             return false;
         }
+
         if (has_capability('mod/assignment:grade', $this->context)
           and $this->isopen()
           and $this->is_finalized($submission)) {
@@ -932,6 +937,11 @@ class assignment_upload extends assignment_base {
 
     function can_finalize($submission) {
         global $USER;
+
+        if(is_bool($submission)) {
+            return false;
+        }
+
         if (!$this->drafts_tracked()) {
             return false;
         }