MDL-23542 adding support for cols and rows in textarea editor, fixing lesson to use smaller text areas
This commit is contained in:
+4
-1
@@ -201,7 +201,10 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element {
|
||||
/// print text area - TODO: add on-the-fly switching, size configuration, etc.
|
||||
$editor->use_editor($id, $this->_options, $fpoptions);
|
||||
|
||||
$str .= '<div><textarea id="'.$id.'" name="'.$elname.'[text]" rows="15" cols="80">';
|
||||
$rows = empty($this->_attributes['rows']) ? 15 : $this->_attributes['rows'];
|
||||
$cols = empty($this->_attributes['cols']) ? 80 : $this->_attributes['cols'];
|
||||
|
||||
$str .= '<div><textarea id="'.$id.'" name="'.$elname.'[text]" rows="'.$rows.'" cols="'.$cols.'">';
|
||||
$str .= s($text);
|
||||
$str .= '</textarea></div>';
|
||||
|
||||
|
||||
@@ -784,7 +784,7 @@ abstract class lesson_add_page_form_base extends moodleform {
|
||||
if ($label === NULL) {
|
||||
$label = get_string('answer', 'lesson');
|
||||
}
|
||||
$this->_form->addElement('editor', 'answer_editor['.$count.']', $label, null, array('noclean'=>true));
|
||||
$this->_form->addElement('editor', 'answer_editor['.$count.']', $label, array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true));
|
||||
$this->_form->setDefault('answer_editor['.$count.']', array('text'=>'', 'format'=>FORMAT_MOODLE));
|
||||
if ($required) {
|
||||
$this->_form->addRule('answer_editor['.$count.']', get_string('required'), 'required', null, 'client');
|
||||
@@ -802,7 +802,7 @@ abstract class lesson_add_page_form_base extends moodleform {
|
||||
if ($label === NULL) {
|
||||
$label = get_string('response', 'lesson');
|
||||
}
|
||||
$this->_form->addElement('editor', 'response_editor['.$count.']', $label, null, array('noclean'=>true));
|
||||
$this->_form->addElement('editor', 'response_editor['.$count.']', $label, array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true));
|
||||
$this->_form->setDefault('response_editor['.$count.']', array('text'=>'', 'format'=>FORMAT_MOODLE));
|
||||
if ($required) {
|
||||
$this->_form->addRule('response_editor['.$count.']', get_string('required'), 'required', null, 'client');
|
||||
|
||||
@@ -434,12 +434,12 @@ class lesson_add_page_form_matching extends lesson_add_page_form_base {
|
||||
public function custom_definition() {
|
||||
|
||||
$this->_form->addElement('header', 'correctresponse', get_string('correctresponse', 'lesson'));
|
||||
$this->_form->addElement('editor', 'answer_editor[0]', get_string('correctresponse', 'lesson'), null, array('noclean'=>true));
|
||||
$this->_form->addElement('editor', 'answer_editor[0]', get_string('correctresponse', 'lesson'), array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true));
|
||||
$this->add_jumpto(0, get_string('correctanswerjump','lesson'));
|
||||
$this->add_score(0, get_string("correctanswerscore", "lesson"));
|
||||
|
||||
$this->_form->addElement('header', 'wrongresponse', get_string('wrongresponse', 'lesson'));
|
||||
$this->_form->addElement('editor', 'answer_editor[1]', get_string('wrongresponse', 'lesson'), null, array('noclean'=>true));
|
||||
$this->_form->addElement('editor', 'answer_editor[1]', get_string('wrongresponse', 'lesson'), array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true));
|
||||
$this->add_jumpto(1, get_string('wronganswerjump','lesson'));
|
||||
$this->add_score(1, get_string("wronganswerscore", "lesson"));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user