Permalink
Browse files

MDL-38267 assign: No Submit button after cut-off date

Conflicts:

	mod/assign/locallib.php
	mod/assign/tests/locallib_test.php
  • Loading branch information...
prateeksachan authored and damyon committed May 8, 2013
1 parent a7f94ca commit 30d3f1d2205721a578281a18cc118abab922b2ea
Showing with 7 additions and 1 deletion.
  1. +7 −1 mod/assign/locallib.php
View
@@ -2902,7 +2902,7 @@ public function view_student_summary($user, $showlinks) {
}
}
- $showsubmit = ($submission || $teamsubmission) && $showlinks;
+ $showsubmit = ($submission || $teamsubmission) && $showlinks && $this->submissions_open($user->id);
if ($teamsubmission && ($teamsubmission->status == ASSIGN_SUBMISSION_STATUS_SUBMITTED)) {
$showsubmit = false;
}
@@ -3577,6 +3577,9 @@ private function process_submit_for_grading($mform) {
require_once($CFG->dirroot . '/mod/assign/submissionconfirmform.php');
require_sesskey();
+ if (!$this->submissions_open()) {
+ return $this->view_student_error_message();
+ }
$data = new stdClass();
$adminconfig = $this->get_admin_config();
$requiresubmissionstatement = (!empty($adminconfig->requiresubmissionstatement) ||
@@ -4028,6 +4031,9 @@ private function process_save_submission(&$mform, &$notices) {
// Need submit permission to submit an assignment.
require_capability('mod/assign:submit', $this->context);
require_sesskey();
+ if (!$this->submissions_open()) {
+ return $this->view_student_error_message();
+ }
$data = new stdClass();
$mform = new mod_assign_submission_form(null, array($this, $data));

0 comments on commit 30d3f1d

Please sign in to comment.