O'Reilly logo

Moodle 3.x Developer's Guide by Ian Wild

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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'] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required