MDL-43628 mod_assign: fixed formatting of statement
authorSam Hemelryk <sam@moodle.com>
Wed, 19 Nov 2014 21:18:09 +0000 (10:18 +1300)
committerSam Hemelryk <sam@moodle.com>
Wed, 19 Nov 2014 21:18:28 +0000 (10:18 +1300)
mod/assign/locallib.php
mod/assign/styles.css
mod/assign/submissionconfirmform.php

index 2e3fec6..5fdb56e 100644 (file)
@@ -3739,7 +3739,13 @@ class assign {
 
         $submissionstatement = '';
         if (!empty($adminconfig->submissionstatement)) {
-            $submissionstatement = $adminconfig->submissionstatement;
+            // Format the submissino statement before its sent. We turn off para because this is going within
+            // a form element.
+            $options = array(
+                'context' => $this->get_context(),
+                'para' => false
+            );
+            $submissionstatement = format_text($adminconfig->submissionstatement, FORMAT_MOODLE, $options);
         }
 
         if ($mform == null) {
@@ -4996,7 +5002,13 @@ class assign {
 
         $submissionstatement = '';
         if (!empty($adminconfig->submissionstatement)) {
-            $submissionstatement = $adminconfig->submissionstatement;
+            // Format the submissino statement before its sent. We turn off para because this is going within
+            // a form element.
+            $options = array(
+                'context' => $this->get_context(),
+                'para' => false
+            );
+            $submissionstatement = format_text($adminconfig->submissionstatement, FORMAT_MOODLE, $options);
         }
 
         if ($mform == null) {
@@ -6196,9 +6208,15 @@ class assign {
 
             $submissionstatement = '';
             if (!empty($adminconfig->submissionstatement)) {
-                $submissionstatement = $adminconfig->submissionstatement;
+                // Format the submissino statement before its sent. We turn off para because this is going within
+                // a form element.
+                $options = array(
+                    'context' => $this->get_context(),
+                    'para' => false
+                );
+                $submissionstatement = format_text($adminconfig->submissionstatement, FORMAT_MOODLE, $options);
             }
-            $mform->addElement('checkbox', 'submissionstatement', '', '&nbsp;' . $submissionstatement);
+            $mform->addElement('checkbox', 'submissionstatement', '', $submissionstatement);
             $mform->addRule('submissionstatement', get_string('required'), 'required', null, 'client');
         }
 
index 868d48d..2ed075e 100644 (file)
 .path-mod-assign .gradingtable .menu-action img {
     display: none;
 }
+
+.path-mod-assign .editsubmissionform input[name="submissionstatement"] {
+    vertical-align: top;
+}
+.path-mod-assign .editsubmissionform label[for="id_submissionstatement"] {
+    display: inline-block;
+}
\ No newline at end of file
index 5790cb9..1508026 100644 (file)
@@ -47,7 +47,7 @@ class mod_assign_confirm_submission_form extends moodleform {
              $data) = $this->_customdata;
 
         if ($requiresubmissionstatement) {
-            $mform->addElement('checkbox', 'submissionstatement', '', '&nbsp;' . format_text($submissionstatement));
+            $mform->addElement('checkbox', 'submissionstatement', '', $submissionstatement);
             $mform->addRule('submissionstatement', get_string('required'), 'required', null, 'client');
         }