You are here

public function MatchingQuestion::getMaximumScore in Quiz 8.4

Implementation of getMaximumScore

Overrides QuizQuestion::getMaximumScore

See also

QuizQuestion#getMaximumScore()

File

question_types/matching/lib/Drupal/matching/MatchingQuestion.php, line 349
The main classes for the matching question type.

Class

MatchingQuestion
Extension of QuizQuestion.

Namespace

Drupal\matching

Code

public function getMaximumScore() {
  $to_return = 0;
  foreach ($this->node->match as $match) {
    if (empty($match['question']) || empty($match['answer'])) {
      continue;
    }
    $to_return++;
  }

  // The maximum score = the number of sub-questions
  return $to_return;
}