You are here

function quiz_admin_node_form_submit in Quiz 7.6

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

Submit function for quiz_admin_node_form

The default values are saved as the user settings for the "default user" The default user is created when quiz is installed. He has a unique uid, but doesn't exist as a real user.

Why? Default user settings can be loaded and saved using the same code and database tables as any other user settings, making the code a lot easier to maintain. Ref: http://en.wikipedia.org/wiki/Don%27t_repeat_yourself

1 string reference to 'quiz_admin_node_form_submit'
quiz_admin_node_form in ./quiz.admin.inc
Renders the quiz node form for the admin pages

File

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

Code

function quiz_admin_node_form_submit($form, &$form_state) {

  // We add the uid for the "default user"
  // Generate the node object:
  $node = (object) $form_state['values'];
  $node->uid = 0;
  $node->nid = 0;
  $node->vid = 0;
  quiz_update_defaults($node);
  $form_state['node'] = $node;
}