You are here

function _quiz_check_num_always in Quiz 7

Same name and namespace in other branches
  1. 8.4 quiz.module \_quiz_check_num_always()
  2. 6.4 quiz.module \_quiz_check_num_always()
  3. 7.6 quiz.module \_quiz_check_num_always()
  4. 7.4 quiz.module \_quiz_check_num_always()
  5. 7.5 quiz.module \_quiz_check_num_always()

If a quiz is saved with random categories we should make sure all questions are removed from the quiz

Parameters

$node: Quiz node.

2 calls to _quiz_check_num_always()
quiz_insert in ./quiz.module
Implements hook_insert().
quiz_update in ./quiz.module
Implements hook_update().

File

./quiz.module, line 3849
Quiz Module

Code

function _quiz_check_num_always(&$node) {
  if ($node->randomization != 3) {
    return;
  }
  db_delete('quiz_node_relationship')
    ->condition('parent_vid', $node->vid)
    ->execute();
}