diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 6eba8fcd9fe..1444fcee774 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -722,6 +722,7 @@ abstract class lesson_add_page_form_base extends moodleform { if ($this->_customdata['edit'] === true) { $mform->addElement('hidden', 'edit', 1); + $mform->setType('edit', PARAM_BOOL); $this->add_action_buttons(get_string('cancel'), get_string('savepage', 'lesson')); } else if ($this->qtype === 'questiontype') { $this->add_action_buttons(get_string('cancel'), get_string('addaquestionpage', 'lesson')); @@ -761,10 +762,14 @@ abstract class lesson_add_page_form_base extends moodleform { if ($label === null) { $label = get_string("score", "lesson"); } + $elname = $name; if (is_int($name)) { $name = "score[$name]"; + $elname = 'score'; } $this->_form->addElement('text', $name, $label, array('size'=>5)); + // Temporary fix until MDL-38885 gets integrated. + $this->_form->setType($elname, PARAM_INT); if ($value !== null) { $this->_form->setDefault($name, $value); } diff --git a/mod/lesson/pagetypes/matching.php b/mod/lesson/pagetypes/matching.php index b110d1de1e5..5592e4e4e21 100644 --- a/mod/lesson/pagetypes/matching.php +++ b/mod/lesson/pagetypes/matching.php @@ -477,6 +477,8 @@ 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')); + // Temporary fix until MDL-38885 gets integrated. + $this->_form->setType('response_editor', PARAM_TEXT); $this->_form->setDefault('response_editor['.$count.']', ''); if ($required) { $this->_form->addRule('response_editor['.$count.']', get_string('required'), 'required', null, 'client'); @@ -525,7 +527,8 @@ 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))); - $mform->setType('response['.$answer->id.']', PARAM_TEXT); + // Temporary fixed until MDL-38885 gets integrated + $mform->setType('response', PARAM_TEXT); } $mform->addElement('select', $responseid, format_text($answer->answer,$answer->answerformat,$options), $responseoptions, $disabled); $mform->setType($responseid, PARAM_TEXT); diff --git a/mod/lesson/pagetypes/multichoice.php b/mod/lesson/pagetypes/multichoice.php index 8b914dd4e72..9025f921f44 100644 --- a/mod/lesson/pagetypes/multichoice.php +++ b/mod/lesson/pagetypes/multichoice.php @@ -553,7 +553,8 @@ 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); + // Temporary fix until MDL-38885 gets integrated. + $mform->setType('answer', PARAM_TEXT); $mform->setDefault($answerid, true); $mform->setDefault('answer['.$answer->id.']', true); }