You are here

function _quiz_check_num_random in Quiz 8.4

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

If a quiz is saved as not randomized we should make sure all random questions are converted to always.

Parameters

$node: Quiz node.

2 calls to _quiz_check_num_random()
quiz_node_insert in ./quiz.module
quiz_options_form_submit in ./quiz.pages.inc
Page callback for quiz options submit

File

./quiz.module, line 1163
Quiz Module

Code

function _quiz_check_num_random(&$node) {
  if ($node->randomization == 2) {
    return;
  }
  db_delete('quiz_node_relationship')
    ->condition('question_status', QUESTION_RANDOM)
    ->condition('parent_vid', $node
    ->getRevisionId())
    ->execute();
}