assignment MDL-24373 removed file count check to display button to manage assignment...
authorAparup Banerjee <nebgor@gmail.com>
Fri, 24 Sep 2010 07:09:42 +0000 (07:09 +0000)
committerAparup Banerjee <nebgor@gmail.com>
Fri, 24 Sep 2010 07:09:42 +0000 (07:09 +0000)
mod/assignment/type/upload/assignment.class.php

index 1e47548..be235ed 100644 (file)
@@ -88,6 +88,9 @@ class assignment_upload extends assignment_base {
 
             if (has_capability('mod/assignment:submit', $this->context)) {
                 $this->view_upload_form();
 
             if (has_capability('mod/assignment:submit', $this->context)) {
                 $this->view_upload_form();
+                debugging('yes mod/assignment:submit');
+            } else {
+                debugging('no mod/assignment:submit');
             }
 
             if ($this->notes_allowed()) {
             }
 
             if ($this->notes_allowed()) {
@@ -187,10 +190,12 @@ class assignment_upload extends assignment_base {
 
         if ($this->is_finalized($submission)) {
             // no uploading
 
         if ($this->is_finalized($submission)) {
             // no uploading
+            debugging('finalized');
             return;
         }
 
         if ($this->can_upload_file($submission)) {
             return;
         }
 
         if ($this->can_upload_file($submission)) {
+            debugging('can upload');
             $fs = get_file_storage();
             // edit files in another page
             if ($submission) {
             $fs = get_file_storage();
             // edit files in another page
             if ($submission) {
@@ -203,8 +208,9 @@ class assignment_upload extends assignment_base {
                 $str = get_string('uploadfiles', 'assignment');
             }
             echo $OUTPUT->single_button(new moodle_url('/mod/assignment/type/upload/upload.php', array('contextid'=>$this->context->id, 'userid'=>$USER->id)), $str, 'get');
                 $str = get_string('uploadfiles', 'assignment');
             }
             echo $OUTPUT->single_button(new moodle_url('/mod/assignment/type/upload/upload.php', array('contextid'=>$this->context->id, 'userid'=>$USER->id)), $str, 'get');
+        } else {
+            debugging('cant upload');
         }
         }
-
     }
 
     function view_notes() {
     }
 
     function view_notes() {
@@ -861,8 +867,7 @@ class assignment_upload extends assignment_base {
 
         if (is_enrolled($this->context, $USER, 'mod/assignment:submit')
           and $this->isopen()                                                 // assignment not closed yet
 
         if (is_enrolled($this->context, $USER, 'mod/assignment:submit')
           and $this->isopen()                                                 // assignment not closed yet
-          and (empty($submission) or ($submission->userid == $USER->id        // his/her own submission
-            and $this->count_user_files($submission->id) <= $this->assignment->var1))    // file limit not exceeded
+          and (empty($submission) or ($submission->userid == $USER->id))        // his/her own submission
           and !$this->is_finalized($submission)) {                            // no uploading after final submission
             return true;
         } else {
           and !$this->is_finalized($submission)) {                            // no uploading after final submission
             return true;
         } else {