Exemplo n.º 1
0
 /**
  * Checks if user's answers are correct.
  * 
  * @param \Calculus\BaranekBundle\Entity\Step $step
  * @param \Array $answers
  * @return boolean
  */
 public function check(\Calculus\BaranekBundle\Entity\Step $step, array $answers) : bool
 {
     $type = $step->getStructureType();
     try {
         $checker = $this->factory->getChecker($type);
     } catch (\Exception $ex) {
         return false;
     }
     return $checker->isCorrect($answers);
 }