$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
+ $mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
// Introduction.
$this->add_intro_editor(false, get_string('introduction', 'quiz'));
$mform->addElement('header', 'display', get_string('display', 'form'));
// Show user picture.
- $mform->addElement('selectyesno', 'showuserpicture',
- get_string('showuserpicture', 'quiz'));
+ $mform->addElement('select', 'showuserpicture', get_string('showuserpicture', 'quiz'), array(
+ QUIZ_SHOWIMAGE_NONE => get_string('shownoimage', 'quiz'),
+ QUIZ_SHOWIMAGE_SMALL => get_string('showsmallimage', 'quiz'),
+ QUIZ_SHOWIMAGE_LARGE => get_string('showlargeimage', 'quiz')));
$mform->addHelpButton('showuserpicture', 'showuserpicture', 'quiz');
$mform->setAdvanced('showuserpicture', $quizconfig->showuserpicture_adv);
$mform->setDefault('showuserpicture', $quizconfig->showuserpicture);