/**
  * @param \_OurBrand_\Quiz\Domain\Model\Exercises\DragAndDropQuestion $question
  */
 public function addQuestion($question)
 {
     $question->setExercise($this);
     $question->setNumber($this->questions->count());
     $question->setSorting($this->questions->count());
     $this->questions->add($question);
     $this->maxScore = count($this->getRealQuestions());
 }
 /**
  * @dataProvider questionDataProvider
  * @param array $data
  */
 public function testGetQuestions($data)
 {
     $exercise = new DragAndDropWordToQuestionExercise();
     $questions = new \Doctrine\Common\Collections\ArrayCollection();
     foreach ($data as $row) {
         $question = new DragAndDropQuestion();
         $question->setQuestion($row['question']);
         $question->setAnswer($row['answer']);
         $questions->add($question);
     }
     $this->assertNull($exercise->setQuestions($questions));
     $this->assertSame($questions, $exercise->getQuestions());
 }