June 2017
Beginner to intermediate
368 pages
8h 31m
English
Having prepared the data layer, we now need to consider how to update the plugin configuration form. In Eclipse, open \mod_form.php and let's look at the declaration of mod_choice_mod_form. It extends moodleform_mod, the base class upon which all Moodle forms should be based (details are available at https://docs.moodle.org/dev/Form_API). Check out how Moodle creates repeated elements:
$repeatarray = array(); $repeatarray[] = $mform->createElement('header', '', get_string('option','enhancedchoice').' {no}'); $repeatarray[] = $mform->createElement('editor', 'option', get_string('option','enhancedchoice'), null, array('maxfiles'=>EDITOR_UNLIMITED_FILES, 'noclean'=>true, 'context'=>$this->context)); $repeatarray[] = $mform->createElement('text', ...Read now
Unlock full access