function _quiz_check_num_always in Quiz 7.6
Same name and namespace in other branches
- 8.4 quiz.module \_quiz_check_num_always()
- 6.4 quiz.module \_quiz_check_num_always()
- 7 quiz.module \_quiz_check_num_always()
- 7.4 quiz.module \_quiz_check_num_always()
- 7.5 quiz.module \_quiz_check_num_always()
Remove all questions when the Quiz contains categorized random questions.
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 3305 - quiz.module Main file for the Quiz module.
Code
function _quiz_check_num_always($node) {
if ($node->randomization == 3) {
$efq = new EntityFieldQuery();
$results = $efq
->entityCondition('entity_type', 'quiz_question_relationship')
->propertyCondition('parent_vid', $node->vid)
->execute();
if (isset($results['quiz_question_relationship'])) {
entity_delete_multiple('quiz_question_relationship', array_keys($results['quiz_question_relationship']));
}
}
}