MDL-50941 mod_feedback: change default legnth for shorttext to 255
authorMarina Glancy <marina@moodle.com>
Mon, 14 Mar 2016 14:21:30 +0000 (22:21 +0800)
committerMarina Glancy <marina@moodle.com>
Fri, 18 Mar 2016 00:18:54 +0000 (08:18 +0800)
mod/feedback/item/textfield/lib.php
mod/feedback/item/textfield/textfield_form.php

index 77027c1..017f9aa 100644 (file)
@@ -55,7 +55,7 @@ class feedback_item_textfield extends feedback_item_base {
             $itemsize = 30;
         }
 
-        $itemlength = isset($size_and_length[1]) ? $size_and_length[1] : 5;
+        $itemlength = isset($size_and_length[1]) ? $size_and_length[1] : 255;
 
         $item->itemsize = $itemsize;
         $item->itemmaxlength = $itemlength;
index 9361dff..da64f61 100644 (file)
@@ -44,10 +44,10 @@ class feedback_textfield_form extends feedback_item_form {
                             get_string('textfield_size', 'feedback').'&nbsp;',
                             array_slice(range(0, 255), 5, 255, true));
 
-        $mform->addElement('select',
+        $mform->addElement('text',
                             'itemmaxlength',
-                            get_string('textfield_maxlength', 'feedback').'&nbsp;',
-                            array_slice(range(0, 255), 5, 255, true));
+                            get_string('textfield_maxlength', 'feedback'));
+        $mform->setType('itemmaxlength', PARAM_INT);
 
         parent::definition();
         $this->set_data($item);