You are here

public function MultichoiceResponse::isAllWrong in Quiz 8.4

If all answers in a question is wrong

Return value

boolean TRUE if all answers are wrong. False otherwise.

1 call to MultichoiceResponse::isAllWrong()
MultichoiceResponse::score in question_types/multichoice/lib/Drupal/multichoice/MultichoiceResponse.php
Implementation of score

File

question_types/multichoice/lib/Drupal/multichoice/MultichoiceResponse.php, line 164

Class

MultichoiceResponse
Extension of QuizQuestionResponse

Namespace

Drupal\multichoice

Code

public function isAllWrong() {
  foreach ($this->question->alternatives as $key => $alt) {
    if ($alt['score_if_chosen'] > 0 || $alt['score_if_not_chosen'] > 0) {
      return FALSE;
    }
  }
  return TRUE;
}