Permalink
Browse files

MDL-34692: Fix the assignment submission agreement will not be visibl…

…e if the submission statement is empty
  • Loading branch information...
1 parent d71c486 commit a9b94affd4b3b7f9c02a28d471907a047f059849 Raymond Wijaya committed Aug 16, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 mod/assign/locallib.php
View
@@ -2003,8 +2003,9 @@ private function check_submit_for_grading($mform) {
$data = new stdClass();
$adminconfig = $this->get_admin_config();
- $requiresubmissionstatement = !empty($adminconfig->requiresubmissionstatement) ||
- $this->get_instance()->requiresubmissionstatement;
+ $requiresubmissionstatement = (!empty($adminconfig->requiresubmissionstatement) ||
+ $this->get_instance()->requiresubmissionstatement) &&
+ !empty($adminconfig->submissionstatement);
$submissionstatement = '';
if (!empty($adminconfig->submissionstatement)) {
@@ -2533,8 +2534,9 @@ private function process_submit_for_grading($mform) {
$data = new stdClass();
$adminconfig = $this->get_admin_config();
- $requiresubmissionstatement = !empty($adminconfig->requiresubmissionstatement) ||
- $this->get_instance()->requiresubmissionstatement;
+ $requiresubmissionstatement = (!empty($adminconfig->requiresubmissionstatement) ||
+ $this->get_instance()->requiresubmissionstatement) &&
+ !empty($adminconfig->submissionstatement);
$submissionstatement = '';
if (!empty($adminconfig->submissionstatement)) {
@@ -3121,8 +3123,9 @@ public function add_submission_form_elements(MoodleQuickForm $mform, stdClass $d
// submission statement
$adminconfig = $this->get_admin_config();
- $requiresubmissionstatement = !empty($adminconfig->requiresubmissionstatement) ||
- $this->get_instance()->requiresubmissionstatement;
+ $requiresubmissionstatement = (!empty($adminconfig->requiresubmissionstatement) ||
+ $this->get_instance()->requiresubmissionstatement) &&
+ !empty($adminconfig->submissionstatement);
$draftsenabled = $this->get_instance()->submissiondrafts;

0 comments on commit a9b94af

Please sign in to comment.