You are here

function _quiz_insert_resultoptions in Quiz 6.4

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

Insert call specific to result options.

This is called by quiz_insert().

Parameters

$node: The quiz node.

2 calls to _quiz_insert_resultoptions()
quiz_insert in ./quiz.module
Implementation of hook_insert().
_quiz_update_resultoptions in ./quiz.module
Modify result of option-specific updates.

File

./quiz.module, line 3033
Quiz Module

Code

function _quiz_insert_resultoptions($node) {
  if (!isset($node->resultoptions)) {
    return;
  }

  // We insert the result options one by one.
  foreach ($node->resultoptions as $id => $option) {
    if ($option['option_name']) {
      $option['nid'] = $node->nid;
      $option['vid'] = $node->vid;
      _quiz_insert_result_option($option);
    }
  }
}