You are here

function choice_more_choices_submit in Quiz 6.6

1 string reference to 'choice_more_choices_submit'
ChoiceQuestion::getCreationForm in question_types/choice/choice.classes.inc
Implementation of getCreation form

File

question_types/choice/choice.module, line 119
The main file for choice.

Code

function choice_more_choices_submit($form, &$form_state) {

  // Set the form to rebuild and run submit handlers.
  node_form_submit_build_node($form, $form_state);
  $exists = 0;
  while (isset($form['alternatives'][$exists])) {
    $exists++;
  }

  // Make the changes we want to the form state.
  if ($form_state['values']['alternatives']['choice_add_alternative']) {
    $n = $_GET['q'] == 'choice/add_alternative_js' ? 1 : 3;
    $form_state['choice_count'] = $exists + $n;
  }
}