MDL-43628 mod_assign: fixed formatting of statement

This commit is contained in:
Sam Hemelryk 2014-11-20 10:18:09 +13:00
parent 4067991016
commit 2949dedcda
3 changed files with 30 additions and 5 deletions

View 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', '', ' ' . $submissionstatement);
$mform->addElement('checkbox', 'submissionstatement', '', $submissionstatement);
$mform->addRule('submissionstatement', get_string('required'), 'required', null, 'client');
}

View File

@ -301,3 +301,10 @@
.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;
}

View File

@ -47,7 +47,7 @@ class mod_assign_confirm_submission_form extends moodleform {
$data) = $this->_customdata;
if ($requiresubmissionstatement) {
$mform->addElement('checkbox', 'submissionstatement', '', ' ' . format_text($submissionstatement));
$mform->addElement('checkbox', 'submissionstatement', '', $submissionstatement);
$mform->addRule('submissionstatement', get_string('required'), 'required', null, 'client');
}