/**
  * Test two questions. Max score = 2
  * @test
  * @dataProvider answerDataProvider
  * @param int $expected
  * @param array $answers
  */
 public function calculateScoreForAnswersWorks($expected, $answers)
 {
     $exercise = new MultipleChoiceSameAnswerExercise();
     $question = new MultipleChoiceQuestion();
     $question->setText('Question');
     $rightAnswer = new MultipleChoicePossibleAnswer();
     $rightAnswer->setNumber(0);
     $rightAnswer->setText('Answer');
     $rightAnswer->setIsCorrectAnswer(true);
     $question->addPossibleAnswer($rightAnswer);
     $wrongAnswer = new MultipleChoicePossibleAnswer();
     $wrongAnswer->setNumber(1);
     $wrongAnswer->setText('Answer');
     $wrongAnswer->setIsCorrectAnswer(false);
     $question->addPossibleAnswer($wrongAnswer);
     $exercise->addQuestion($question);
     $question = new MultipleChoiceQuestion();
     $question->setText('Question');
     $rightAnswer = new MultipleChoicePossibleAnswer();
     $rightAnswer->setNumber(0);
     $rightAnswer->setText('Answer');
     $rightAnswer->setIsCorrectAnswer(true);
     $question->addPossibleAnswer($rightAnswer);
     $rightAnswer = new MultipleChoicePossibleAnswer();
     $rightAnswer->setNumber(1);
     $rightAnswer->setText('Answer');
     $rightAnswer->setIsCorrectAnswer(false);
     $question->addPossibleAnswer($rightAnswer);
     $exercise->addQuestion($question);
     $this->assertSame($expected, $exercise->calculateScoreForAnswers($answers));
 }
 /**
  * @param \_OurBrand_\Quiz\Domain\Model\Exercises\MultipleChoicePossibleAnswer $possibleAnswer
  */
 public function addPossibleAnswer($possibleAnswer)
 {
     $possibleAnswer->setQuestion($this);
     $possibleAnswer->setNumber($this->possibleAnswers->count());
     $this->possibleAnswers->add($possibleAnswer);
 }