You are here

public function ChoiceQuestion::getMaximumScore in Quiz 6.6

Implementation of getMaximumScore.

(non-PHPdoc)

Overrides QuizQuestion::getMaximumScore

See also

sites/all/modules/quiz-DRUPAL-6--4/question_types/quiz_question/QuizQuestion#getMaximumScore()

File

question_types/choice/choice.classes.inc, line 550
The main classes for the choice question type.

Class

ChoiceQuestion
Implementation of QuizQuestion.

Code

public function getMaximumScore() {
  if ($this->node->choice_boolean) {
    return 1;
  }
  $max = 0;
  for ($i = 0; is_array($this->node->alternatives[$i]); $i++) {
    $short = $this->node->alternatives[$i];
    $max += max($short['score_if_chosen'], $short['score_if_not_chosen']);
  }
  return $max;
}