/**
  * Add question-type specific form fields.
  *
  * @param MoodleQuickForm $mform the form being built.
  */
 protected function definition_inner($mform)
 {
     $this->qtypeobj = question_bank::get_qtype($this->qtype());
     $label = get_string('sharedwildcards', 'qtype_calculated');
     $mform->addElement('hidden', 'initialcategory', 1);
     $mform->addElement('hidden', 'reload', 1);
     $mform->setType('initialcategory', PARAM_INT);
     $html2 = $this->qtypeobj->print_dataset_definitions_category($this->question);
     $mform->insertElementBefore($mform->createElement('static', 'listcategory', $label, $html2), 'name');
     if (isset($this->question->id)) {
         $mform->insertElementBefore($mform->createElement('static', 'initialname', get_string('questionstoredname', 'qtype_calculated'), $this->initialname), 'name');
     }
     $addfieldsname = 'updatecategory';
     $addstring = get_string('updatecategory', 'qtype_calculated');
     $mform->registerNoSubmitButton($addfieldsname);
     $mform->insertElementBefore($mform->createElement('submit', $addfieldsname, $addstring), 'listcategory');
     $mform->registerNoSubmitButton('createoptionbutton');
     //editing as regular
     $mform->setType('single', PARAM_INT);
     $mform->addElement('hidden', 'shuffleanswers', '1');
     $mform->setType('shuffleanswers', PARAM_INT);
     $mform->addElement('hidden', 'answernumbering', 'abc');
     $mform->setType('answernumbering', PARAM_SAFEDIR);
     $this->add_per_answer_fields($mform, get_string('answerhdr', 'qtype_calculated', '{no}'), question_bank::fraction_options(), 1, 1);
     $repeated = array();
     $this->add_unit_options($mform, $this);
     $this->add_unit_fields($mform, $this);
     $this->add_interactive_settings();
     // Hidden elements
     $mform->addElement('hidden', 'synchronize', '');
     $mform->setType('synchronize', PARAM_INT);
     $mform->addElement('hidden', 'wizard', 'datasetdefinitions');
     $mform->setType('wizard', PARAM_ALPHA);
 }