Beispiel #1
0
 /**
  * implement the abstract method
  * Get score max possible for a QCM.
  *
  *
  * @param \UJM\ExoBundle\Entity\InteractionQCM $interQCM
  *
  * @return float
  */
 public function maxScore($interQCM = null)
 {
     $scoreMax = 0;
     if (!$interQCM->getWeightResponse()) {
         $scoreMax = $interQCM->getScoreRightResponse();
     } else {
         foreach ($interQCM->getChoices() as $choice) {
             if ($choice->getRightResponse()) {
                 $scoreMax += $choice->getWeight();
             }
         }
     }
     return $scoreMax;
 }