You are here

function quiz_admin_node_form_validate in Quiz 7.6

Same name and namespace in other branches
  1. 8.4 quiz.admin.inc \quiz_admin_node_form_validate()
  2. 6.4 quiz.admin.inc \quiz_admin_node_form_validate()
  3. 7 quiz.admin.inc \quiz_admin_node_form_validate()
  4. 7.4 quiz.admin.inc \quiz_admin_node_form_validate()
  5. 7.5 quiz.admin.inc \quiz_admin_node_form_validate()

Validation function for the quiz_admin_node_form form

File

./quiz.admin.inc, line 302
Administrator interface for Quiz module.

Code

function quiz_admin_node_form_validate($form, &$form_state) {

  // Create dummy node for quiz_validate
  $dummy_node = new stdClass();
  foreach ($form_state['values'] as $key => $value) {
    $dummy_node->{$key} = $value;
  }
  $dummy_node->resultoptions = array();

  // We use quiz_validate to validate the default values
  quiz_validate($dummy_node);
}