You are here

function quiz_insert in Quiz 6.3

Same name and namespace in other branches
  1. 5.2 quiz.module \quiz_insert()
  2. 5 quiz.module \quiz_insert()
  3. 6.6 quiz.module \quiz_insert()
  4. 6.2 quiz.module \quiz_insert()
  5. 6.4 quiz.module \quiz_insert()
  6. 6.5 quiz.module \quiz_insert()
  7. 7.6 quiz.module \quiz_insert()
  8. 7 quiz.module \quiz_insert()
  9. 7.4 quiz.module \quiz_insert()
  10. 7.5 quiz.module \quiz_insert()

Implementation of hook_insert().

1 call to quiz_insert()
quiz_update in ./quiz.module
Implementation of hook_update().

File

./quiz.module, line 394
Quiz Module

Code

function quiz_insert($node) {
  quiz_translate_form_date($node, 'quiz_open');
  quiz_translate_form_date($node, 'quiz_close');
  $tid = isset($node->tid) ? $node->tid : 0;
  if (!isset($node->has_userpoints)) {
    $node->has_userporints = 0;
  }
  $sql = "INSERT INTO {quiz_node_properties}\n    (vid, nid, aid, number_of_random_questions, shuffle,\n      backwards_navigation, quiz_open, quiz_close, takes, time_limit, pass_rate, summary_pass, summary_default, quiz_always, feedback_time, has_userpoints, tid)\n    VALUES(%d, %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, '%s', '%s', %d, %d, %d, %d)";
  db_query($sql, $node->vid, $node->nid, $node->aid, $node->number_of_random_questions, $node->shuffle, $node->backwards_navigation, $node->quiz_open, $node->quiz_close, $node->takes, $node->time_limit, $node->pass_rate, $node->summary_pass, $node->summary_default, $node->quiz_always, $node->feedback_time, $node->has_userpoints, $tid);
  _quiz_insert_resultoptions($node);
}