mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 05:25:08 +02:00
Merge branch 'MDL-39369' of git://github.com/rwijaya/moodle
This commit is contained in:
commit
d63082454b
@ -762,14 +762,12 @@ 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);
|
||||
$this->_form->setType($name, PARAM_INT);
|
||||
if ($value !== null) {
|
||||
$this->_form->setDefault($name, $value);
|
||||
}
|
||||
|
@ -477,8 +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'));
|
||||
// Temporary fix until MDL-38885 gets integrated.
|
||||
$this->_form->setType('response_editor', 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');
|
||||
@ -527,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);
|
||||
|
@ -553,8 +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);
|
||||
// Temporary fix until MDL-38885 gets integrated.
|
||||
$mform->setType('answer', PARAM_TEXT);
|
||||
$mform->setType('answer['.$answer->id.']', PARAM_NOTAGS);
|
||||
$mform->setDefault($answerid, true);
|
||||
$mform->setDefault('answer['.$answer->id.']', true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user