plugin/exo/Manager/Item/ItemManager.php
public function calculateTotal(array $questionData)
    {
        // Get entities for score calculation
        $question = $this->serializer->deserialize($questionData, new Item());

        /** @var AnswerableItemDefinitionInterface $definition */
        $definition = $this->itemDefinitions->get($question->getMimeType());

        // Get the expected answer for the question
        $expected = $definition->expectAnswer($question->getInteraction());

        return $this->scoreManager->calculateTotal(json_decode($question->getScoreRule(), true), $expected, $question->getInteraction());
    }
public function calculateTotal(array $questionData)
    {
        // Get entities for score calculation
        $question = $this->serializer->deserialize($questionData, new Item());

        /** @var AnswerableItemDefinitionInterface $definition */
        $definition = $this->itemDefinitions->get($question->getMimeType());

        // Get the expected answer for the question
        $expected = $definition->expectAnswer($question->getInteraction());

        return $this->scoreManager->calculateTotal(json_decode($question->getScoreRule(), true), $expected, $question->getInteraction());
    }
public function calculateTotal ( array $ questionData ) { // Get entities for score calculation $ question = $ this -> serializer -> deserialize ( $ questionData , new Item ( ) ) ; /** @var AnswerableItemDefinitionInterface $definition */ $ definition = $ this -> itemDefinitions -> get ( $ question -> getMimeType ( ) ) ; // Get the expected answer for the question $ expected = $ definition -> expectAnswer ( $ question -> getInteraction ( ) ) ; return $ this -> scoreManager -> calculateTotal ( json_decode ( $ question -> getScoreRule ( ) , true ) , $ expected , $ question -> getInteraction ( ) ) ; }
Calculates the total score of a question.

@param array $questionData

@return float
Calculates the total score of a question .