You are here

function quiz_update_6417 in Quiz 6.4

Implementation of hook_update_N

Make sure all the max_scores in the database are updated.

File

./quiz.install, line 163
Quiz install schema for installing the quiz module

Code

function quiz_update_6417() {
  $results = array();
  $sql = "UPDATE {quiz_node_properties} qnp\n          SET max_score = max_score_for_random * number_of_random_questions + (\n            SELECT SUM(max_score)\n            FROM {quiz_node_relationship} qnr\n            WHERE qnr.question_status = 1\n            AND parent_vid = qnp.vid\n          )";
  $results[] = update_sql($sql);
  return $results;
}