MDL-39369: Lesson module: change settype PARAM_TEXT to PARAM_NOTAGS

This commit is contained in:
Rossiani Wijaya
2013-06-13 15:34:18 +08:00
parent a015bc030c
commit f2a41c5136
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -477,7 +477,7 @@ class lesson_add_page_form_matching extends lesson_add_page_form_base {
$label = get_string('matchesanswer','lesson');
$count = $i;
$this->_form->addElement('text', 'response_editor['.$count.']', $label, array('size'=>'50'));
$this->_form->setType('response_editor['.$count.']', PARAM_TEXT);
$this->_form->setType('response_editor['.$count.']', PARAM_NOTAGS);
$this->_form->setDefault('response_editor['.$count.']', '');
if ($required) {
$this->_form->addRule('response_editor['.$count.']', get_string('required'), 'required', null, 'client');
@@ -526,8 +526,7 @@ class lesson_display_answer_form_matching extends moodleform {
if ($hasattempt) {
$responseid = 'response_'.$answer->id;
$mform->addElement('hidden', 'response['.$answer->id.']', htmlspecialchars(trim($answers[$useranswers[$i]]->response)));
// Temporary fixed until MDL-38885 gets integrated
$mform->setType('response', PARAM_TEXT);
$mform->setType('response', PARAM_NOTAGS);
}
$mform->addElement('select', $responseid, format_text($answer->answer,$answer->answerformat,$options), $responseoptions, $disabled);
$mform->setType($responseid, PARAM_TEXT);
+1 -1
View File
@@ -553,7 +553,7 @@ class lesson_display_answer_form_multichoice_multianswer extends moodleform {
if ($hasattempt && in_array($answer->id, $useranswers)) {
$answerid = 'answer_'.$answer->id;
$mform->addElement('hidden', 'answer['.$answer->id.']', $answer->answer);
$mform->setType('answer['.$answer->id.']', PARAM_TEXT);
$mform->setType('answer['.$answer->id.']', PARAM_NOTAGS);
$mform->setDefault($answerid, true);
$mform->setDefault('answer['.$answer->id.']', true);
}