and $this->isopen() // assignment not closed yet
and (empty($submission) or $submission->grade == -1) // not graded
and (empty($submission) or $submission->userid == $USER->id) // his/her own submission
- and $this->count_user_files($USER->id) < $this->assignment->var1) { // file limit not reached
+ and $this->count_user_files($USER->id) < $this->assignment->var1 // file limit not reached
+ and !$this->is_finalized($submission)) { // no uploading after final submission
return true;
} else {
return false;