Editing choices

The choice activity configuration form /mod_form.php is currently scripted such that choices are specified using text boxes:

$repeatarray = array();$repeatarray[] = $mform->createElement('text', 'option',                                       get_string('optionno',                                       'choice'));$repeatarray[] = $mform->createElement('text', 'limit',                                       get_string('limitno',                                       'choice'));$repeatarray[] = $mform->createElement('hidden', 'optionid', 0);if ($this->_instance){       $repeatno = $DB->count_records('choice_options',                                     array('choiceid'=>$this-                                     >_instance));      $repeatno += 2;}else{      $repeatno = 5;}$repeateloptions = array();$repeateloptions['limit']['default'] = 0;$repeateloptions['limit']['disabledif'] = array('limitanswers', 'eq', 0);$repeateloptions['limit']['rule'] = 'numeric';$repeateloptions['limit']['type'] ...

Get Moodle 3.x Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.