public function numericStatement($translatorevent, $questionAttempt, $question) {

        $translatorevent['interaction_type'] = 'numeric';


        $correctAnswerId = null;
        foreach ($question->answers as $answer) {
            if (intval($answer->fraction) === 1) {
                $correctAnswerId = $answer->id;
            }
        }

        $tolerance = 0;
        $toleranceType = 2;
        $answersdata = [];
        if ($question->qtype == "numerical") {
            $answersdata = $question->numerical->answers;
        } else if (strpos($question->qtype, 'calculated') === 0) {
            $answersdata = $question->calculated->answers;
        }

        if (!is_null($correctAnswerId) && count($answersdata) > 0) {
            foreach ($answersdata as $answerdata) {
                if(isset($answerdata->answer)){
                    if ($answerdata->answer == $correctAnswerId) {
                        $tolerance = floatval($answerdata->tolerance);
                        if (isset($answerdata->tolerancetype)) {
                            $toleranceType = intval($answerdata->tolerancetype);
                        }
                    }
                }
            }
        }

        $rigthtanswer = floatval($questionAttempt->rightanswer);
        if ($tolerance > 0) {
            $toleranceMax = $rigthtanswer + $tolerance;
            $toleranceMin = $rigthtanswer - $tolerance;
            switch ($toleranceType) {
                case 1:
                    $toleranceMax = $rigthtanswer + ($rigthtanswer * $tolerance);
                    $toleranceMin = $rigthtanswer - ($rigthtanswer * $tolerance);
                    break;
                case 3:
                    $toleranceMax = $rigthtanswer + ($rigthtanswer * $tolerance);
                    $toleranceMin = $rigthtanswer / (1 + $tolerance);
                    break;
                default:
                    break;
            }
            $rigthtanswerstring = strval($toleranceMin) . '[:]' . strval($toleranceMax);
            $translatorevent['interaction_correct_responses'] = [$rigthtanswerstring];
        } else {
            $translatorevent['interaction_correct_responses'] = [$questionAttempt->rightanswer];
        }

        return $translatorevent;
    }