You are here

function quiz_allow_score_access in Quiz 7.4

Same name and namespace in other branches
  1. 7.6 quiz.module \quiz_allow_score_access()
  2. 7.5 quiz.module \quiz_allow_score_access()

Checks if the user has access to save score for his quiz.

3 calls to quiz_allow_score_access()
quiz_take_quiz in ./quiz.module
Handles quiz taking.
theme_quiz_admin_summary in ./quiz.admin.inc
Theme the summary page for admins.
theme_quiz_user_summary in ./quiz.pages.inc
Theme the summary page for user results.

File

./quiz.module, line 4133
Quiz Module

Code

function quiz_allow_score_access($quiz, $account = NULL) {
  global $user;
  if ($account == NULL) {
    $account = $user;
  }
  $access = user_access('score any quiz') || user_access('score own quiz') && $quiz->uid && $account->uid;
  return $access;
}