You are here

function opigno_quiz_app_rules_quiz_property_is in Opigno Quiz App 7

Condition: Data comparison for a quiz property.

File

./opigno_quiz_app.rules.inc, line 115
Rules hook definitions. Many of these should be moved back to the Quiz Rules module once it's ported.

Code

function opigno_quiz_app_rules_quiz_property_is($node, $property, $value, $settings) {
  $property_value = db_select('quiz_node_properties', 'q')
    ->fields('q', array(
    $property,
  ))
    ->condition('q.nid', $node->nid)
    ->execute()
    ->fetchField();
  return $property_value == $value;
}