Exemple #1
0
 /**
  * Adds an input element to the complete form
  *
  * @param stdClass $item
  * @param mod_feedback_complete_form $form
  */
 public function complete_form_element($item, $form)
 {
     $name = $this->get_display_name($item);
     $inputname = $item->typ . '_' . $item->id;
     list($size, $maxlength) = explode("|", $item->presentation);
     $form->add_form_element($item, ['text', $inputname, $name, ['maxlength' => $maxlength, 'size' => $size]]);
     $form->set_element_type($inputname, PARAM_NOTAGS);
     $form->add_element_rule($inputname, get_string('maximumchars', '', $maxlength), 'maxlength', $maxlength, 'client');
 }