You are here

function opigno_quiz_app_node_insert in Opigno Quiz App 7

Implements hook_node_insert().

File

./opigno_quiz_app.module, line 346
Module file. Defines module hooks.

Code

function opigno_quiz_app_node_insert($node) {
  if ($node->type == 'quiz' && !empty($node->nid) && !empty($node->og_group_ref)) {
    foreach ($node->og_group_ref as $lang => $items) {
      foreach ($items as $item) {

        // Set a default weight of 0.
        opigno_quiz_app_set_course_quiz_weight($item['target_id'], $node->nid);
      }
    }
  }
}