You are here

public function QuizQuestion::viewCanRevealCorrect in OG Quiz 7

Determines if the user can view the correct answers

Return value

boolean true iff the view may include the correct answers to the question

1 call to QuizQuestion::viewCanRevealCorrect()
LongAnswerQuestion::getNodeView in includes/og_long_answer.php
Implementation of getNodeView

File

includes/og_quiz_question.php, line 708
Classes used in the Quiz Question module.

Class

QuizQuestion
A base implementation of a quiz_question, adding a layer of abstraction between the node API, quiz API and the question types.

Code

public function viewCanRevealCorrect() {
  global $user;

  // permission overrides the hook
  if (user_access('view any quiz question correct response') || $user->uid == $this->node->uid) {
    return TRUE;
  }
  $results = module_invoke_all('answers_access', $this->node);
  $may_view_answers = in_array(TRUE, $results);
  return $may_view_answers;
}