/** * implement the abstract method * Get score max possible for an open question. * * * @param \UJM\ExoBundle\Entity\InteractionOpen $interOpen * * @return float */ public function maxScore($interOpen = null) { $em = $this->doctrine->getManager(); $scoreMax = 0; if ($interOpen->getTypeOpenQuestion() === 'long') { $scoreMax = $interOpen->getScoreMaxLongResp(); } elseif ($interOpen->getTypeOpenQuestion() === 'oneWord') { $scoreMax = $em->getRepository('UJMExoBundle:WordResponse')->getScoreMaxOneWord($interOpen->getId()); } elseif ($interOpen->getTypeOpenQuestion() === 'short') { $scoreMax = $em->getRepository('UJMExoBundle:WordResponse')->getScoreMaxShort($interOpen->getId()); } return $scoreMax; }