You are here

public function MultichoiceResponse::isAllWrong in Quiz 7.6

Same name and namespace in other branches
  1. 6.4 question_types/multichoice/multichoice.classes.inc \MultichoiceResponse::isAllWrong()
  2. 7 question_types/multichoice/multichoice.classes.inc \MultichoiceResponse::isAllWrong()
  3. 7.4 question_types/multichoice/multichoice.classes.inc \MultichoiceResponse::isAllWrong()
  4. 7.5 question_types/multichoice/multichoice.classes.inc \MultichoiceResponse::isAllWrong()

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/multichoice.classes.inc
Implementation of score

File

question_types/multichoice/multichoice.classes.inc, line 942
The main classes for the multichoice question type.

Class

MultichoiceResponse
Extension of QuizQuestionResponse

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;
}